summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm_5.4.16.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm_5.4.16.bb')
-rw-r--r--meta/recipes-devtools/rpm/rpm_5.4.16.bb663
1 files changed, 663 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
new file mode 100644
index 0000000000..142706f30c
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -0,0 +1,663 @@
1SUMMARY = "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
37HOMEPAGE = "http://rpm5.org/"
38LICENSE = "LGPLv2.1 & Apache-2.0"
39LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
40LIC_FILES_CHKSUM += "file://rpmio/mongo.c;begin=5;end=18;md5=d8327ba2c71664c059143e6d333b8901"
41
42# We must have gettext-native, we need gettextize, which may not be provided
43DEPENDS = "libpcre attr acl ossp-uuid file byacc-native gettext-native"
44DEPENDS_append_class-native = " file-replacement-native"
45
46# rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed
47# in order to extract the distribution SRPM into a format we can extract...
48
49# There is no official 5.4.16 release yet, so start w/ 5.4.15 and patch it
50# based on CVS
51S = "${WORKDIR}/rpm-5.4.15"
52
53SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.15-0.20140824.src.rpm;name=srpm;extract=rpm-5.4.15.tar.gz \
54 http://downloads.yoctoproject.org/releases/rpm5/rpm-5.4.15-to-5.4.16-20160225.patch.gz;name=rpm-patch \
55 http://downloads.yoctoproject.org/releases/rpm5/syck-5.4.15-to-5.4.16-20160225.patch.gz;name=syck-patch \
56 http://downloads.yoctoproject.org/releases/rpm5/beecrypt-5.4.15-to-5.4.16-20160225.patch.gz;name=beecrypt-patch \
57 http://downloads.yoctoproject.org/releases/rpm5/lua-5.4.15-to-5.4.16-20160225.patch.gz;name=lua-patch \
58 file://perfile_rpmdeps.sh \
59 file://pythondeps.sh \
60"
61
62SRC_URI[srpm.md5sum] = "d53782842ac11b3100a43fb2958c9bc0"
63SRC_URI[srpm.sha256sum] = "d4ae5e9ed5df8ab9931b660f491418d20ab5c4d72eb17ed9055b80b71ef6c4ee"
64
65SRC_URI[rpm-patch.md5sum] = "8b7deb1c9574d3d47ed8ba8c690fd8bf"
66SRC_URI[rpm-patch.sha256sum] = "1c1983d001b04eaa23eb2c8d9598b9d0899acb0a89f54a2d4c4e974086fd17a5"
67
68SRC_URI[syck-patch.md5sum] = "f31d7a32105a364688354419ec3559e4"
69SRC_URI[syck-patch.sha256sum] = "4dd1d04489206d8b5d1970f2a8d143a002f2895cefbe15d73459785096545e8a"
70
71SRC_URI[beecrypt-patch.md5sum] = "9e71ee3ccb0a52985a071dd250279132"
72SRC_URI[beecrypt-patch.sha256sum] ="df7c0708a7fab9bdf6d46194519b42e736f99cb0599dcc1c3c1bf1b228705cde"
73
74SRC_URI[lua-patch.md5sum] = "ca10d03d83b1fc1c31a0b50819534cd7"
75SRC_URI[lua-patch.sha256sum] = "6bde435cc827a7d4b2520e8f3e1c9bd2ca74375de0a4402aa99ef4d48eab9a7e"
76
77# Bug fixes
78SRC_URI += " \
79 file://header-include-fix.patch \
80 file://rpm-libsql-fix.patch \
81 file://rpm-platform.patch \
82 file://rpm-platform2.patch \
83 file://rpm-tools-mtree-LDFLAGS.patch \
84 file://rpm-canonarch.patch \
85 file://rpm-no-loopmsg.patch \
86 file://rpm-resolvedep.patch \
87 file://rpm-packageorigin.patch \
88 file://uclibc-support.patch \
89 file://rpmatch.patch \
90 file://makefile-am-exec-hook.patch \
91 file://python-rpm-rpmsense.patch \
92 file://debugedit-segv.patch \
93 file://debugedit-valid-file-to-fix-segment-fault.patch \
94 file://rpm-platform-file-fix.patch \
95 file://rpm-lsb-compatibility.patch \
96 file://rpm-tag-generate-endian-conversion-fix.patch \
97 file://rpm-hardlink-segfault-fix.patch \
98 file://rpm-payload-use-hashed-inode.patch \
99 file://rpm-fix-logio-cp.patch \
100 file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
101 file://rpm-opendb-before-verifyscript-to-avoid-null-point.patch \
102 file://0001-define-EM_AARCH64.patch \
103 file://rpm-rpmfc.c-fix-for-N32-MIPS64.patch \
104 file://rpm-lib-transaction.c-fix-file-conflicts-for-mips64-N32.patch \
105 file://rpm-mongodb-sasl.patch \
106 file://rpm-fix-parseEmbedded.patch \
107 file://rpm-rpmio-headers.patch \
108 file://rpm-python-restore-origin.patch \
109 file://rpm-keccak-sse-intrin.patch \
110 file://rpm-atomic-ops.patch \
111 file://rpm-gnu-atomic.patch \
112 file://rpm-tagname-type.patch \
113 file://rpm-python-tagname.patch \
114 file://rpm-python-AddErase.patch \
115 file://rpm-rpmpgp-popt.patch \
116"
117
118# OE specific changes
119SRC_URI += " \
120 file://rpm-log-auto-rm.patch \
121 file://rpm-db-reduce.patch \
122 file://rpm-autogen.patch \
123 file://rpm-showrc.patch \
124 file://rpm-fileclass.patch \
125 file://rpm-scriptletexechelper.patch \
126 file://rpmdeps-oecore.patch \
127 file://rpm-no-perl-urpm.patch \
128 file://rpm-macros.patch \
129 file://rpm-lua.patch \
130 file://rpm-ossp-uuid.patch \
131 file://rpm-uuid-include.patch \
132 file://rpm-pkgconfigdeps.patch \
133 file://no-ldflags-in-pkgconfig.patch \
134 file://dbconvert.patch \
135 file://rpm-db_buffer_small.patch \
136 file://rpm-py-init.patch \
137 file://rpm-reloc-macros.patch \
138 file://rpm-db5-or-db6.patch \
139 file://rpm-db60.patch \
140 file://rpmqv_cc_b_gone.patch \
141 file://rpm-realpath.patch \
142 file://rpm-check-rootpath-reasonableness.patch \
143 file://rpm-macros.in-disable-external-key-server.patch \
144 file://configure.ac-check-for-both-gpg2-and-gpg.patch \
145 file://rpm-disable-auto-stack-protector.patch \
146 file://popt-disable-auto-stack-protector.patch \
147 file://rpm-syck-fix-gram.patch \
148 file://rpm-rpmdb-grammar.patch \
149 file://rpm-disable-blaketest.patch \
150"
151
152SRC_URI_append_libc-musl = "\
153 file://0001-rpm-Fix-build-on-musl.patch \
154"
155# Uncomment the following line to enable platform score debugging
156# This is useful when identifying issues with Smart being unable
157# to process certain package feeds.
158#SRC_URI += "file://rpm-debug-platform.patch"
159
160UPSTREAM_CHECK_REGEX = "rpm-(?P<pver>(\d+[\.\-_]*)+)-.*$"
161
162inherit autotools gettext
163
164acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java"
165
166# The local distribution macro directory
167distromacrodir = "${libdir}/rpm/poky"
168
169# Specify the default rpm macros in terms of adjustable variables
170rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros"
171rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
172rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
173
174# sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux
175
176# Note: perl and sqlite w/o db specified does not currently work.
177# tcl, augeas, nss, gcrypt, xar and keyutils support is untested.
178PACKAGECONFIG ??= "db bzip2 zlib popt openssl libelf python"
179
180# Note: switching to internal popt may not work, as it will generate
181# a shared library which will intentionally not be packaged.
182#
183# If you intend to use the internal version, additional work may be required.
184PACKAGECONFIG[popt] = "--with-popt=external,--with-popt=internal,popt,"
185
186PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2,"
187PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz,"
188PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
189PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar,"
190
191WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
192 --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
193 --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
194 --without-pythonembed"
195PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python,"
196
197# Perl modules are not built, but they could be enabled fairly easily
198# the perl module creation and installation would need to be patched.
199# (currently has host perl contamination issues)
200WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm"
201WITHOUT_PERL = "--without-perl --without-perl-urpm"
202PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl,"
203
204# The --with-dbsql will only tell RPM to check for support, db
205# may or may not be built w/ the dbsql support.
206WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated"
207PACKAGECONFIG[db] = "${WITH_DB},--without-db,db,"
208
209PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3,"
210
211PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--with-beecrypt=internal,beecrypt,"
212PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
213PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss,"
214PACKAGECONFIG[gcrypt] = "--with-gcrypt,--without-gcrypt,gcrypt,"
215PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils,"
216PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils,"
217
218WITH_SELINUX = "--with-selinux --with-sepol --with-semanage"
219WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage"
220PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux,"
221
222WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi"
223WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi"
224PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat,"
225
226PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat,"
227PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl,"
228
229PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas,"
230
231EXTRA_OECONF += "--verbose \
232 --sysconfdir=${sysconfdir} \
233 --with-file \
234 --with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \
235 --with-syck=internal \
236 --without-readline \
237 --without-libtasn1 \
238 --without-pakchois \
239 --without-gnutls \
240 --with-pcre \
241 --enable-utf8 \
242 --with-uuid \
243 --with-attr \
244 --with-acl \
245 --with-pthreads \
246 --without-cudf \
247 --without-ficl \
248 --without-aterm \
249 --without-nix \
250 --without-bash \
251 --without-rc \
252 --without-js \
253 --without-gpsee \
254 --without-ruby \
255 --without-squirrel \
256 --without-sasl2 \
257 --with-build-extlibdep \
258 --with-build-maxextlibdep \
259 --without-valgrind \
260 --disable-openmp \
261 --enable-build-pic \
262 --enable-build-versionscript \
263 --enable-build-warnings \
264 --enable-build-debug \
265 --enable-maintainer-mode \
266 --with-path-macros=${rpm_macros} \
267 --with-path-lib=${libdir}/rpm \
268 --with-bugreport=http://bugzilla.yoctoproject.org \
269 --program-prefix= \
270 YACC=byacc"
271
272CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE"
273
274LDFLAGS_append_libc-uclibc = "-lrt -lpthread"
275
276PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm perl-module-rpm ${PN}-locale"
277
278SOLIBS = "5.4.so"
279
280# Based on %files section in the rpm.spec
281
282FILES_${PN} = "${bindir}/rpm \
283 ${bindir}/rpmconstant \
284 ${libdir}/rpm/rpm.* \
285 ${libdir}/rpm/tgpg \
286 ${libdir}/rpm/macros \
287 ${libdir}/rpm/rpmpopt \
288 ${libdir}/rpm/rpm2cpio \
289 ${libdir}/rpm/vcheck \
290 ${libdir}/rpm/helpers \
291 ${libdir}/rpm/qf \
292 ${libdir}/rpm/cpuinfo.yaml \
293 ${libdir}/rpm/bin/mtree \
294 ${libdir}/rpm/bin/rpmkey \
295 ${libdir}/rpm/bin/rpmrepo \
296 ${libdir}/rpm/bin/rpmrepo.real \
297 ${libdir}/rpm/bin/rpmspecdump \
298 ${libdir}/rpm/bin/rpmspecdump.real \
299 ${libdir}/rpm/bin/wget \
300 ${localstatedir}/cache \
301 ${localstatedir}/cache/rpm \
302 ${localstatedir}/cache/wdj \
303 ${localstatedir}/lib \
304 ${localstatedir}/lib/rpm \
305 ${localstatedir}/lib/wdj \
306 ${bindir}/rpm.real \
307 ${bindir}/rpmconstant.real \
308 ${bindir}/rpm2cpio.real \
309 "
310
311FILES_${PN}-common = "${bindir}/rpm2cpio \
312 ${bindir}/gendiff \
313 ${sysconfdir}/rpm \
314 ${localstatedir}/spool/repackage \
315 "
316
317FILES_${PN}-libs = "${libdir}/librpm-*.so \
318 ${libdir}/librpmconstant-*.so \
319 ${libdir}/librpmdb-*.so \
320 ${libdir}/librpmio-*.so \
321 ${libdir}/librpmmisc-*.so \
322 ${libdir}/librpmbuild-*.so \
323 "
324
325FILES_${PN}-build = "${prefix}/src/rpm \
326 ${bindir}/rpmbuild \
327 ${bindir}/rpmbuild.real \
328 ${libdir}/rpm/brp-* \
329 ${libdir}/rpm/check-files \
330 ${libdir}/rpm/cross-build \
331 ${libdir}/rpm/find-debuginfo.sh \
332 ${libdir}/rpm/find-lang.sh \
333 ${libdir}/rpm/find-prov.pl \
334 ${libdir}/rpm/find-provides.perl \
335 ${libdir}/rpm/find-req.pl \
336 ${libdir}/rpm/find-requires.perl \
337 ${libdir}/rpm/getpo.sh \
338 ${libdir}/rpm/http.req \
339 ${libdir}/rpm/javadeps.sh \
340 ${libdir}/rpm/mono-find-provides \
341 ${libdir}/rpm/mono-find-requires \
342 ${libdir}/rpm/executabledeps.sh \
343 ${libdir}/rpm/libtooldeps.sh \
344 ${libdir}/rpm/osgideps.pl \
345 ${libdir}/rpm/perldeps.pl \
346 ${libdir}/rpm/perl.prov \
347 ${libdir}/rpm/perl.req \
348 ${libdir}/rpm/php.prov \
349 ${libdir}/rpm/php.req \
350 ${libdir}/rpm/pkgconfigdeps.sh \
351 ${libdir}/rpm/pythondeps.sh \
352 ${libdir}/rpm/bin/debugedit \
353 ${libdir}/rpm/bin/debugedit.real \
354 ${libdir}/rpm/bin/rpmcache \
355 ${libdir}/rpm/bin/rpmcache.real \
356 ${libdir}/rpm/bin/rpmcmp \
357 ${libdir}/rpm/bin/rpmcmp.real \
358 ${libdir}/rpm/bin/rpmdeps \
359 ${libdir}/rpm/bin/rpmdeps.real \
360 ${libdir}/rpm/bin/rpmdeps-oecore \
361 ${libdir}/rpm/bin/rpmdeps-oecore.real \
362 ${libdir}/rpm/bin/rpmdigest \
363 ${libdir}/rpm/bin/rpmdigest.real \
364 ${libdir}/rpm/bin/abi-compliance-checker.pl \
365 ${libdir}/rpm/bin/api-sanity-autotest.pl \
366 ${libdir}/rpm/bin/chroot \
367 ${libdir}/rpm/bin/cp \
368 ${libdir}/rpm/bin/dbsql \
369 ${libdir}/rpm/bin/find \
370 ${libdir}/rpm/bin/install-sh \
371 ${libdir}/rpm/bin/lua \
372 ${libdir}/rpm/bin/luac \
373 ${libdir}/rpm/bin/mkinstalldirs \
374 ${libdir}/rpm/bin/rpmlua \
375 ${libdir}/rpm/bin/rpmluac \
376 ${libdir}/rpm/bin/sqlite3 \
377 ${libdir}/rpm/macros.d/cmake \
378 ${libdir}/rpm/macros.d/java \
379 ${libdir}/rpm/macros.d/libtool \
380 ${libdir}/rpm/macros.d/mandriva \
381 ${libdir}/rpm/macros.d/mono \
382 ${libdir}/rpm/macros.d/perl \
383 ${libdir}/rpm/macros.d/php \
384 ${libdir}/rpm/macros.d/pkgconfig \
385 ${libdir}/rpm/macros.d/python \
386 ${libdir}/rpm/macros.d/ruby \
387 ${libdir}/rpm/macros.d/selinux \
388 ${libdir}/rpm/macros.d/tcl \
389 ${libdir}/rpm/macros.rpmbuild \
390 ${libdir}/rpm/u_pkg.sh \
391 ${libdir}/rpm/vpkg-provides.sh \
392 ${libdir}/rpm/vpkg-provides2.sh \
393 ${libdir}/rpm/perfile_rpmdeps.sh \
394 ${distromacrodir} \
395 "
396RDEPENDS_${PN} = "base-files run-postinsts"
397RDEPENDS_${PN}_class-native = ""
398RDEPENDS_${PN}_class-nativesdk = ""
399RDEPENDS_${PN}-build = "file bash perl"
400
401RDEPENDS_python-rpm = "${PN} python"
402
403FILES_python-rpm = "${libdir}/python*/site-packages/rpm"
404PROVIDES += "python-rpm"
405
406FILES_perl-module-rpm = "${libdir}/perl/*/* \
407 "
408
409RDEPENDS_${PN}-dev += "bash"
410
411FILES_${PN}-dev = "${includedir}/rpm \
412 ${libdir}/librpm.la \
413 ${libdir}/librpm.so \
414 ${libdir}/librpmconstant.la \
415 ${libdir}/librpmconstant.so \
416 ${libdir}/librpmdb.la \
417 ${libdir}/librpmdb.so \
418 ${libdir}/librpmio.la \
419 ${libdir}/librpmio.so \
420 ${libdir}/librpmmisc.la \
421 ${libdir}/librpmmisc.so \
422 ${libdir}/librpmbuild.la \
423 ${libdir}/librpmbuild.so \
424 ${libdir}/rpm/lib/liblua.la \
425 ${libdir}/pkgconfig/rpm.pc \
426 ${libdir}/rpm/rpmdb_loadcvt \
427 "
428
429FILES_${PN}-staticdev = " \
430 ${libdir}/librpm.a \
431 ${libdir}/librpmconstant.a \
432 ${libdir}/librpmdb.a \
433 ${libdir}/librpmio.a \
434 ${libdir}/librpmmisc.a \
435 ${libdir}/librpmbuild.a \
436 ${libdir}/rpm/lib/liblua.a \
437 ${libdir}/python*/site-packages/rpm/*.a \
438 "
439
440do_configure() {
441 # Disable tests!
442 echo "all:" > ${S}/tests/Makefile.am
443 sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in
444
445 ( cd ${S}; ${S}/autogen.sh )
446
447 # NASTY hack to make sure configure files the right pkg-config file...
448 sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \
449 -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure
450
451 ( cd ${S}/syck ; set +e ; rm -- -l* ; make distclean ) || :
452
453 export varprefix=${localstatedir}
454 oe_runconf
455}
456
457do_install_append() {
458 # Preserve the previous default of DSA self-signed pkgs
459 sed -i -e 's,%_build_sign.*,%_build_sign DSA,' ${D}/${libdir}/rpm/macros.rpmbuild
460
461 sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
462 sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
463 sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
464 sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros
465 sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros
466
467 # Enable MIPS64 N32 transactions. (This is a no-op on non-MIPS targets.)
468 sed -i -e 's,%_transaction_color[^_].*,%_transaction_color 7,' ${D}/${libdir}/rpm/macros
469
470 # Enable Debian style arbitrary tags...
471 sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
472
473 install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
474 install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
475
476 # Remove unpackaged files (based on list in rpm.spec)
477 rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
478
479 rm -f ${D}/${mandir}/man8/rpmcache.8*
480 rm -f ${D}/${mandir}/man8/rpmgraph.8*
481 rm -f ${D}/${mandir}/*/man8/rpmcache.8*
482 rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
483 rm -rf ${D}/${mandir}/{fr,ko}
484
485 rm -f ${D}/${includedir}/popt.h
486 rm -f ${D}/${libdir}/libpopt.*
487 rm -f ${D}/${libdir}/pkgconfig/popt.pc
488 rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
489 rm -f ${D}/${mandir}/man3/popt.3
490
491 rm -f ${D}/${mandir}/man1/xar.1*
492 rm -f ${D}/${bindir}/xar
493 rm -rf ${D}/${includedir}/xar
494 rm -f ${D}/${libdir}/libxar*
495
496 rm -f ${D}/${bindir}/lz*
497 rm -f ${D}/${bindir}/unlzma
498 rm -f ${D}/${bindir}/unxz
499 rm -f ${D}/${bindir}/xz*
500 rm -rf ${D}/${includedir}/lzma*
501 rm -f ${D}/${mandir}/man1/lz*.1
502 rm -f ${D}/${libdir}/pkgconfig/liblzma*
503
504 rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.{a,la}
505 rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la}
506
507 #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
508 # -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
509 #find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
510
511 # We don't want the default macro set
512 rm -rf ${D}/${libdir}/rpm/{i[3456]86*,athlon*,pentium*,x86_64*,alpha*,sparc*,ia64*,ppc*,s390*,armv[34][lb]*,armv[345]*,mips*,noarch*}
513
514 rm -f ${D}/${libdir}/rpm/dbconvert.sh
515
516 rm -f ${D}/${libdir}/rpm/libsqldb.*
517
518 # We don't want, nor need the Mandriva multiarch items
519 rm -f ${D}/${bindir}/multiarch-dispatch
520 rm -f ${D}/${bindir}/multiarch-platform
521 rm -f ${D}/${libdir}/rpm/check-multiarch-files
522 rm -f ${D}/${libdir}/rpm/mkmultiarch
523 rm -f ${D}/${includedir}/multiarch-dispatch.h
524
525 rm -f ${D}/${libdir}/rpm/gstreamer.sh
526 rm -f ${D}/${libdir}/rpm/gem_helper.rb
527 rm -f ${D}/${libdir}/rpm/rubygems.rb
528 rm -f ${D}/${libdir}/rpm/kmod-deps.sh
529 rm -f ${D}/${libdir}/rpm/pythoneggs.py
530 rm -f ${D}/${libdir}/rpm/macros.d/kernel
531 rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
532 rm -f ${D}/${libdir}/rpm/bin/mgo
533 rm -f ${D}/${libdir}/rpm/bin/dbconvert
534 rm -f ${D}/${libdir}/rpm/bin/pom2spec
535
536 rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
537 rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
538
539}
540
541do_install_append_class-target() {
542 # Create and install distribution specific macros
543 mkdir -p ${D}/${distromacrodir}
544 cat << EOF > ${D}/${distromacrodir}/macros
545%_defaultdocdir ${docdir}
546
547%_prefix ${prefix}
548%_exec_prefix ${exec_prefix}
549%_datarootdir ${datadir}
550%_bindir ${bindir}
551%_sbindir ${sbindir}
552%_libexecdir %{_libdir}/%{name}
553%_datadir ${datadir}
554%_sysconfdir ${sysconfdir}
555%_sharedstatedir ${sharedstatedir}
556%_localstatedir ${localstatedir}
557%_lib lib
558%_libdir %{_exec_prefix}/%{_lib}
559%_includedir ${includedir}
560%_oldincludedir ${oldincludedir}
561%_infodir ${infodir}
562%_mandir ${mandir}
563%_localedir %{_libdir}/locale
564EOF
565
566 # Create and install multilib specific macros
567 ${@multilib_rpmmacros(d)}
568}
569
570do_install_append_class-native () {
571 sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env nativepython|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
572}
573
574do_install_append_class-nativesdk () {
575 sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env python|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
576}
577
578def multilib_rpmmacros(d):
579 localdata = d.createCopy()
580 # We need to clear the TOOLCHAIN_OPTIONS (--sysroot)
581 localdata.delVar('TOOLCHAIN_OPTIONS')
582
583 # Set 'localdata' values to be consistent with 'd' values.
584 localdata.setVar('distromacrodir', d.getVar('distromacrodir', True))
585 localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
586
587 ret = gen_arch_macro(localdata)
588
589 variants = d.getVar("MULTILIB_VARIANTS", True) or ""
590 for item in variants.split():
591 # Load overrides from 'd' to avoid having to reset the value...
592 localdata = d.createCopy()
593 overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
594 localdata.setVar("OVERRIDES", overrides)
595 localdata.setVar("MLPREFIX", item + "-")
596 bb.data.update_data(localdata)
597 ret += gen_arch_macro(localdata)
598 return ret
599
600def gen_arch_macro(d):
601 # Generate shell script to produce the file as part of do_install
602 val = "mkdir -p ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}\n"
603 val += "cat << EOF > ${D}/${distromacrodir}/${TARGET_ARCH}-${TARGET_OS}/macros\n"
604 val += "%_lib ${baselib}\n"
605 val += "%_libdir ${libdir}\n"
606 val += "%_localedir ${localedir}\n"
607 val += "\n"
608 val += "# Toolchain configuration\n"
609 val += "%TOOLCHAIN_OPTIONS %{nil}\n"
610 val += "%__ar ${@d.getVar('AR', True).replace('$','%')}\n"
611 val += "%__as ${@d.getVar('AS', True).replace('$','%')}\n"
612 val += "%__cc ${@d.getVar('CC', True).replace('$','%')}\n"
613 val += "%__cpp ${@d.getVar('CPP', True).replace('$','%')}\n"
614 val += "%__cxx ${@d.getVar('CXX', True).replace('$','%')}\n"
615 val += "%__ld ${@d.getVar('LD', True).replace('$','%')}\n"
616 val += "%__nm ${@d.getVar('NM', True).replace('$','%')}\n"
617 val += "%__objcopy ${@d.getVar('OBJCOPY', True).replace('$','%')}\n"
618 val += "%__objdump ${@d.getVar('OBJDUMP', True).replace('$','%')}\n"
619 val += "%__ranlib ${@d.getVar('RANLIB', True).replace('$','%')}\n"
620 val += "%__strip ${@d.getVar('STRIP', True).replace('$','%')}\n"
621 val += "EOF\n"
622 val += "\n"
623 return d.expand(val)
624
625
626add_native_wrapper() {
627 create_wrapper ${D}/${bindir}/rpm \
628 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
629 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
630 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
631
632 create_wrapper ${D}/${bindir}/rpm2cpio \
633 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
634 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
635 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
636
637 create_wrapper ${D}/${bindir}/rpmbuild \
638 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
639 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
640 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
641
642 create_wrapper ${D}/${bindir}/rpmconstant \
643 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
644 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
645 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
646
647 for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do
648 create_wrapper $rpm_binary \
649 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
650 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
651 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
652 done
653}
654
655do_install_append_class-native() {
656 add_native_wrapper
657}
658
659do_install_append_class-nativesdk() {
660 add_native_wrapper
661}
662
663BBCLASSEXTEND = "native nativesdk"