PKGBUILD 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Maintainer: Ronald van Haren <ronald.archlinux.org>
  2. # Contributor: Judd <jvinet@zeroflux.org>
  3. pkgname=bzip2
  4. pkgver=1.0.6
  5. pkgrel=8
  6. pkgdesc="A high-quality data compression program"
  7. arch=(x86_64 ppc64le)
  8. license=('custom')
  9. url="http://sources.redhat.com/bzip2"
  10. groups=('base')
  11. depends=('glibc' 'sh')
  12. source=(https://sources.archlinux.org/other/packages/bzip2/bzip2-$pkgver.tar.gz
  13. bzip2-1.0.4-bzip2recover.patch
  14. 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)
  15. sha256sums=('a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd'
  16. '0585fb92a4b409404147a3f940ed2ca03b3eaed1ec4fb68ae6ad74db668bea83'
  17. 'e8792b2c7943486ab35893ffd9e638bbf2edbcab4f9f7b87544519bb3564af41')
  18. build() {
  19. cd "$srcdir/$pkgname-$pkgver"
  20. # add large-file support
  21. sed -e 's/^CFLAGS=\(.*\)$/CFLAGS=\1 \$(BIGFILES)/' -i ./Makefile-libbz2_so
  22. # use our optimization
  23. sed -i "s|-O2|${CFLAGS}|g" Makefile
  24. sed -i "s|-O2|${CFLAGS}|g" Makefile-libbz2_so
  25. patch -Np1 < ../bzip2-1.0.4-bzip2recover.patch
  26. # CVE-2016-3189
  27. patch -Np1 -i "${srcdir}/fix-heap-use-after-free-bzip2recover.patch"
  28. make -f Makefile-libbz2_so
  29. make bzip2 bzip2recover
  30. }
  31. check() {
  32. cd "$srcdir/$pkgname-$pkgver"
  33. make test
  34. }
  35. package() {
  36. cd "$srcdir/$pkgname-$pkgver"
  37. install -dm755 $pkgdir/usr/{bin,lib,include,share/man/man1}
  38. install -m755 bzip2-shared $pkgdir/usr/bin/bzip2
  39. install -m755 bzip2recover bzdiff bzgrep bzmore $pkgdir/usr/bin
  40. ln -sf bzip2 $pkgdir/usr/bin/bunzip2
  41. ln -sf bzip2 $pkgdir/usr/bin/bzcat
  42. install -m755 libbz2.so.1.0.6 $pkgdir/usr/lib
  43. ln -s libbz2.so.1.0.6 $pkgdir/usr/lib/libbz2.so
  44. ln -s libbz2.so.1.0.6 $pkgdir/usr/lib/libbz2.so.1
  45. ln -s libbz2.so.1.0.6 $pkgdir/usr/lib/libbz2.so.1.0
  46. install -m644 bzlib.h $pkgdir/usr/include/
  47. install -m644 bzip2.1 $pkgdir/usr/share/man/man1/
  48. ln -sf bzip2.1 $pkgdir/usr/share/man/man1/bunzip2.1
  49. ln -sf bzip2.1 $pkgdir/usr/share/man/man1/bzcat.1
  50. ln -sf bzip2.1 $pkgdir/usr/share/man/man1/bzip2recover.1
  51. install -Dm644 $srcdir/${pkgname}-${pkgver}/LICENSE \
  52. $pkgdir/usr/share/licenses/${pkgname}/LICENSE
  53. }