Date: Tuesday, January 5, 2021 @ 22:41:49 Author: anatolik Revision: 810460
archrelease: copy trunk to community-testing-x86_64 Added: rpm-tools/repos/community-testing-x86_64/ rpm-tools/repos/community-testing-x86_64/PKGBUILD (from rev 810459, rpm-tools/trunk/PKGBUILD) rpm-tools/repos/community-testing-x86_64/rpm-tools.install (from rev 810459, rpm-tools/trunk/rpm-tools.install) rpm-tools/repos/community-testing-x86_64/rpmextract.sh (from rev 810459, rpm-tools/trunk/rpmextract.sh) rpm-tools/repos/community-testing-x86_64/rpmlib-filesystem-check.patch (from rev 810459, rpm-tools/trunk/rpmlib-filesystem-check.patch) -------------------------------+ PKGBUILD | 74 +++++++++++++++++++++++ rpm-tools.install | 8 ++ rpmextract.sh | 6 + rpmlib-filesystem-check.patch | 125 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 213 insertions(+) Copied: rpm-tools/repos/community-testing-x86_64/PKGBUILD (from rev 810459, rpm-tools/trunk/PKGBUILD) =================================================================== --- community-testing-x86_64/PKGBUILD (rev 0) +++ community-testing-x86_64/PKGBUILD 2021-01-05 22:41:49 UTC (rev 810460) @@ -0,0 +1,74 @@ +# Maintainer: Anatol Pomozov <anatol pomozov at gmail> +# 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> +# Author: Wintershade <Wintershade AT google mail DOT com> + +pkgname=rpm-tools +pkgver=4.16.1.2 +pkgrel=1 +pkgdesc="RPM Package Manager - RPM.org fork, used in major RPM distros" +arch=('x86_64') +url='http://www.rpm.org/' +license=('GPL2') +depends=('lua' 'file' 'nss' 'popt' 'elfutils' 'libarchive' 'libcap' 'lmdb') +makedepends=('python' 'pkg-config') +conflicts=('rpm' 'rpmextract') +options=('!libtool') +provides=("rpm=${pkgver}" 'rpmextract=1.0-4' 'rpm-org') +install=rpm-tools.install + +_pkgver_major="${pkgver%%.*}" +_pkgver_major_rem="${pkgver#*.}" +_pkgver_minor="${_pkgver_major_rem%%.*}" +_base_pkgver=$_pkgver_major.$_pkgver_minor.x + +source=(http://ftp.rpm.org/releases/rpm-$_base_pkgver/rpm-$pkgver.tar.bz2 + rpmextract.sh + rpmlib-filesystem-check.patch) +sha256sums=('8357329ceefc92c41687988b22198b26f74a12a9a68ac00728f934a5c4b4cacc' + '3e5bf450d4628366ba35469ec0530a99cd09ab2616a3d261a3f68270f481f777' + 'bd0e6dbd458f990268c60324190c6825b234647ecdde08296d2b453dc4bce27a') + +prepare() { + cd rpm-${pkgver} + patch -p1 < ../rpmlib-filesystem-check.patch +} + +build() { + cd rpm-${pkgver} + + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --enable-python \ + --with-external-db \ + --with-lua \ + --with-cap \ + CPPFLAGS="`pkg-config --cflags nss`" \ + PYTHON=python + make +} + +package() { + cd 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 + rm ${pkgdir}/usr/bin/rpm{query,verify} + cd ${pkgdir}/usr/bin + ln -s rpm rpmquery + ln -s rpm rpmverify + + # 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 +} Copied: rpm-tools/repos/community-testing-x86_64/rpm-tools.install (from rev 810459, rpm-tools/trunk/rpm-tools.install) =================================================================== --- community-testing-x86_64/rpm-tools.install (rev 0) +++ community-testing-x86_64/rpm-tools.install 2021-01-05 22:41:49 UTC (rev 810460) @@ -0,0 +1,8 @@ +post_install() { + echo " rpm-tools installs RedHat package manager for you." + echo " It is useful for those who wants to create/modify RPM files." + echo " But do not use rpm-tools to install RedHat packages at your ArchLinux machine." + echo " It will break your system!" + echo " You will need to go back to Arch wiki and read the installation guide again." + echo " You've been warned!" +} Copied: rpm-tools/repos/community-testing-x86_64/rpmextract.sh (from rev 810459, rpm-tools/trunk/rpmextract.sh) =================================================================== --- community-testing-x86_64/rpmextract.sh (rev 0) +++ community-testing-x86_64/rpmextract.sh 2021-01-05 22:41:49 UTC (rev 810460) @@ -0,0 +1,6 @@ +#!/bin/sh +if [ "$1" = "" -o ! -e "$1" ]; then + echo "no package supplied" 1>&2 + exit 1 +fi +bsdtar xf $1 Copied: rpm-tools/repos/community-testing-x86_64/rpmlib-filesystem-check.patch (from rev 810459, rpm-tools/trunk/rpmlib-filesystem-check.patch) =================================================================== --- community-testing-x86_64/rpmlib-filesystem-check.patch (rev 0) +++ community-testing-x86_64/rpmlib-filesystem-check.patch 2021-01-05 22:41:49 UTC (rev 810460) @@ -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: k...@redhat.com, har...@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);