summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
authorDavid P <megver83@openmailbox.org>2017-04-16 16:34:21 -0300
committerDavid P <megver83@openmailbox.org>2017-04-16 16:34:21 -0300
commit3d8401a122b75800a5f7d28f921a6354b7851667 (patch)
tree75c33d79d1e7a33f5ac42bbdd6352855c5f08c80 /pcr
parent361cbc14c8df17ca22fc5c61106e58c209bea225 (diff)
downloadabslibre-3d8401a122b75800a5f7d28f921a6354b7851667.tar.gz
abslibre-3d8401a122b75800a5f7d28f921a6354b7851667.tar.bz2
abslibre-3d8401a122b75800a5f7d28f921a6354b7851667.zip
Commited untracked files
Diffstat (limited to 'pcr')
-rw-r--r--pcr/rpm-org/PKGBUILD75
-rw-r--r--pcr/rpm-org/bfdfix.patch24
-rw-r--r--pcr/rpm-org/rpmextract.sh6
-rw-r--r--pcr/rpm-org/rpmlib-filesystem-check.patch125
4 files changed, 230 insertions, 0 deletions
diff --git a/pcr/rpm-org/PKGBUILD b/pcr/rpm-org/PKGBUILD
new file mode 100644
index 000000000..8333b1c1d
--- /dev/null
+++ b/pcr/rpm-org/PKGBUILD
@@ -0,0 +1,75 @@
+# Maintainer: David P. <megver83@openmailbox.org>
+# Contributor: Johannes Dewender arch at JonnyJD dot net
+# Contributor: Konrad <konrad AT knauber DOT name>
+# Contributor: Luka Perkov <archlinux <at> lukaperkov <dOt> net>
+# Contributor: Fernando M <f <at> beford.net>
+# Contributor: Wintershade <Wintershade AT google mail DOT com>
+
+pkgname=rpm-org
+pkgver=4.13.0.1
+_pkgver=$pkgver
+#_pkgver=4.12.0-rc1
+pkgrel=1
+pkgdesc="RPM Package Manager - RPM.org fork, used in major RPM distros"
+arch=('armv7h' 'i686' 'x86_64')
+url="http://www.rpm.org/"
+license=('GPL2')
+depends=('lua>=5.1' 'file' 'nss>=3.12' 'popt' 'elfutils' 'libarchive' 'libcap')
+makedepends=('python2' 'python')
+optdepends=('libdbus: systemd inhibit plugin')
+conflicts=('rpm' 'rpmextract')
+options=('!libtool')
+provides=("rpm=${pkgver}" 'rpmextract=1.0-4')
+#source=(https://github.com/rpm-software-management/rpm/releases/download/rpm-${pkgver}-release/rpm-${pkgver}.tar.bz2
+source=(http://ftp.rpm.org/releases/rpm-4.13.x/rpm-$pkgver.tar.bz2
+ rpmextract.sh rpmlib-filesystem-check.patch bfdfix.patch)
+sha1sums=('9566f95f38fcb214e439c552f378c2f64ba0aff9'
+ '74849919207885ae024f1ab8ed68a76474d67ad7'
+ '0c5fa516dde1f10211af896c729e4b00c313e12b'
+ '456d4a2c9f71c2e3bfa5011800855a73a55aa5bc')
+
+prepare() {
+ cd ${srcdir}/rpm-${_pkgver}
+ patch -p1 < ../rpmlib-filesystem-check.patch
+ patch -p1 < ../bfdfix.patch
+ }
+
+
+build() {
+ cd ${srcdir}/rpm-${_pkgver}
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --enable-python \
+ --with-external-db \
+ --with-lua \
+ --with-cap \
+ CPPFLAGS="`pkg-config --cflags nss`" \
+ PYTHON=python2
+ make
+}
+
+package() {
+ cd ${srcdir}/rpm-${_pkgver}
+ make prefix=${pkgdir}/usr localstatedir=${pkgdir}/var install
+ rmdir ${pkgdir}/var/tmp
+ rmdir ${pkgdir}/var
+ # rpmextract using bsdtar, needs libarchive
+ install -m755 ${srcdir}/rpmextract.sh ${pkgdir}/usr/bin/
+
+ # move rpm from /bin to /usr/bin
+ mv ${pkgdir}/bin/rpm ${pkgdir}/usr/bin/
+ rm ${pkgdir}/usr/bin/rpm{query,verify}
+ cd ${pkgdir}/usr/bin
+ ln -s rpm rpmquery
+ ln -s rpm rpmverify
+ rm -r ${pkgdir}/bin/
+
+ # also install python 3 files
+ # building with python 3 files as default doesn't seem to work
+ cd ${srcdir}/rpm-${_pkgver}
+ cd python
+ python setup.py install --root="$pkgdir/" --optimize=1
+}
diff --git a/pcr/rpm-org/bfdfix.patch b/pcr/rpm-org/bfdfix.patch
new file mode 100644
index 000000000..c3e7d69a3
--- /dev/null
+++ b/pcr/rpm-org/bfdfix.patch
@@ -0,0 +1,24 @@
+diff --git a/tools/sepdebugcrcfix.c b/tools/sepdebugcrcfix.c
+index cd7fa02..03db7af 100644
+--- a/tools/sepdebugcrcfix.c
++++ b/tools/sepdebugcrcfix.c
+@@ -28,7 +28,19 @@
+ #include <error.h>
+ #include <libelf.h>
+ #include <gelf.h>
++#ifndef PACKAGE
++#define PACKAGE
++#ifndef PACKAGE_VERSION
++#define PACKAGE_VERSION
+ #include <bfd.h>
++#undef PACKAGE_VERSION
++#else
++#include <bfd.h>
++#endif
++#undef PACKAGE
++#else
++#include <bfd.h>
++#endif
+
+ #define _(x) x
+ #define static_assert(expr) \
diff --git a/pcr/rpm-org/rpmextract.sh b/pcr/rpm-org/rpmextract.sh
new file mode 100644
index 000000000..f9d4e5b1e
--- /dev/null
+++ b/pcr/rpm-org/rpmextract.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ "$1" = "" -o ! -e "$1" ]; then
+ echo "no package supplied" 1>&2
+ exit 1
+fi
+bsdtar xf $1
diff --git a/pcr/rpm-org/rpmlib-filesystem-check.patch b/pcr/rpm-org/rpmlib-filesystem-check.patch
new file mode 100644
index 000000000..984d8c4af
--- /dev/null
+++ b/pcr/rpm-org/rpmlib-filesystem-check.patch
@@ -0,0 +1,125 @@
+diff -up rpm-4.10.90.git11978/lib/depends.c.rpmlib-filesystem-check rpm-4.10.90.git11978/lib/depends.c
+--- rpm-4.10.90.git11978/lib/depends.c.rpmlib-filesystem-check 2012-11-01 09:40:26.000000000 +0200
++++ rpm-4.10.90.git11978/lib/depends.c 2012-11-05 10:53:42.294733695 +0200
+@@ -589,6 +589,109 @@ static int rpmdbProvides(rpmts ts, depCa
+ return rc;
+ }
+
++/*
++ * Temporary support for live-conversion of the filesystem hierarchy
++ * mailto: kay@redhat.com, harald@redhat.com
++ * https://fedoraproject.org/wiki/Features/UsrMove
++ *
++ * X-CheckUnifiedSystemdir:
++ * /bin, /sbin, /lib, /lib64 --> /usr
++ *
++ * X-CheckUnifiedBindir:
++ * /usr/sbin -> /usr/bin
++ *
++ * X-CheckMultiArchLibdir:
++ * /usr/lib64 /usr/lib/<platform tuple> (e.g. x86_64-linux-gnu)
++ *
++ * This code is not needed for new installations, it can be removed after
++ * updates from older systems are no longer supported: Fedora 19 / RHEL 8.
++ */
++
++static int CheckLink(const char *dir, const char *root)
++{
++ char *d = NULL;
++ struct stat sbuf;
++ int rc = 0;
++
++ if (!root)
++ root = "/";
++
++ rasprintf(&d, "%s%s", root, dir);
++ if (!d) {
++ rc = -1;
++ goto exit;
++ }
++
++ /* directory or symlink does not exist, all is fine */
++ if (lstat(d, &sbuf) < 0) {
++ rc = 1;
++ goto exit;
++ }
++
++ /* if it is a symlink, all is fine */
++ if (S_ISLNK(sbuf.st_mode))
++ rc = 1;
++
++exit:
++ free(d);
++ return rc;
++}
++
++static int CheckFilesystemHierarchy(rpmds * dsp, const char *root)
++{
++ static const char *dirs[] = { "bin", "sbin", "lib", "lib64" };
++ int check;
++ int i;
++ rpmds ds;
++ rpmstrPool pool = rpmdsPool(*dsp);
++ int rc = 0;
++
++ for (i = 0; i < sizeof(dirs) / sizeof(dirs[0]); i++) {
++ check = CheckLink(dirs[i], root);
++ if (check < 0) {
++ rc = -1;
++ goto exit;
++ }
++
++ if (check == 0)
++ goto exit;
++ }
++ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME,
++ "rpmlib(X-CheckUnifiedSystemdir)", "1",
++ RPMSENSE_EQUAL);
++ rpmdsMerge(dsp, ds);
++ rpmdsFree(ds);
++
++ check = CheckLink("usr/lib64", root);
++ if (check < 0) {
++ rc = -1;
++ goto exit;
++ }
++ if (check > 0) {
++ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME,
++ "rpmlib(X-CheckMultiArchLibdir)", "1",
++ RPMSENSE_EQUAL);
++ rpmdsMerge(dsp, ds);
++ rpmdsFree(ds);
++ }
++
++ check = CheckLink("usr/sbin", root);
++ if (check < 0) {
++ rc = -1;
++ goto exit;
++ }
++ if (check > 0) {
++ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME,
++ "rpmlib(X-CheckUnifiedBindir)", "1",
++ RPMSENSE_EQUAL);
++ rpmdsMerge(dsp, ds);
++ rpmdsFree(ds);
++ }
++
++exit:
++ return rc;
++}
++
+ /**
+ * Check dep for an unsatisfied dependency.
+ * @param ts transaction set
+@@ -612,8 +715,10 @@ retry:
+ * Check those dependencies now.
+ */
+ if (dsflags & RPMSENSE_RPMLIB) {
+- if (tsmem->rpmlib == NULL)
++ if (tsmem->rpmlib == NULL) {
+ rpmdsRpmlibPool(rpmtsPool(ts), &(tsmem->rpmlib), NULL);
++ CheckFilesystemHierarchy(&(tsmem->rpmlib), rpmtsRootDir(ts));
++ }
+
+ if (tsmem->rpmlib != NULL && rpmdsSearch(tsmem->rpmlib, dep) >= 0) {
+ rpmdsNotify(dep, "(rpmlib provides)", rc);