PKGBUILD.ppc64le 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. # vim: set ts=2 sw=2 et:
  2. # $Id$
  3. # Maintainer (Arch): Dan McGee <dan@archlinux.org>
  4. # Maintainer (Arch): Dave Reisner <dreisner@archlinux.org>
  5. # Contributor (Hyperbola): André Silva <emulatorman@hyperbola.info>
  6. # Contributor (Hyperbola): Márcio Silva <coadde@hyperbola.info>
  7. # Maintainer: Luke Shumaker <lukeshu@parabola.nu>
  8. # Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>
  9. # Contributor: Nicolás Reynolds <fauno@kiwwwi.com.ar>
  10. # Contributor: Daniel Milewski <niitotantei@riseup.net>
  11. pkgname=pacman
  12. pkgver=5.1.1
  13. pkgrel=1
  14. pkgrel+=.parabola8
  15. pkgdesc="A library-based package manager with dependency support"
  16. arch=('x86_64')
  17. arch+=('i686' 'armv7h' 'ppc64le')
  18. url="http://www.archlinux.org/pacman/"
  19. license=('GPL')
  20. groups=('base' 'base-devel')
  21. groups+=('base-openrc')
  22. depends=('bash' 'glibc' 'libarchive' 'curl'
  23. 'gpgme' 'pacman-mirrorlist' 'archlinux-keyring')
  24. depends+=('parabola-keyring' 'archlinuxarm-keyring' 'archlinux32-keyring')
  25. makedepends=('asciidoc')
  26. checkdepends=('python2' 'fakechroot')
  27. optdepends=('perl-locale-gettext: translation support in makepkg-template')
  28. provides=('pacman-parabola')
  29. conflicts=('pacman-parabola')
  30. replaces=('pacman-parabola')
  31. backup=(etc/pacman.conf etc/makepkg.conf)
  32. options=('strip' 'debug')
  33. validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae <allan@archlinux.org>
  34. 'B8151B117037781095514CA7BBDFFC92306B1121') # Andrew Gregory (pacman) <andrew@archlinux.org>
  35. source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig}
  36. ltmain-asneeded.patch::"https://git.archlinux.org/pacman.git/plain/build-aux/ltmain-asneeded.patch?id=28cb22e3c20676c42a08593b5553ee896b53e030"
  37. "${arch[@]/#/pacman.conf.}"
  38. makepkg.conf.in
  39. pacman-keyring.service
  40. pacman-keyring.timer
  41. 0001-makepkg-Better-error-messages-for-versions-in-check-.patch
  42. 0002-makepkg-check_pkgrel-Don-t-say-decimal-in-the-error-.patch
  43. 0003-makepkg-check_pkgver-Report-what-the-bad-pkgver-is.patch
  44. 0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch
  45. 0001-Revert-makepkg-add-whirlpool-to-the-list-of-hashing-.patch)
  46. source_armv7h=(0001-Sychronize-filesystem.patch
  47. 0002-Revert-close-stdin-before-running-install-scripts.patch
  48. 0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch)
  49. sha256sums=('be04b9162d62d2567e21402dcbabb5bedfdb03909fa5ec6e8568e02ab325bd8d'
  50. 'SKIP'
  51. '8e29d09b8ccf78eda393c44acc027b7b6125d89e5a586ad78991752fc9e62a8c'
  52. '53c3d28314fd8fc6f92a0720c41fc5bd4c7b24793f84158d07988b294c5480a2'
  53. '6baddd5a4651f147b9412d86dc8c5b4763e4f34deaf140a7fb986fb4d4a05949'
  54. '435f4e93355048f83697317b35aad7788162bab5f58f1b9268bc83ad03ed41d8'
  55. '88359b6a39c8c1d43b1d1ead05425b0199f8783c330f1b5ec84edcdba5ffb06e'
  56. 'c0cbdc0df96f13a73d241c1eb85a969098bd414f12ecd7c045922b154537e00a'
  57. '220f1b25a64727041dc6fa3fd486b0a043f735a3f6cecedc4e2f7c47ec6ce66d'
  58. '2a857061f032ff5485f5c75ab74e6f6532621e08963ef48640a792cca16cacd6'
  59. '075ac1f8d782ac9868f5e7f3043f684a00da33915eba9ec7e4a8940992ddc269'
  60. '8065c468706be669bc6718a6634e5e58507cba9b8121bf5cfe1703daacab1c3e'
  61. 'd01100d19b9868da8c689a7a14b6340574ecca0105a8d8ef866b281ad3d7e637'
  62. 'cc2c82ca0c3a45dd4e200fa2219da52912a8718ab7e16091ad2938ada657f033'
  63. '1f6a0a8518dc912bc5d9df335b6da220bd3cc51630b6b47c09ec9d4cd47ae432')
  64. sha256sums_armv7h=('8d70fb5094f58aad98b601bbc42be354c2014b9fe734a1ee0b1e14bb041cc9cc'
  65. '0e771370da68c855bfb4eaad4c2ae137883a474886a049b934dac2e775574cb9'
  66. '2f586f72c34150330389854575a21be1d3ef3637c4f94bec2e948c2717a5aecb')
  67. prepare() {
  68. cd "$pkgname-$pkgver"
  69. # From Arch ARM
  70. if [ "${CARCH}" = "armv7h" ]; then
  71. patch -p1 -i ../0001-Sychronize-filesystem.patch
  72. patch -p1 -i ../0002-Revert-close-stdin-before-running-install-scripts.patch
  73. patch -p1 -i ../0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch
  74. fi
  75. # From Parabola
  76. patch -p1 -i ../0001-makepkg-Better-error-messages-for-versions-in-check-.patch
  77. patch -p1 -i ../0002-makepkg-check_pkgrel-Don-t-say-decimal-in-the-error-.patch
  78. patch -p1 -i ../0003-makepkg-check_pkgver-Report-what-the-bad-pkgver-is.patch
  79. patch -p1 -i ../0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch
  80. # From pacman-dev mailing list
  81. # Properly drop whirlpoolsums support (instead of mysteriously
  82. # failing). Backported because some Parabola packages actually use
  83. # whirlpoolsums.
  84. patch -p1 -i ../0001-Revert-makepkg-add-whirlpool-to-the-list-of-hashing-.patch
  85. # Because a Makefile.am was edited by
  86. # 0001-makepkg-Better-error-messages-for-versions-in-check-.patch
  87. #
  88. # This is based of of the 'autogen.sh' script, which is in
  89. # pacman.it, but not included in the tarball.
  90. autoreconf -i
  91. patch -d build-aux -Np0 -i "$srcdir/ltmain-asneeded.patch"
  92. }
  93. build() {
  94. cd "$pkgname-$pkgver"
  95. ./configure --prefix=/usr --sysconfdir=/etc \
  96. --localstatedir=/var --enable-doc \
  97. --with-scriptlet-shell=/usr/bin/bash \
  98. --with-ldconfig=/usr/bin/ldconfig
  99. make V=1
  100. # Generate the architecture-specific makepkg.conf files
  101. local carch mycarch mychost myflags myldflags
  102. for carch in "${arch[@]}"; do
  103. case $carch in
  104. i686)
  105. mycarch="i686"
  106. mychost="i686-pc-linux-gnu"
  107. myflags="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
  108. ;;
  109. x86_64)
  110. mycarch="x86_64"
  111. mychost="x86_64-pc-linux-gnu"
  112. myflags="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
  113. ;;
  114. armv7h)
  115. mycarch="armv7h"
  116. mychost="armv7l-unknown-linux-gnueabihf"
  117. myflags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector-strong -fno-plt"
  118. ;;
  119. ppc64le)
  120. mycarch="ppc64le"
  121. mychost="powerpc64le-unknown-linux-gnu"
  122. myflags="-mcpu=native -O2 -pipe -fstack-protector-strong -fno-plt"
  123. ;;
  124. esac
  125. myldflags="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
  126. # set things correctly in the default conf file
  127. sed < "$srcdir/makepkg.conf.in" > "$srcdir/makepkg.conf.$carch" \
  128. -e "s|@CARCH[@]|$mycarch|g" \
  129. -e "s|@CHOST[@]|$mychost|g" \
  130. -e "s|@LDFLAGS[@]|$myldflags|g" \
  131. -e "s|@CARCHFLAGS[@]|$myflags|g"
  132. done
  133. }
  134. check() {
  135. make -C "$pkgname-$pkgver" check
  136. }
  137. package() {
  138. cd "$pkgname-$pkgver"
  139. make DESTDIR="$pkgdir" install
  140. # install distro-specific stuff
  141. install -dm755 "$pkgdir"/etc/{makepkg,pacman}.d
  142. install -m644 "$srcdir/pacman.conf.$CARCH" "$pkgdir/etc/pacman.conf"
  143. install -m644 "$srcdir/makepkg.conf.$CARCH" "$pkgdir/etc/makepkg.conf"
  144. echo '# There must be at least 1 file matching /etc/pacman.d/*.conf' > "$pkgdir/etc/pacman.d/empty.conf"
  145. install -dm755 "$pkgdir/usr/share/pacman/defaults"
  146. local carch
  147. for carch in "${arch[@]}"; do
  148. install -m644 "$srcdir/pacman.conf.$carch" "$pkgdir/usr/share/pacman/defaults/"
  149. install -m644 "$srcdir/makepkg.conf.$carch" "$pkgdir/usr/share/pacman/defaults/"
  150. done
  151. # put bash_completion in the right location
  152. install -dm755 "$pkgdir/usr/share/bash-completion/completions"
  153. mv "$pkgdir/etc/bash_completion.d/pacman" "$pkgdir/usr/share/bash-completion/completions"
  154. rmdir "$pkgdir/etc/bash_completion.d"
  155. for f in makepkg pacman-key; do
  156. ln -s pacman "$pkgdir/usr/share/bash-completion/completions/$f"
  157. done
  158. # Parabola's pacman began shipping a weekly job for this back in
  159. # 2014. Why is it nescessary for Parabola installs, but it
  160. # seemingly isn't for Arch installs?
  161. install -Dm644 "$srcdir/pacman-keyring.service" "$pkgdir/usr/lib/systemd/system/pacman-keyring.service"
  162. install -Dm644 "$srcdir/pacman-keyring.timer" "$pkgdir/usr/lib/systemd/system/pacman-keyring.timer"
  163. install -Dm644 /dev/stdin "$pkgdir/usr/lib/systemd/system-preset/90-pacman.preset" <<<"enable pacman-keyring.timer"
  164. }