From 39841a1e032c3af0ea0a62e31083e3eba757ba80 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Wed, 9 Nov 2016 11:31:23 -0500 Subject: [PATCH] Add dpkg and rpm-org --- src/dpkg/.SRCINFO | 24 +++++ src/dpkg/PKGBUILD | 49 +++++++++ src/rpm-org/.SRCINFO | 36 +++++++ src/rpm-org/.gitignore | 8 ++ src/rpm-org/PKGBUILD | 74 +++++++++++++ src/rpm-org/lua-5.3.patch | 64 +++++++++++ src/rpm-org/rpmextract.sh | 6 ++ src/rpm-org/rpmlib-filesystem-check.patch | 125 ++++++++++++++++++++++ 8 files changed, 386 insertions(+) create mode 100644 src/dpkg/.SRCINFO create mode 100644 src/dpkg/PKGBUILD create mode 100644 src/rpm-org/.SRCINFO create mode 100644 src/rpm-org/.gitignore create mode 100644 src/rpm-org/PKGBUILD create mode 100644 src/rpm-org/lua-5.3.patch create mode 100644 src/rpm-org/rpmextract.sh create mode 100644 src/rpm-org/rpmlib-filesystem-check.patch diff --git a/src/dpkg/.SRCINFO b/src/dpkg/.SRCINFO new file mode 100644 index 0000000..862459a --- /dev/null +++ b/src/dpkg/.SRCINFO @@ -0,0 +1,24 @@ +# Generated by mksrcinfo v8 +# Thu Sep 15 23:40:56 UTC 2016 +pkgbase = dpkg + pkgdesc = The Debian Package Manager. Don't use it instead of Arch's 'pacman'. + pkgver = 1.18.10 + pkgrel = 3 + url = https://tracker.debian.org/pkg/dpkg + arch = i686 + arch = x86_64 + license = GPL + checkdepends = perl-io-string + checkdepends = perl-test-pod + makedepends = perl-io-string + makedepends = perl-timedate + makedepends = git + depends = xz + depends = zlib + depends = bzip2 + depends = perl + source = dpkg-1.18.10::git+https://anonscm.debian.org/git/dpkg/dpkg.git#tag=1.18.10 + sha256sums = SKIP + +pkgname = dpkg + diff --git a/src/dpkg/PKGBUILD b/src/dpkg/PKGBUILD new file mode 100644 index 0000000..4349533 --- /dev/null +++ b/src/dpkg/PKGBUILD @@ -0,0 +1,49 @@ +# Maintainer: Alad Wenter +# Contributor: Jochen Schalanda +# Contributor: C. Dominik Bódi +# Contributor: Pierre Carrier +# Contributor: Thomas Dziedzic +# Contributor: Chris Giles +# Contributor: seblu +# Contributor: squiddo +# Contributor: dront78 +# Contributor: hugelgupf + +pkgname=dpkg +pkgver=1.18.10 +pkgrel=3 +pkgdesc="The Debian Package Manager. Don't use it instead of Arch's 'pacman'." +arch=('i686' 'x86_64') +url="https://tracker.debian.org/pkg/dpkg" +license=('GPL') +depends=('xz' 'zlib' 'bzip2' 'perl') +makedepends=('perl-io-string' 'perl-timedate' 'git') +checkdepends=('perl-io-string' 'perl-test-pod') +source=("$pkgname-$pkgver::git+https://anonscm.debian.org/git/dpkg/dpkg.git#tag=$pkgver") +sha256sums=('SKIP') + +check() { + cd "$pkgname-$pkgver" + make check +} + +build() { + cd "$pkgname-$pkgver" + autoreconf -f -i + + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --sbindir=/usr/bin \ + --disable-start-stop-daemon \ + --disable-install-info + make +} + +package() { + cd "$pkgname-$pkgver" + make DESTDIR="$pkgdir" install + + install -d "$pkgdir/var/$pkgname"/updates/ + touch "${pkgdir}/var/lib/$pkgname"/{status,available} +} diff --git a/src/rpm-org/.SRCINFO b/src/rpm-org/.SRCINFO new file mode 100644 index 0000000..886bb3c --- /dev/null +++ b/src/rpm-org/.SRCINFO @@ -0,0 +1,36 @@ +# Generated by mksrcinfo v8 +# Sat Feb 13 00:47:46 UTC 2016 +pkgbase = rpm-org + pkgdesc = RPM Package Manager - RPM.org fork, used in major RPM distros + pkgver = 4.12.0.1 + pkgrel = 3 + url = http://www.rpm.org/ + arch = i686 + arch = x86_64 + license = GPL2 + makedepends = python2 + makedepends = python + depends = lua>=5.1 + depends = file + depends = nss>=3.12 + depends = popt + depends = elfutils + depends = libarchive + depends = libcap + optdepends = libdbus: systemd inhibit plugin + provides = rpm=4.12.0.1 + provides = rpmextract=1.0-4 + conflicts = rpm + conflicts = rpmextract + options = !libtool + source = http://rpm.org/releases/rpm-4.12.x/rpm-4.12.0.1.tar.bz2 + source = rpmextract.sh + source = rpmlib-filesystem-check.patch + source = lua-5.3.patch + sha1sums = d416bdb249b246b00b2d5d34c66e7f5a68a62524 + sha1sums = 74849919207885ae024f1ab8ed68a76474d67ad7 + sha1sums = 0c5fa516dde1f10211af896c729e4b00c313e12b + sha1sums = e8efa065eb42648ac431a48b083888ae77e8ae4b + +pkgname = rpm-org + diff --git a/src/rpm-org/.gitignore b/src/rpm-org/.gitignore new file mode 100644 index 0000000..bd9b4a4 --- /dev/null +++ b/src/rpm-org/.gitignore @@ -0,0 +1,8 @@ +*.tar.gz +*.tar.xz +*.tgz +*.rpm +*.zip +*.bz2 +src/ +pkg/ diff --git a/src/rpm-org/PKGBUILD b/src/rpm-org/PKGBUILD new file mode 100644 index 0000000..6776a53 --- /dev/null +++ b/src/rpm-org/PKGBUILD @@ -0,0 +1,74 @@ +# Contributor: Johannes Dewender arch at JonnyJD dot net +# Contributor: Konrad +# Contributor: Luka Perkov lukaperkov net> +# Contributor: Fernando M beford.net> +# Author: Wintershade + +pkgname=rpm-org +pkgver=4.12.0.1 +_pkgver=$pkgver +#_pkgver=4.12.0-rc1 +pkgrel=3 +pkgdesc="RPM Package Manager - RPM.org fork, used in major RPM distros" +arch=('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=(http://rpm.org/releases/testing/rpm-${_pkgver}.tar.bz2 +source=(http://rpm.org/releases/rpm-4.12.x/rpm-${pkgver}.tar.bz2 + rpmextract.sh rpmlib-filesystem-check.patch lua-5.3.patch) +sha1sums=('d416bdb249b246b00b2d5d34c66e7f5a68a62524' + '74849919207885ae024f1ab8ed68a76474d67ad7' + '0c5fa516dde1f10211af896c729e4b00c313e12b' + 'e8efa065eb42648ac431a48b083888ae77e8ae4b') + +prepare() { + cd ${srcdir}/rpm-${_pkgver} + patch -p1 < ../rpmlib-filesystem-check.patch + patch -p1 < ../lua-5.3.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/src/rpm-org/lua-5.3.patch b/src/rpm-org/lua-5.3.patch new file mode 100644 index 0000000..dd8062a --- /dev/null +++ b/src/rpm-org/lua-5.3.patch @@ -0,0 +1,64 @@ +From 82c0aa33c904274d9d62b629c2d15990aab45050 Mon Sep 17 00:00:00 2001 +From: Johannes Dewender +Date: Mon, 18 May 2015 10:11:13 +0200 +Subject: [PATCH] remove luaL_checkint, deprecated in lua 5.3 + +luaL_checkint and luaL_optint are deprecated in lua 5.3 +The variants luaL_checkinteger and luaL_optinteger work +the same with an implicit typecast (lua_integer -> int). +--- + luaext/lposix.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/luaext/lposix.c b/luaext/lposix.c +index a59be3e..51ea2b3 100644 +--- a/luaext/lposix.c ++++ b/luaext/lposix.c +@@ -361,22 +361,22 @@ static int Pfork(lua_State *L) /** fork() */ + + static int Pwait(lua_State *L) /** wait([pid]) */ + { +- pid_t pid = luaL_optint(L, 1, -1); ++ pid_t pid = luaL_optinteger(L, 1, -1); + return pushresult(L, waitpid(pid, NULL, 0), NULL); + } + + + static int Pkill(lua_State *L) /** kill(pid,[sig]) */ + { +- pid_t pid = luaL_checkint(L, 1); +- int sig = luaL_optint(L, 2, SIGTERM); ++ pid_t pid = luaL_checkinteger(L, 1); ++ int sig = luaL_optinteger(L, 2, SIGTERM); + return pushresult(L, kill(pid, sig), NULL); + } + + + static int Psleep(lua_State *L) /** sleep(seconds) */ + { +- unsigned int seconds = luaL_checkint(L, 1); ++ unsigned int seconds = luaL_checkinteger(L, 1); + lua_pushnumber(L, sleep(seconds)); + return 1; + } +@@ -529,7 +529,7 @@ static int Pgetprocessid(lua_State *L) /** getprocessid([selector]) */ + + static int Pttyname(lua_State *L) /** ttyname(fd) */ + { +- int fd=luaL_optint(L, 1, 0); ++ int fd=luaL_optinteger(L, 1, 0); + lua_pushstring(L, ttyname(fd)); + return 1; + } +@@ -880,7 +880,7 @@ static int exit_override(lua_State *L) + if (!have_forked) + return luaL_error(L, "exit not permitted in this context"); + +- exit(luaL_optint(L, 1, EXIT_SUCCESS)); ++ exit(luaL_optinteger(L, 1, EXIT_SUCCESS)); + } + + static const luaL_Reg os_overrides[] = +-- +2.1.3 + diff --git a/src/rpm-org/rpmextract.sh b/src/rpm-org/rpmextract.sh new file mode 100644 index 0000000..f9d4e5b --- /dev/null +++ b/src/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/src/rpm-org/rpmlib-filesystem-check.patch b/src/rpm-org/rpmlib-filesystem-check.patch new file mode 100644 index 0000000..984d8c4 --- /dev/null +++ b/src/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/ (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);