Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/rpm/files/, app-arch/rpm/
Date: Thu, 14 Oct 2021 10:35:39
Message-Id: 1634207723.e5cb423fce8e53b944d560e438a0455ea0f1d81d.sam@gentoo
1 commit: e5cb423fce8e53b944d560e438a0455ea0f1d81d
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 14 10:34:09 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 14 10:35:23 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5cb423f
7
8 app-arch/rpm: add 4.17.0
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 app-arch/rpm/Manifest | 1 +
13 app-arch/rpm/files/rpm-4.17.0-libdir.patch | 32 ++++++
14 app-arch/rpm/rpm-4.17.0.ebuild | 154 +++++++++++++++++++++++++++++
15 3 files changed, 187 insertions(+)
16
17 diff --git a/app-arch/rpm/Manifest b/app-arch/rpm/Manifest
18 index 230ca396760..9473074a2a0 100644
19 --- a/app-arch/rpm/Manifest
20 +++ b/app-arch/rpm/Manifest
21 @@ -1 +1,2 @@
22 DIST rpm-4.16.1.3.tar.bz2 4354652 BLAKE2B 10013014bdeaf908b64c90f8e76f1d4b0cd0e8cb926f0cd979d7b1e1963b9a25c5b98531deea7e74e00168e2e6349f443fa4578c69c717ca1ab5e6b79d801f3a SHA512 54e503b32dffaa73d6168f26a00220d9d9124082d8a1eb1ddf34ce32a482f07cb06ec654cf065fca1607cc37b13fa7d4fa9895553541d7cfddecf68c9eb96f2e
23 +DIST rpm-4.17.0.tar.bz2 4514138 BLAKE2B e2618f7ac59189fb880d6be853aae99080b5008865298d095a123a010ab70f9e2e3ad9402124afbf8291a3863e9e805c9c65ab47cc435df82a729e81984394bf SHA512 d32af8649c6d47796a645b6ecbe580df97f5423bfb17414d5ed0016373f5cfab86ebcfad6c480fb8bfafaf3a960f9bc095ef6faad7b40bdb208cc60e4080b0c8
24
25 diff --git a/app-arch/rpm/files/rpm-4.17.0-libdir.patch b/app-arch/rpm/files/rpm-4.17.0-libdir.patch
26 new file mode 100644
27 index 00000000000..5bff26b7129
28 --- /dev/null
29 +++ b/app-arch/rpm/files/rpm-4.17.0-libdir.patch
30 @@ -0,0 +1,32 @@
31 +--- a/configure.ac
32 ++++ b/configure.ac
33 +@@ -865,13 +865,7 @@ AC_ARG_WITH([rundir],
34 + AC_DEFINE_UNQUOTED([RUNDIR],["${RUNDIR}"],[run-time variable directory])
35 + AC_SUBST(RUNDIR)
36 +
37 +-if test X"$prefix" = XNONE ; then
38 +- usrprefix="$ac_default_prefix"
39 +-else
40 +- usrprefix=$prefix
41 +-fi
42 +-
43 +-RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
44 ++RPMCONFIGDIR="`echo ${libexecdir}/rpm/`"
45 + AC_SUBST(RPMCONFIGDIR)
46 +
47 + AC_SUBST(OBJDUMP)
48 +--- a/rpm.am
49 ++++ b/rpm.am
50 +@@ -1,10 +1,10 @@
51 + # Internal binaries
52 + ## HACK: It probably should be $(libexecdir)/rpm or $(libdir)/rpm
53 +-rpmlibexecdir = $(prefix)/lib/rpm
54 ++rpmlibexecdir = $(pkglibexecdir)
55 +
56 + # Host independent config files
57 + ## HACK: it probably should be $(datadir)/rpm
58 +-rpmconfigdir = $(prefix)/lib/rpm
59 ++rpmconfigdir = $(pkglibexecdir)
60 +
61 + # Libtool version (current-revision-age) for all our libraries
62 + rpm_version_info = 11:0:2
63
64 diff --git a/app-arch/rpm/rpm-4.17.0.ebuild b/app-arch/rpm/rpm-4.17.0.ebuild
65 new file mode 100644
66 index 00000000000..ec6251d87d6
67 --- /dev/null
68 +++ b/app-arch/rpm/rpm-4.17.0.ebuild
69 @@ -0,0 +1,154 @@
70 +# Copyright 1999-2021 Gentoo Authors
71 +# Distributed under the terms of the GNU General Public License v2
72 +
73 +EAPI=7
74 +
75 +LUA_COMPAT=( lua5-{3,4} )
76 +PYTHON_COMPAT=( python3_{8,9,10} )
77 +
78 +inherit autotools flag-o-matic lua-single perl-module python-single-r1 toolchain-funcs
79 +
80 +DESCRIPTION="Red Hat Package Management Utils"
81 +HOMEPAGE="https://rpm.org
82 + https://github.com/rpm-software-management/rpm"
83 +SRC_URI="https://ftp.osuosl.org/pub/rpm/releases/rpm-$(ver_cut 1-2).x/${P}.tar.bz2
84 + http://ftp.rpm.org/releases/rpm-$(ver_cut 1-2).x/${P}.tar.bz2"
85 +
86 +LICENSE="GPL-2 LGPL-2"
87 +SLOT="0"
88 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
89 +
90 +# Tests are broken. See bug 657500
91 +RESTRICT="test"
92 +
93 +IUSE="acl caps +berkdb doc dbus nls openmp python selinux +sqlite test +zstd"
94 +REQUIRED_USE="${LUA_REQUIRED_USE}
95 + python? ( ${PYTHON_REQUIRED_USE} )"
96 +
97 +CDEPEND="!app-arch/rpm5
98 + app-arch/libarchive:=
99 + app-arch/xz-utils
100 + >=app-arch/bzip2-1.0.1
101 + >=app-crypt/gnupg-1.2
102 + >=dev-lang/perl-5.8.8
103 + dev-libs/elfutils
104 + dev-libs/libgcrypt:=
105 + sys-apps/file
106 + >=dev-libs/popt-1.7
107 + >=sys-libs/zlib-1.2.3-r1
108 + virtual/libintl
109 + ${LUA_DEPS}
110 + dbus? ( sys-apps/dbus )
111 + sqlite? ( dev-db/sqlite:3 )
112 + python? ( ${PYTHON_DEPS} )
113 + nls? ( virtual/libintl )
114 + acl? ( virtual/acl )
115 + caps? ( >=sys-libs/libcap-2.0 )
116 + zstd? ( app-arch/zstd:= )
117 +"
118 +DEPEND="${CDEPEND}
119 + nls? ( sys-devel/gettext )
120 + doc? ( app-doc/doxygen )
121 + virtual/pkgconfig
122 + test? ( sys-apps/fakechroot )
123 +"
124 +RDEPEND="${CDEPEND}
125 + selinux? ( sec-policy/selinux-rpm )
126 +"
127 +
128 +pkg_pretend() {
129 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
130 +}
131 +
132 +pkg_setup() {
133 + lua-single_pkg_setup
134 +
135 + use python && python-single-r1_pkg_setup
136 +
137 + # Added USE=openmp and this check for bug #779769
138 + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
139 +}
140 +
141 +src_prepare() {
142 + eapply "${FILESDIR}"/${PN}-4.8.1-db-path.patch
143 + eapply "${FILESDIR}"/${PN}-4.17.0-libdir.patch
144 +
145 + # fix #356769
146 + sed -i 's:%{_var}/tmp:/var/tmp:' macros.in || die "Fixing tmppath failed"
147 + # fix #492642
148 + sed -i "s:@__PYTHON@:${PYTHON}:" macros.in || die "Fixing %__python failed"
149 +
150 + eapply_user
151 + eautoreconf
152 +
153 + # Prevent automake maintainer mode from kicking in (#450448).
154 + touch -r Makefile.am preinstall.am || die
155 +}
156 +
157 +src_configure() {
158 + # rpm no longer supports berkdb, but has readonly support.
159 + # https://github.com/rpm-software-management/rpm/commit/4290300e24c5ab17c615b6108f38438e31eeb1d0
160 + econf \
161 + --without-selinux \
162 + --with-crypto=libgcrypt \
163 + $(use_enable berkdb bdb-ro) \
164 + $(use_enable python) \
165 + $(use_enable nls) \
166 + $(use_enable openmp) \
167 + $(use_enable dbus inhibit-plugin) \
168 + $(use_enable sqlite) \
169 + $(use_with caps cap) \
170 + $(use_with acl) \
171 + $(use_enable zstd zstd $(usex zstd yes no))
172 +}
173 +
174 +src_install() {
175 + default
176 +
177 + # remove la files
178 + find "${ED}" -name '*.la' -delete || die
179 +
180 + # fix symlinks to /bin/rpm (#349840)
181 + for binary in rpmquery rpmverify;do
182 + ln -sf rpm "${ED}"/usr/bin/${binary} || die
183 + done
184 +
185 + if ! use nls; then
186 + rm -rf "${ED}"/usr/share/man/?? || die
187 + fi
188 +
189 + keepdir /usr/src/rpm/{SRPMS,SPECS,SOURCES,RPMS,BUILD}
190 +
191 + dodoc CREDITS README*
192 + if use doc; then
193 + for docname in librpm; do
194 + docinto "html/${docname}"
195 + dodoc -r "doc/${docname}/html/."
196 + done
197 + fi
198 +
199 + # Fix perllocal.pod file collision
200 + perl_delete_localpod
201 +
202 + use python && python_optimize
203 +}
204 +
205 +src_test() {
206 + # Known to fail with FEATURES=usersandbox (bug #657500):
207 + if has usersandbox ${FEATURES} ; then
208 + ewarn "You are emerging ${P} with 'usersandbox' enabled." \
209 + "Expect some test failures or emerge with 'FEATURES=-usersandbox'!"
210 + fi
211 +
212 + emake check
213 +}
214 +
215 +pkg_postinst() {
216 + if [[ -f "${EROOT}"/var/lib/rpm/Packages ]] ; then
217 + einfo "RPM database found... Rebuilding database (may take a while)..."
218 + "${EROOT}"/usr/bin/rpmdb --rebuilddb --root="${EROOT}/" || die
219 + else
220 + einfo "No RPM database found... Creating database..."
221 + "${EROOT}"/usr/bin/rpmdb --initdb --root="${EROOT}/" || die
222 + fi
223 +}