blob: 0991f6d52abf3c307dea79c07697617f05042106 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "The RPM package management system"
2DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
3package management system capable of installing, uninstalling, \
4verifying, querying, and updating software packages. Each software \
5package consists of an archive of files along with information about \
6the package like its version, a description, etc."
7
8SUMMARY_${PN}-libs = "Libraries for manipulating RPM packages"
9DESCRIPTION_${PN}-libs = "This package contains the RPM shared libraries."
10
11SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
12DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
13development files will simplify the process of writing programs that \
14manipulate RPM packages and databases. These files are intended to \
15simplify the process of creating graphical package managers or any \
16other tools that need an intimate knowledge of RPM packages in order \
17to function."
18
19SUMMARY_${PN}-common = "Common RPM paths, scripts, documentation and configuration"
20DESCRIPTION_${PN}-common = "The rpm-common package contains paths, scripts, documentation \
21and configuration common between RPM Package Manager."
22
23SUMMARY_${PN}-build = "Scripts and executable programs used to build packages"
24DESCRIPTION_${PN}-build = "The rpm-build packagec ontains the scripts and executable programs \
25that are used to build packages using the RPM Package Manager."
26
27SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages"
28DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
29written in the Python programming language to use the interface \
30supplied by the RPM Package Manager libraries."
31
32SUMMARY_perl-module-rpm = "Perl bindings for apps which will manipulate RPM packages"
33DESCRIPTION_perl-modules-rpm = "The perl-modules-rpm package contains a module that permits applications \
34written in the Perl programming language to use the interface \
35supplied by the RPM Package Manager libraries."
36
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037HOMEPAGE = "http://rpm5.org/"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050038LICENSE = "LGPLv2.1 & Apache-2.0"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050040LIC_FILES_CHKSUM += "file://rpmio/mongo.c;begin=5;end=18;md5=d8327ba2c71664c059143e6d333b8901"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050042# We must have gettext-native, we need gettextize, which may not be provided
43DEPENDS = "libpcre attr acl ossp-uuid file byacc-native gettext-native"
Patrick Williamsf1e5d692016-03-30 15:21:19 -050044DEPENDS_append_class-native = " file-replacement-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046# Apply various fixups that are unique to the CVS environment
47do_fixup_unpack () {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048 # 'ln' isn't reliable, and 'mv' could break later builds
49 rm -rf ${S}/syck ; cp -r ${WORKDIR}/syck ${S}/.
50 rm -rf ${S}/lua ; cp -r ${WORKDIR}/lua ${S}/.
51 rm -rf ${S}/popt ; cp -r ${WORKDIR}/popt ${S}/.
52 rm -rf ${S}/beecrypt ; cp -r ${WORKDIR}/beecrypt ${S}/.
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053}
54
55addtask fixup_unpack after do_unpack before do_patch
56
57# This recipe is really designed for development... to Try out the latest
58# community work in progress.
59DEFAULT_PREFERENCE = "-1"
60
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050061S = "${WORKDIR}/rpm"
62
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063# rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed
64# in order to extract the distribution SRPM into a format we can extract...
65SRC_URI = "cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=rpm \
66 cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=syck \
67 cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=lua \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050068 cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=popt \
69 cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=beecrypt \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070 file://perfile_rpmdeps.sh \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050071 file://pythondeps.sh \
72"
73
74# Bug fixes
75SRC_URI += " \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076 file://header-include-fix.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050077 file://rpm-libsql-fix.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078 file://rpm-platform.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050079 file://rpm-platform2.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050080 file://rpm-tools-mtree-LDFLAGS.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081 file://rpm-canonarch.patch \
82 file://rpm-no-loopmsg.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083 file://rpm-resolvedep.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084 file://rpm-packageorigin.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085 file://uclibc-support.patch \
86 file://rpmatch.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087 file://makefile-am-exec-hook.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088 file://python-rpm-rpmsense.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050089 file://debugedit-segv.patch \
90 file://debugedit-valid-file-to-fix-segment-fault.patch \
91 file://rpm-platform-file-fix.patch \
92 file://rpm-lsb-compatibility.patch \
93 file://rpm-tag-generate-endian-conversion-fix.patch \
94 file://rpm-hardlink-segfault-fix.patch \
95 file://rpm-payload-use-hashed-inode.patch \
96 file://rpm-fix-logio-cp.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050097 file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
98 file://rpm-opendb-before-verifyscript-to-avoid-null-point.patch \
99 file://0001-define-EM_AARCH64.patch \
100 file://rpm-rpmfc.c-fix-for-N32-MIPS64.patch \
101 file://rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch \
102 file://rpm-mongodb-sasl.patch \
103 file://rpm-fix-parseEmbedded.patch \
104 file://rpm-rpmio-headers.patch \
105 file://rpm-python-restore-origin.patch \
106 file://rpm-keccak-sse-intrin.patch \
107 file://rpm-atomic-ops.patch \
108 file://rpm-gnu-atomic.patch \
109 file://rpm-tagname-type.patch \
110 file://rpm-python-tagname.patch \
111 file://rpm-python-AddErase.patch \
112 file://rpm-rpmpgp-popt.patch \
113 file://0001-Disable-__sync_add_and_fetch_8-on-nios2.patch \
114"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500115
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500116# OE specific changes
117SRC_URI += " \
118 file://rpm-log-auto-rm.patch \
119 file://rpm-db-reduce.patch \
120 file://rpm-autogen.patch \
121 file://rpm-showrc.patch \
122 file://rpm-fileclass.patch \
123 file://rpm-scriptletexechelper.patch \
124 file://rpmdeps-oecore.patch \
125 file://rpm-no-perl-urpm.patch \
126 file://rpm-macros.patch \
127 file://rpm-lua.patch \
128 file://rpm-ossp-uuid.patch \
129 file://rpm-uuid-include.patch \
130 file://rpm-pkgconfigdeps.patch \
131 file://no-ldflags-in-pkgconfig.patch \
132 file://dbconvert.patch \
133 file://rpm-db_buffer_small.patch \
134 file://rpm-py-init.patch \
135 file://rpm-reloc-macros.patch \
136 file://rpm-db5-or-db6.patch \
137 file://rpm-db60.patch \
138 file://rpmqv_cc_b_gone.patch \
139 file://rpm-realpath.patch \
140 file://rpm-check-rootpath-reasonableness.patch \
141 file://rpm-macros.in-disable-external-key-server.patch \
142 file://configure.ac-check-for-both-gpg2-and-gpg.patch \
143 file://rpm-disable-auto-stack-protector.patch \
144 file://popt-disable-auto-stack-protector.patch \
145 file://rpm-syck-fix-gram.patch \
146 file://rpm-rpmdb-grammar.patch \
147 file://rpm-disable-blaketest.patch \
148 file://rpm-autogen-force.patch \
149"
150
151SRC_URI_append_libc-musl = "\
152 file://0001-rpm-Fix-build-on-musl.patch \
153"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500154# Uncomment the following line to enable platform score debugging
155# This is useful when identifying issues with Smart being unable
156# to process certain package feeds.
157#SRC_URI += "file://rpm-debug-platform.patch"
158
159inherit autotools gettext
160
161acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java"
162
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500163# The local distribution macro directory
164distromacrodir = "${libdir}/rpm/poky"
165
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500166# Specify the default rpm macros in terms of adjustable variables
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500167rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros"
168rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
169rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500170
171# sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux
172
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500173# Set the digest algorithm used for verifying file integrity
174# If this value changes, and two different packages have different values
175# the "same file" validation (two packages have a non-conflict file)
176# will fail. This may lead to upgrade problems. You should treat this
177# value as a distribution wide setting, and only change it when you intend
178# a full system upgrade!
179#
180# Defined file digest algorithm values (note: not all are available!):
181# 1 MD5 (legacy RPM default)
182# 2 SHA1
183# 3 RIPEMD-160
184# 5 MD2
185# 6 TIGER-192
186# 8 SHA256
187# 9 SHA384
188# 10 SHA512
189# 11 SHA224
190# 104 MD4
191# 105 RIPEMD-128
192# 106 CRC-32
193# 107 ADLER-32
194# 108 CRC-64 (ECMA-182 polynomial, untested uint64_t problems)
195# 109 Jenkins lookup3.c hashlittle()
196# 111 RIPEMD-256
197# 112 RIPEMD-320
198# 188 BLAKE2B
199# 189 BLAKE2BP
200# 190 BLAKE2S
201# 191 BLAKE2SP
202RPM_FILE_DIGEST_ALGO ?= "1"
203
204# All packages build with RPM5 contain a non-repudiable signature.
205# The purpose of this signature is not to show authenticity of a package,
206# but instead act as a secondary package wide validation that shows it
207# wasn't damaged by accident in transport. (When later you sign the package,
208# this signature may or may not be replaced as there are three signature
209# slots, one for DSA/RSA, one for ECSDA, and one reserved.)
210#
211# There is a known issue w/ RSA signatures that if they start with an 0x00
212# the signing and validation may fail.
213#
214# The following is the list of choices for the non-rpudiable signature
215# (note: not all of these are implemented):
216# DSA (default)
217# RSA (implies SHA1)
218# ECDSA (implies SHA256)
219# DSA/SHA1
220# DSA/SHA224
221# DSA/SHA256
222# DSA/SHA384
223# DSA/SHA512
224# RSA/SHA1
225# RSA/SHA224
226# RSA/SHA256
227# RSA/SHA384
228# RSA/SHA512
229# ECDSA/SHA224 (using NIST P-224)
230# ECDSA/SHA256 (using NIST P-256)
231# ECDSA/SHA384 (using NIST P-384)
232# ECDSA/SHA512 (using NIST P-521)
233RPM_SELF_SIGN_ALGO ?= "DSA"
234
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500235# Note: perl and sqlite w/o db specified does not currently work.
236# tcl, augeas, nss, gcrypt, xar and keyutils support is untested.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500237PACKAGECONFIG ??= "db bzip2 zlib popt openssl libelf python"
238
239# Note: switching to internal popt may not work, as it will generate
240# a shared library which will intentionally not be packaged.
241#
242# If you intend to use the internal version, additional work may be required.
243PACKAGECONFIG[popt] = "--with-popt=external,--with-popt=internal,popt,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500244
245PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2,"
246PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz,"
247PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
248PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar,"
249
250WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
251 --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
252 --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
253 --without-pythonembed"
254PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python,"
255
256# Perl modules are not built, but they could be enabled fairly easily
257# the perl module creation and installation would need to be patched.
258# (currently has host perl contamination issues)
259WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm"
260WITHOUT_PERL = "--without-perl --without-perl-urpm"
261PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl,"
262
263# The --with-dbsql will only tell RPM to check for support, db
264# may or may not be built w/ the dbsql support.
265WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated"
266PACKAGECONFIG[db] = "${WITH_DB},--without-db,db,"
267
268PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3,"
269
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500270# This switch simply disables external beecrypt, RPM5 always uses beecrypt
271# for base64 processing and various digest algorithms.
272# Beecrypt is only the preferred crypto engine if it's the only engine enabled.
273PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--with-beecrypt=internal,beecrypt,"
274
275# --with-usecrypto= setting defined the item as the preferred system
276# crypto engine, which will take priority over the included beecrypt
277PACKAGECONFIG[openssl] = "--with-openssl --with-usecrypto=openssl,--without-openssl,openssl,"
278PACKAGECONFIG[nss] = "--with-nss --with-usecrypto=nss,--without-nss,nss,"
279PACKAGECONFIG[gcrypt] = "--with-gcrypt --with-usecrypto=gcrypt,--without-gcrypt,gcrypt,"
280
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500281PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils,"
282PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils,"
283
284WITH_SELINUX = "--with-selinux --with-sepol --with-semanage"
285WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage"
286PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux,"
287
288WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi"
289WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi"
290PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat,"
291
292PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat,"
293PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl,"
294
295PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas,"
296
297EXTRA_OECONF += "--verbose \
298 --sysconfdir=${sysconfdir} \
299 --with-file \
300 --with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \
301 --with-syck=internal \
302 --without-readline \
303 --without-libtasn1 \
304 --without-pakchois \
305 --without-gnutls \
306 --with-pcre \
307 --enable-utf8 \
308 --with-uuid \
309 --with-attr \
310 --with-acl \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500311 --with-pthreads \
312 --without-cudf \
313 --without-ficl \
314 --without-aterm \
315 --without-nix \
316 --without-bash \
317 --without-rc \
318 --without-js \
319 --without-gpsee \
320 --without-ruby \
321 --without-squirrel \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500322 --without-sasl2 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500323 --with-build-extlibdep \
324 --with-build-maxextlibdep \
325 --without-valgrind \
326 --disable-openmp \
327 --enable-build-pic \
328 --enable-build-versionscript \
329 --enable-build-warnings \
330 --enable-build-debug \
331 --enable-maintainer-mode \
332 --with-path-macros=${rpm_macros} \
333 --with-path-lib=${libdir}/rpm \
334 --with-bugreport=http://bugzilla.yoctoproject.org \
335 --program-prefix= \
336 YACC=byacc"
337
338CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE"
339
340LDFLAGS_append_libc-uclibc = "-lrt -lpthread"
341
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500342PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm perl-module-rpm ${PN}-locale"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500343
344SOLIBS = "5.4.so"
345
346# Based on %files section in the rpm.spec
347
348FILES_${PN} = "${bindir}/rpm \
349 ${bindir}/rpmconstant \
350 ${libdir}/rpm/rpm.* \
351 ${libdir}/rpm/tgpg \
352 ${libdir}/rpm/macros \
353 ${libdir}/rpm/rpmpopt \
354 ${libdir}/rpm/rpm2cpio \
355 ${libdir}/rpm/vcheck \
356 ${libdir}/rpm/helpers \
357 ${libdir}/rpm/qf \
358 ${libdir}/rpm/cpuinfo.yaml \
359 ${libdir}/rpm/bin/mtree \
360 ${libdir}/rpm/bin/rpmkey \
361 ${libdir}/rpm/bin/rpmrepo \
362 ${libdir}/rpm/bin/rpmrepo.real \
363 ${libdir}/rpm/bin/rpmspecdump \
364 ${libdir}/rpm/bin/rpmspecdump.real \
365 ${libdir}/rpm/bin/wget \
366 ${localstatedir}/cache \
367 ${localstatedir}/cache/rpm \
368 ${localstatedir}/cache/wdj \
369 ${localstatedir}/lib \
370 ${localstatedir}/lib/rpm \
371 ${localstatedir}/lib/wdj \
372 ${bindir}/rpm.real \
373 ${bindir}/rpmconstant.real \
374 ${bindir}/rpm2cpio.real \
375 "
376
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500377FILES_${PN}-common = "${bindir}/rpm2cpio \
378 ${bindir}/gendiff \
379 ${sysconfdir}/rpm \
380 ${localstatedir}/spool/repackage \
381 "
382
383FILES_${PN}-libs = "${libdir}/librpm-*.so \
384 ${libdir}/librpmconstant-*.so \
385 ${libdir}/librpmdb-*.so \
386 ${libdir}/librpmio-*.so \
387 ${libdir}/librpmmisc-*.so \
388 ${libdir}/librpmbuild-*.so \
389 "
390
391FILES_${PN}-build = "${prefix}/src/rpm \
392 ${bindir}/rpmbuild \
393 ${bindir}/rpmbuild.real \
394 ${libdir}/rpm/brp-* \
395 ${libdir}/rpm/check-files \
396 ${libdir}/rpm/cross-build \
397 ${libdir}/rpm/find-debuginfo.sh \
398 ${libdir}/rpm/find-lang.sh \
399 ${libdir}/rpm/find-prov.pl \
400 ${libdir}/rpm/find-provides.perl \
401 ${libdir}/rpm/find-req.pl \
402 ${libdir}/rpm/find-requires.perl \
403 ${libdir}/rpm/getpo.sh \
404 ${libdir}/rpm/http.req \
405 ${libdir}/rpm/javadeps.sh \
406 ${libdir}/rpm/mono-find-provides \
407 ${libdir}/rpm/mono-find-requires \
408 ${libdir}/rpm/executabledeps.sh \
409 ${libdir}/rpm/libtooldeps.sh \
410 ${libdir}/rpm/osgideps.pl \
411 ${libdir}/rpm/perldeps.pl \
412 ${libdir}/rpm/perl.prov \
413 ${libdir}/rpm/perl.req \
414 ${libdir}/rpm/php.prov \
415 ${libdir}/rpm/php.req \
416 ${libdir}/rpm/pkgconfigdeps.sh \
417 ${libdir}/rpm/pythondeps.sh \
418 ${libdir}/rpm/bin/debugedit \
419 ${libdir}/rpm/bin/debugedit.real \
420 ${libdir}/rpm/bin/rpmcache \
421 ${libdir}/rpm/bin/rpmcache.real \
422 ${libdir}/rpm/bin/rpmcmp \
423 ${libdir}/rpm/bin/rpmcmp.real \
424 ${libdir}/rpm/bin/rpmdeps \
425 ${libdir}/rpm/bin/rpmdeps.real \
426 ${libdir}/rpm/bin/rpmdeps-oecore \
427 ${libdir}/rpm/bin/rpmdeps-oecore.real \
428 ${libdir}/rpm/bin/rpmdigest \
429 ${libdir}/rpm/bin/rpmdigest.real \
430 ${libdir}/rpm/bin/abi-compliance-checker.pl \
431 ${libdir}/rpm/bin/api-sanity-autotest.pl \
432 ${libdir}/rpm/bin/chroot \
433 ${libdir}/rpm/bin/cp \
434 ${libdir}/rpm/bin/dbsql \
435 ${libdir}/rpm/bin/find \
436 ${libdir}/rpm/bin/install-sh \
437 ${libdir}/rpm/bin/lua \
438 ${libdir}/rpm/bin/luac \
439 ${libdir}/rpm/bin/mkinstalldirs \
440 ${libdir}/rpm/bin/rpmlua \
441 ${libdir}/rpm/bin/rpmluac \
442 ${libdir}/rpm/bin/sqlite3 \
443 ${libdir}/rpm/macros.d/cmake \
444 ${libdir}/rpm/macros.d/java \
445 ${libdir}/rpm/macros.d/libtool \
446 ${libdir}/rpm/macros.d/mandriva \
447 ${libdir}/rpm/macros.d/mono \
448 ${libdir}/rpm/macros.d/perl \
449 ${libdir}/rpm/macros.d/php \
450 ${libdir}/rpm/macros.d/pkgconfig \
451 ${libdir}/rpm/macros.d/python \
452 ${libdir}/rpm/macros.d/ruby \
453 ${libdir}/rpm/macros.d/selinux \
454 ${libdir}/rpm/macros.d/tcl \
455 ${libdir}/rpm/macros.rpmbuild \
456 ${libdir}/rpm/u_pkg.sh \
457 ${libdir}/rpm/vpkg-provides.sh \
458 ${libdir}/rpm/vpkg-provides2.sh \
459 ${libdir}/rpm/perfile_rpmdeps.sh \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500460 ${distromacrodir} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500461 "
462RDEPENDS_${PN} = "base-files run-postinsts"
463RDEPENDS_${PN}_class-native = ""
464RDEPENDS_${PN}_class-nativesdk = ""
465RDEPENDS_${PN}-build = "file bash perl"
466
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500467RDEPENDS_python-rpm = "${PN} python"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500468
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500469FILES_python-rpm = "${libdir}/python*/site-packages/rpm"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500470PROVIDES += "python-rpm"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500471
472FILES_perl-module-rpm = "${libdir}/perl/*/* \
473 "
474
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500475RDEPENDS_${PN}-dev += "bash"
476
477FILES_${PN}-dev = "${includedir}/rpm \
478 ${libdir}/librpm.la \
479 ${libdir}/librpm.so \
480 ${libdir}/librpmconstant.la \
481 ${libdir}/librpmconstant.so \
482 ${libdir}/librpmdb.la \
483 ${libdir}/librpmdb.so \
484 ${libdir}/librpmio.la \
485 ${libdir}/librpmio.so \
486 ${libdir}/librpmmisc.la \
487 ${libdir}/librpmmisc.so \
488 ${libdir}/librpmbuild.la \
489 ${libdir}/librpmbuild.so \
490 ${libdir}/rpm/lib/liblua.la \
491 ${libdir}/pkgconfig/rpm.pc \
492 ${libdir}/rpm/rpmdb_loadcvt \
493 "
494
495FILES_${PN}-staticdev = " \
496 ${libdir}/librpm.a \
497 ${libdir}/librpmconstant.a \
498 ${libdir}/librpmdb.a \
499 ${libdir}/librpmio.a \
500 ${libdir}/librpmmisc.a \
501 ${libdir}/librpmbuild.a \
502 ${libdir}/rpm/lib/liblua.a \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500503 ${libdir}/python*/site-packages/rpm/*.a \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500504 "
505
506do_configure() {
507 # Disable tests!
508 echo "all:" > ${S}/tests/Makefile.am
509 sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in
510
511 ( cd ${S}; ${S}/autogen.sh )
512
513 # NASTY hack to make sure configure files the right pkg-config file...
514 sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \
515 -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure
516
517 ( cd ${S}/syck ; set +e ; rm -- -l* ; make distclean ) || :
518
519 export varprefix=${localstatedir}
520 oe_runconf
521}
522
523do_install_append() {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500524 # Configure -distribution wide- package crypto settings
525 # If these change, effectively all packages have to be upgraded!
526 sed -i -e 's,%_build_file_digest_algo.*,%_build_sign ${RPM_FILE_DIGEST_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild
527 sed -i -e 's,%_build_sign.*,%_build_sign ${RPM_SELF_SIGN_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild
528
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500529 sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
530 sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
531 sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
532 sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros
533 sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros
534
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500535 # Enable MIPS64 N32 transactions. (This is a no-op on non-MIPS targets.)
536 sed -i -e 's,%_transaction_color[^_].*,%_transaction_color 7,' ${D}/${libdir}/rpm/macros
537
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500538 # Enable Debian style arbitrary tags...
539 sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
540
541 install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
542 install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
543
544 # Remove unpackaged files (based on list in rpm.spec)
545 rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
546
547 rm -f ${D}/${mandir}/man8/rpmcache.8*
548 rm -f ${D}/${mandir}/man8/rpmgraph.8*
549 rm -f ${D}/${mandir}/*/man8/rpmcache.8*
550 rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
551 rm -rf ${D}/${mandir}/{fr,ko}
552
553 rm -f ${D}/${includedir}/popt.h
554 rm -f ${D}/${libdir}/libpopt.*
555 rm -f ${D}/${libdir}/pkgconfig/popt.pc
556 rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
557 rm -f ${D}/${mandir}/man3/popt.3
558
559 rm -f ${D}/${mandir}/man1/xar.1*
560 rm -f ${D}/${bindir}/xar
561 rm -rf ${D}/${includedir}/xar
562 rm -f ${D}/${libdir}/libxar*
563
564 rm -f ${D}/${bindir}/lz*
565 rm -f ${D}/${bindir}/unlzma
566 rm -f ${D}/${bindir}/unxz
567 rm -f ${D}/${bindir}/xz*
568 rm -rf ${D}/${includedir}/lzma*
569 rm -f ${D}/${mandir}/man1/lz*.1
570 rm -f ${D}/${libdir}/pkgconfig/liblzma*
571
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500572 rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.a
573 rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.la
574 rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.a
575 rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.la
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500576
577 #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
578 # -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
579 #find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
580
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500581 rm -f ${D}/${libdir}/rpm/dbconvert.sh
582
583 rm -f ${D}/${libdir}/rpm/libsqldb.*
584
585 # We don't want, nor need the Mandriva multiarch items
586 rm -f ${D}/${bindir}/multiarch-dispatch
587 rm -f ${D}/${bindir}/multiarch-platform
588 rm -f ${D}/${libdir}/rpm/check-multiarch-files
589 rm -f ${D}/${libdir}/rpm/mkmultiarch
590 rm -f ${D}/${includedir}/multiarch-dispatch.h
591
592 rm -f ${D}/${libdir}/rpm/gstreamer.sh
593 rm -f ${D}/${libdir}/rpm/gem_helper.rb
594 rm -f ${D}/${libdir}/rpm/rubygems.rb
595 rm -f ${D}/${libdir}/rpm/kmod-deps.sh
596 rm -f ${D}/${libdir}/rpm/pythoneggs.py
597 rm -f ${D}/${libdir}/rpm/macros.d/kernel
598 rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
599 rm -f ${D}/${libdir}/rpm/bin/mgo
600 rm -f ${D}/${libdir}/rpm/bin/dbconvert
601 rm -f ${D}/${libdir}/rpm/bin/pom2spec
602
603 rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
604 rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
605
606}
607
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500608do_install_append_class-target() {
609 # Create and install distribution specific macros
610 mkdir -p ${D}/${distromacrodir}
611 cat << EOF > ${D}/${distromacrodir}/macros
612%_defaultdocdir ${docdir}
613
614%_prefix ${prefix}
615%_exec_prefix ${exec_prefix}
616%_datarootdir ${datadir}
617%_bindir ${bindir}
618%_sbindir ${sbindir}
619%_libexecdir %{_libdir}/%{name}
620%_datadir ${datadir}
621%_sysconfdir ${sysconfdir}
622%_sharedstatedir ${sharedstatedir}
623%_localstatedir ${localstatedir}
624%_lib lib
625%_libdir %{_exec_prefix}/%{_lib}
626%_includedir ${includedir}
627%_oldincludedir ${oldincludedir}
628%_infodir ${infodir}
629%_mandir ${mandir}
630%_localedir %{_libdir}/locale
631EOF
632
633 # Create and install multilib specific macros
634 ${@multilib_rpmmacros(d)}
635}
636
637do_install_append_class-native () {
638 sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env nativepython|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
639}
640
641do_install_append_class-nativesdk () {
642 sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env python|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
643}
644
645def multilib_rpmmacros(d):
646 localdata = d.createCopy()
647 # We need to clear the TOOLCHAIN_OPTIONS (--sysroot)
648 localdata.delVar('TOOLCHAIN_OPTIONS')
649
650 # Set 'localdata' values to be consistent with 'd' values.
651 localdata.setVar('distromacrodir', d.getVar('distromacrodir', True))
652 localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
653
654 ret = gen_arch_macro(localdata)
655
656 variants = d.getVar("MULTILIB_VARIANTS", True) or ""
657 for item in variants.split():
658 # Load overrides from 'd' to avoid having to reset the value...
659 localdata = d.createCopy()
660 overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
661 localdata.setVar("OVERRIDES", overrides)
662 localdata.setVar("MLPREFIX", item + "-")
663 bb.data.update_data(localdata)
664 ret += gen_arch_macro(localdata)
665 return ret
666
667def gen_arch_macro(d):
668 # Generate shell script to produce the file as part of do_install
669 val = "mkdir -p ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}\n"
670 val += "cat << EOF > ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}/macros\n"
671 val += "%_lib ${baselib}\n"
672 val += "%_libdir ${libdir}\n"
673 val += "%_localedir ${localedir}\n"
674 val += "\n"
675 val += "# Toolchain configuration\n"
676 val += "%TOOLCHAIN_OPTIONS %{nil}\n"
677 val += "%__ar ${@d.getVar('AR', True).replace('$','%')}\n"
678 val += "%__as ${@d.getVar('AS', True).replace('$','%')}\n"
679 val += "%__cc ${@d.getVar('CC', True).replace('$','%')}\n"
680 val += "%__cpp ${@d.getVar('CPP', True).replace('$','%')}\n"
681 val += "%__cxx ${@d.getVar('CXX', True).replace('$','%')}\n"
682 val += "%__ld ${@d.getVar('LD', True).replace('$','%')}\n"
683 val += "%__nm ${@d.getVar('NM', True).replace('$','%')}\n"
684 val += "%__objcopy ${@d.getVar('OBJCOPY', True).replace('$','%')}\n"
685 val += "%__objdump ${@d.getVar('OBJDUMP', True).replace('$','%')}\n"
686 val += "%__ranlib ${@d.getVar('RANLIB', True).replace('$','%')}\n"
687 val += "%__strip ${@d.getVar('STRIP', True).replace('$','%')}\n"
688 val += "EOF\n"
689 val += "\n"
690 return d.expand(val)
691
692
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500693add_native_wrapper() {
694 create_wrapper ${D}/${bindir}/rpm \
695 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
696 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
697 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
698
699 create_wrapper ${D}/${bindir}/rpm2cpio \
700 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
701 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
702 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
703
704 create_wrapper ${D}/${bindir}/rpmbuild \
705 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
706 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
707 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
708
709 create_wrapper ${D}/${bindir}/rpmconstant \
710 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
711 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
712 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
713
714 for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do
715 create_wrapper $rpm_binary \
716 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
717 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
718 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
719 done
720}
721
722do_install_append_class-native() {
723 add_native_wrapper
724}
725
726do_install_append_class-nativesdk() {
727 add_native_wrapper
728}
729
730BBCLASSEXTEND = "native nativesdk"