From baf1e5ba7f9457aac580f29705bbce20777bbba2 Mon Sep 17 00:00:00 2001 From: maxice8 Date: Thu, 2 Nov 2017 09:48:38 -0200 Subject: [PATCH] New package: rpm-4.13.0.2. Closes: #8811 [via git-merge-pr] --- common/shlibs | 4 +++ srcpkgs/rpm-devel | 1 + srcpkgs/rpm-python | 1 + srcpkgs/rpm/patches/fix-musl.patch | 19 ++++++++++ srcpkgs/rpm/patches/fixbfd.patch | 23 ++++++++++++ srcpkgs/rpm/template | 56 ++++++++++++++++++++++++++++++ 6 files changed, 104 insertions(+) create mode 120000 srcpkgs/rpm-devel create mode 120000 srcpkgs/rpm-python create mode 100644 srcpkgs/rpm/patches/fix-musl.patch create mode 100644 srcpkgs/rpm/patches/fixbfd.patch create mode 100644 srcpkgs/rpm/template diff --git a/common/shlibs b/common/shlibs index 94faf6d32a1..4db5b5bf82b 100644 --- a/common/shlibs +++ b/common/shlibs @@ -2938,3 +2938,7 @@ libKF5KDcraw.so.5 libkdcraw5-17.04.3_1 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1 libfswatch.so.9 fswatch-1.11.2_1 libhackrf.so.0 libhackrf-2017.02.1_1 +librpm.so.7 rpm-4.13.0.2_1 +librpmsign.so.7 rpm-4.13.0.2_1 +librpmbuild.so.7 rpm-4.13.0.2_1 +librpmio.so.7 rpm-4.13.0.2_1 diff --git a/srcpkgs/rpm-devel b/srcpkgs/rpm-devel new file mode 120000 index 00000000000..7c88ef3c072 --- /dev/null +++ b/srcpkgs/rpm-devel @@ -0,0 +1 @@ +rpm \ No newline at end of file diff --git a/srcpkgs/rpm-python b/srcpkgs/rpm-python new file mode 120000 index 00000000000..7c88ef3c072 --- /dev/null +++ b/srcpkgs/rpm-python @@ -0,0 +1 @@ +rpm \ No newline at end of file diff --git a/srcpkgs/rpm/patches/fix-musl.patch b/srcpkgs/rpm/patches/fix-musl.patch new file mode 100644 index 00000000000..6d228147029 --- /dev/null +++ b/srcpkgs/rpm/patches/fix-musl.patch @@ -0,0 +1,19 @@ +--- configure.ac ++++ configure.ac +@@ -229,6 +229,7 @@ AC_SEARCH_LIBS(dlopen, [dl]) + # Check for libelf library. Prefer external, otherwise none. + WITH_LIBELF_LIB= + AC_CHECK_HEADER([libelf.h]) ++AC_CHECK_HEADERS([error.h], [WITH_ERROR_H=yes]) + AC_CHECK_HEADERS([gelf.h], [ + AC_CHECK_LIB(elf, gelf_getvernaux, [ + AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).]) +@@ -237,7 +238,7 @@ AC_CHECK_HEADERS([gelf.h], [ + ]) + ]) + AC_SUBST(WITH_LIBELF_LIB) +-AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes]) ++AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes && test "$WITH_ERROR_H" = yes]) + + AC_CHECK_HEADERS([dwarf.h], [ + WITH_LIBDWARF=yes diff --git a/srcpkgs/rpm/patches/fixbfd.patch b/srcpkgs/rpm/patches/fixbfd.patch new file mode 100644 index 00000000000..4c7a7f32732 --- /dev/null +++ b/srcpkgs/rpm/patches/fixbfd.patch @@ -0,0 +1,23 @@ +--- tools/sepdebugcrcfix.c ++++ tools/sepdebugcrcfix.c +@@ -28,7 +28,19 @@ + #include + #include + #include ++#ifndef PACKAGE ++#define PACKAGE ++#ifndef PACKAGE_VERSION ++#define PACKAGE_VERSION + #include ++#undef PACKAGE_VERSION ++#else ++#include ++#endif ++#undef PACKAGE ++#else ++#include ++#endif + + #define _(x) x + #define static_assert(expr) \ + diff --git a/srcpkgs/rpm/template b/srcpkgs/rpm/template new file mode 100644 index 00000000000..322ca7d529e --- /dev/null +++ b/srcpkgs/rpm/template @@ -0,0 +1,56 @@ +# Template file for 'rpm' +pkgname=rpm +version=4.13.0.2 +revision=1 +build_style=gnu-configure +configure_args="--with-lua --with-cap --with-acl --with-external-db --enable-python PYTHON=python2" +hostmakedepends="pkg-config python-setuptools nss-devel nspr-devel automake" +makedepends="zlib-devel nspr-devel nss-devel bzip2-devel elfutils-devel file-devel popt-devel +libarchive-devel db-devel python-devel libcap-devel lua52-devel zstd-devel binutils-devel" +checkdepends="${makedepends}" +short_desc="Red Hat Package Management Utils" +maintainer="maxice8 " +license="GPL-2" +homepage="http://rpm.org" +distfiles="http://ftp.rpm.org/releases/rpm-${version%.*.*}.x/rpm-${version}.tar.bz2" +checksum=2f3e2c07c354d16f2305ddd93ed030c8403d59b272f2fb6722445b091ff14194 +conflicts="rpmextract>=0" # Both provide rpm2cpio +nocross="too buggy header detection and incompatible with musl fixes" + +_EXTRA_INCLUDES=" -I/usr/include/nss -I/usr/include/nspr" +CFLAGS=" ${_EXTRA_INCLUDES}" + +case "$XBPS_TARGET_MACHINE" in + # Musl requires gettext to be included and it's cflag added otherwise + # it fails with _nl_msg_cat_cntr undefined reference error + *-musl*) + hostmakedepends+=" gettext-devel" + CFLAGS+=" -lintl" + ;; +esac + +post_install() { + mv "${DESTDIR}"/bin/rpm "${DESTDIR}"/usr/bin/rpm + rm -r "${DESTDIR}"/bin +} + +rpm-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + depends="${makedepends}" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + } +} + +rpm-python_package() { + short_desc+=" - python bindings" + depends="${sourcepkg}>=${version}_${revision}" + noarch=yes + pycompile_module="rpm" + pkg_install() { + vmove usr/lib/python2* + } +}