PKGBUILD 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. # Maintainer (Arch): Dan McGee <dan@archlinux.org>
  2. # Maintainer (Arch): Dave Reisner <dreisner@archlinux.org>
  3. # Contributor (Hyperbola): André Silva <emulatorman@hyperbola.info>
  4. # Contributor (Hyperbola): Márcio Silva <coadde@hyperbola.info>
  5. # Maintainer: Luke Shumaker <lukeshu@parabola.nu>
  6. # Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>
  7. # Contributor: Nicolás Reynolds <fauno@kiwwwi.com.ar>
  8. # Contributor: Daniel Milewski <niitotantei@riseup.net>
  9. pkgname=pacman
  10. pkgver=5.2.1
  11. pkgrel=4
  12. pkgrel+=.parabola3
  13. pkgdesc="A library-based package manager with dependency support"
  14. arch=('x86_64')
  15. arch+=('i686' 'armv7h')
  16. url="https://www.archlinux.org/pacman/"
  17. license=('GPL')
  18. groups=('base-devel')
  19. depends=('bash' 'glibc' 'libarchive' 'curl'
  20. 'gpgme' 'pacman-mirrorlist' 'archlinux-keyring')
  21. depends+=('parabola-keyring' 'archlinuxarm-keyring' 'archlinux32-keyring')
  22. makedepends=('asciidoc')
  23. checkdepends=('python' 'fakechroot')
  24. optdepends=('perl-locale-gettext: translation support in makepkg-template')
  25. provides=('libalpm.so')
  26. provides+=('pacman-parabola')
  27. conflicts=('pacman-parabola')
  28. replaces=('pacman-parabola')
  29. backup=(etc/pacman.conf
  30. etc/makepkg.conf)
  31. options=('strip' 'debug')
  32. validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae <allan@archlinux.org>
  33. 'B8151B117037781095514CA7BBDFFC92306B1121') # Andrew Gregory (pacman) <andrew@archlinux.org>
  34. source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig}
  35. pacman-5.2.1-fix-pactest-package-tar-format.patch::https://git.archlinux.org/pacman.git/patch/?id=b9faf652735c603d1bdf849a570185eb721f11c1
  36. makepkg-fix-one-more-file-seccomp-issue.patch
  37. "${arch[@]/#/pacman.conf.}"
  38. makepkg.conf.in
  39. pacman-keyring.service
  40. pacman-keyring.timer
  41. 0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch)
  42. source_armv7h=(0001-Sychronize-filesystem.patch
  43. 0002-Revert-close-stdin-before-running-install-scripts.patch
  44. 0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch)
  45. sha256sums=('1930c407265fd039cb3a8e6edc82f69e122aa9239d216d9d57b9d1b9315af312'
  46. 'SKIP'
  47. 'd268379269c9dfa6eb3358f8931d3c84ef5fa4d47fe22567022fcbac8e4638c1'
  48. 'e481a161bba76729cd434c97e0b319ddfcb1d93b2e4890d72b4e8a32982531d9'
  49. '509a4f253a17670b9def43a0daa3aa17f113961aec65429d1996c93478d6693f'
  50. 'e5632e1581a4283cf8b93f0d32618fc7a35480c9caaf2d256c95f77645ae4265'
  51. 'd9bed26a58377b726ebadabd9729008e484f8719632b9c3e76c9320c2fcaa22c'
  52. '78be8885fd61999cdd65e61ceb70eed3828fd87f89dec19f4a04d87c8924d451'
  53. '220f1b25a64727041dc6fa3fd486b0a043f735a3f6cecedc4e2f7c47ec6ce66d'
  54. '2a857061f032ff5485f5c75ab74e6f6532621e08963ef48640a792cca16cacd6'
  55. '9ccc7ef5bd27a68d8788f10c6e5b36495c5d9038d4eb160f9ea4dc9901b622d8')
  56. sha256sums_armv7h=('8d70fb5094f58aad98b601bbc42be354c2014b9fe734a1ee0b1e14bb041cc9cc'
  57. '0e771370da68c855bfb4eaad4c2ae137883a474886a049b934dac2e775574cb9'
  58. '2f586f72c34150330389854575a21be1d3ef3637c4f94bec2e948c2717a5aecb')
  59. prepare() {
  60. cd "$pkgname-$pkgver"
  61. patch -Np1 < ../pacman-5.2.1-fix-pactest-package-tar-format.patch
  62. patch -Np1 < ../makepkg-fix-one-more-file-seccomp-issue.patch
  63. # From Arch ARM
  64. if [ "${CARCH}" = "armv7h" ]; then
  65. patch -p1 -i ../0001-Sychronize-filesystem.patch
  66. patch -p1 -i ../0002-Revert-close-stdin-before-running-install-scripts.patch
  67. patch -p1 -i ../0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch
  68. fi
  69. # From Parabola
  70. patch -p1 -i ../0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch
  71. }
  72. build() {
  73. cd "$pkgname-$pkgver"
  74. ./configure --prefix=/usr --sysconfdir=/etc \
  75. --localstatedir=/var --enable-doc \
  76. --with-scriptlet-shell=/usr/bin/bash \
  77. --with-ldconfig=/usr/bin/ldconfig
  78. make V=1
  79. # Generate the architecture-specific makepkg.conf files
  80. local carch mycarch mychost myflags myldflags
  81. for carch in "${arch[@]}"; do
  82. case $carch in
  83. i686)
  84. mycarch="i686"
  85. mychost="i686-pc-linux-gnu"
  86. myflags="-march=i686 -mtune=generic -O2 -pipe -fno-plt"
  87. ;;
  88. x86_64)
  89. mycarch="x86_64"
  90. mychost="x86_64-pc-linux-gnu"
  91. myflags="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
  92. ;;
  93. armv7h)
  94. mycarch="armv7h"
  95. mychost="armv7l-unknown-linux-gnueabihf"
  96. myflags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fno-plt"
  97. ;;
  98. esac
  99. myldflags="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
  100. # set things correctly in the default conf file
  101. sed < "$srcdir/makepkg.conf.in" > "$srcdir/makepkg.conf.$carch" \
  102. -e "s|@CARCH[@]|$mycarch|g" \
  103. -e "s|@CHOST[@]|$mychost|g" \
  104. -e "s|@CARCHFLAGS[@]|$myflags|g" \
  105. -e "s|@LDFLAGS[@]|$myldflags|g"
  106. done
  107. }
  108. check() {
  109. make -C "$pkgname-$pkgver" check
  110. }
  111. package() {
  112. cd "$pkgname-$pkgver"
  113. make DESTDIR="$pkgdir" install
  114. # install distro-specific stuff
  115. install -dm755 "$pkgdir"/etc/{makepkg,pacman}.d
  116. install -m644 "$srcdir/pacman.conf.$CARCH" "$pkgdir/etc/pacman.conf"
  117. install -m644 "$srcdir/makepkg.conf.$CARCH" "$pkgdir/etc/makepkg.conf"
  118. echo '# There must be at least 1 file matching /etc/pacman.d/*.conf' > "$pkgdir/etc/pacman.d/empty.conf"
  119. install -dm755 "$pkgdir/usr/share/pacman/defaults"
  120. local carch
  121. for carch in "${arch[@]}"; do
  122. install -m644 "$srcdir/pacman.conf.$carch" "$pkgdir/usr/share/pacman/defaults/"
  123. install -m644 "$srcdir/makepkg.conf.$carch" "$pkgdir/usr/share/pacman/defaults/"
  124. done
  125. # Parabola's pacman began shipping a weekly job for this back in
  126. # 2014. Why is it nescessary for Parabola installs, but it
  127. # seemingly isn't for Arch installs?
  128. install -Dm644 "$srcdir/pacman-keyring.service" "$pkgdir/usr/lib/systemd/system/pacman-keyring.service"
  129. install -Dm644 "$srcdir/pacman-keyring.timer" "$pkgdir/usr/lib/systemd/system/pacman-keyring.timer"
  130. install -Dm644 /dev/stdin "$pkgdir/usr/lib/systemd/system-preset/90-pacman.preset" <<<"enable pacman-keyring.timer"
  131. }