diff options
author | Árni Dagur | 2019-01-29 21:51:56 +0000 |
---|---|---|
committer | Árni Dagur | 2019-01-29 21:51:56 +0000 |
commit | f020731497267d625d4f633dd3d7f1f70a8a379f (patch) | |
tree | 26dc7df7807fd2a5aeb444b2435500b2758cfa5e | |
download | aur-f020731497267d625d4f633dd3d7f1f70a8a379f.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 70 | ||||
-rw-r--r-- | bzip2-1.0.4-bzip2recover.patch | 12 |
3 files changed, 103 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..2e6c2f54b847 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = bzip2-with-lbzip2-symlinks + pkgdesc = bzip2 with binaries symbolically linked to their lbzip2 equivalents + pkgver = 1.0.6 + pkgrel = 1 + url = http://sources.redhat.com/bzip2 + arch = x86_64 + license = custom + depends = lbzip2 + depends = glibc + depends = sh + provides = bzip2=1.0.6 + conflicts = bzip2 + source = https://sources.archlinux.org/other/packages/bzip2/bzip2-1.0.6.tar.gz + source = bzip2-1.0.4-bzip2recover.patch + source = fix-heap-use-after-free-bzip2recover.patch::https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/bzip2/files/bzip2-1.0.6-CVE-2016-3189.patch + sha256sums = a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd + sha256sums = 0585fb92a4b409404147a3f940ed2ca03b3eaed1ec4fb68ae6ad74db668bea83 + sha256sums = e8792b2c7943486ab35893ffd9e638bbf2edbcab4f9f7b87544519bb3564af41 + +pkgname = bzip2-with-lbzip2-symlinks + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..5cf9fc704df3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: Árni Dagur <arnidg@protonmail.ch> +# Adapted from original package by: Ronald van Haren <ronald.archlinux.org> +pkgname=bzip2-with-lbzip2-symlinks +pkgver=1.0.6 +pkgrel=1 +pkgdesc="bzip2 with binaries symbolically linked to their lbzip2 equivalents" +arch=('x86_64') +license=('custom') +url="http://sources.redhat.com/bzip2" +depends=('lbzip2' 'glibc' 'sh') +provides=("bzip2=$pkgver") +conflicts=('bzip2') +source=(https://sources.archlinux.org/other/packages/bzip2/bzip2-$pkgver.tar.gz + bzip2-1.0.4-bzip2recover.patch + fix-heap-use-after-free-bzip2recover.patch::https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/bzip2/files/bzip2-1.0.6-CVE-2016-3189.patch) +sha256sums=('a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd' + '0585fb92a4b409404147a3f940ed2ca03b3eaed1ec4fb68ae6ad74db668bea83' + 'e8792b2c7943486ab35893ffd9e638bbf2edbcab4f9f7b87544519bb3564af41') + +build() { + cd "$srcdir/bzip2-$pkgver" + + # add large-file support + sed -e 's/^CFLAGS=\(.*\)$/CFLAGS=\1 \$(BIGFILES)/' -i ./Makefile-libbz2_so + + # use our optimization + sed -i "s|-O2|${CFLAGS}|g" Makefile + sed -i "s|-O2|${CFLAGS}|g" Makefile-libbz2_so + + patch -Np1 < ../bzip2-1.0.4-bzip2recover.patch + # CVE-2016-3189 + patch -Np1 -i "${srcdir}/fix-heap-use-after-free-bzip2recover.patch" + + make -f Makefile-libbz2_so + make bzip2recover +} + +check() { + cd "$srcdir/bzip2-$pkgver" + make test +} + +package() { + cd "$srcdir/bzip2-$pkgver" + + install -dm755 $pkgdir/usr/{bin,lib,include,share/man/man1} + + # We symlink bzip2, bunzip2, and bzcat to lbzip2 + ln -sf lbzip2 $pkgdir/usr/bin/bzip2 + ln -sf lbzip2 $pkgdir/usr/bin/bunzip2 + ln -sf lbzip2 $pkgdir/usr/bin/bzcat + + # The rest is installed as normal + install -m755 bzip2recover bzdiff bzgrep bzmore $pkgdir/usr/bin + + install -m755 libbz2.so.1.0.6 $pkgdir/usr/lib + ln -s libbz2.so.1.0.6 $pkgdir/usr/lib/libbz2.so + ln -s libbz2.so.1.0.6 $pkgdir/usr/lib/libbz2.so.1 + ln -s libbz2.so.1.0.6 $pkgdir/usr/lib/libbz2.so.1.0 + + install -m644 bzlib.h $pkgdir/usr/include/ + + install -m644 bzip2.1 $pkgdir/usr/share/man/man1/ + ln -sf bzip2.1 $pkgdir/usr/share/man/man1/bunzip2.1 + ln -sf bzip2.1 $pkgdir/usr/share/man/man1/bzcat.1 + ln -sf bzip2.1 $pkgdir/usr/share/man/man1/bzip2recover.1 + + install -Dm644 $srcdir/bzip2-${pkgver}/LICENSE \ + $pkgdir/usr/share/licenses/${pkgname}/LICENSE +} diff --git a/bzip2-1.0.4-bzip2recover.patch b/bzip2-1.0.4-bzip2recover.patch new file mode 100644 index 000000000000..e2bfe1cc1c00 --- /dev/null +++ b/bzip2-1.0.4-bzip2recover.patch @@ -0,0 +1,12 @@ +--- bzip2-1.0.4/bzip2recover.c.pom 2007-01-03 03:00:55.000000000 +0100 ++++ bzip2-1.0.4/bzip2recover.c 2007-02-05 11:55:17.000000000 +0100 +@@ -309,7 +309,8 @@ + UInt32 buffHi, buffLo, blockCRC; + Char* p; + +- strcpy ( progName, argv[0] ); ++ strncpy ( progName, argv[0], BZ_MAX_FILENAME-1); ++ progName[BZ_MAX_FILENAME-1]='\0'; + inFileName[0] = outFileName[0] = 0; + + fprintf ( stderr, |