PKGBUILDs/core/pacman/PKGBUILD
2017-06-16 01:07:31 +00:00

121 lines
4 KiB
Bash

# vim: set ts=2 sw=2 et:
# $Id$
# Maintainer: Dan McGee <dan@archlinux.org>
# Maintainer: Dave Reisner <dreisner@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - arch/host/flags for arm, armv6h, armv7h, and aarch64
# - pacman.conf: architecture=arm/armv6h/armv7h/aarch64, added our aur and alarm repos
# - makepkg.conf: adjusted C/CXX/LDFLAGS
# - patch to sync filesystem after install/remove
# - reverts to allow scriplet input on stdin
pkgname=pacman
pkgver=5.0.2
pkgrel=1
pkgdesc="A library-based package manager with dependency support"
arch=('i686' 'x86_64')
url="http://www.archlinux.org/pacman/"
license=('GPL')
groups=('base' 'base-devel')
depends=('bash' 'glibc' 'libarchive' 'curl'
'gpgme' 'pacman-mirrorlist')
makedepends=('asciidoc')
checkdepends=('python2' 'fakechroot')
optdepends=('fakeroot: for makepkg usage as normal user')
provides=('pacman-contrib')
conflicts=('pacman-contrib')
replaces=('pacman-contrib')
backup=(etc/pacman.conf etc/makepkg.conf)
options=('strip' 'debug')
validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae <allan@archlinux.org>
'B8151B117037781095514CA7BBDFFC92306B1121') # Andrew Gregory (pacman) <andrew@archlinux.org>
source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig}
0001-Sychronize-filesystem.patch
0002-Revert-close-stdin-before-running-install-scripts.patch
0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch
pacman.conf
makepkg.conf)
sha256sums=('dfd36086ad68564bcd977f4a1fafe51dd328acd4a95093ac4bf1249be9c41f0e'
'SKIP'
'5b81731c07945db05011db153cced5294187f16e487ca2fa221bb50aa4a18dc7'
'47b3583d093a9d5305f52f402f103fc5584c986a0272acbd36acfc96a9f01147'
'c8610fbae271167c2a1ae0bf69692038eac24f13921cabf925855a8697ea82f9'
'0c81e6feb426c2def260fe7b0c0586ae191ce3a782d19c119474671f147515c7'
'881759c640603e8f2ca5ff7eef83d4a5e2d3482b5d0e1e37d6b17a5533b75e5e')
prepare() {
cd $srcdir/$pkgname-$pkgver
patch -p1 -i ../0001-Sychronize-filesystem.patch
patch -p1 -i ../0002-Revert-close-stdin-before-running-install-scripts.patch
patch -p1 -i ../0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch
}
build() {
cd "$pkgname-$pkgver"
./configure --prefix=/usr --sysconfdir=/etc \
--localstatedir=/var --enable-doc \
--with-scriptlet-shell=/usr/bin/bash \
--with-ldconfig=/usr/bin/ldconfig
make
make -C contrib
}
check() {
make -C "$pkgname-$pkgver" check
}
package() {
cd "$pkgname-$pkgver"
make -j1 DESTDIR="$pkgdir" install
make -j1 DESTDIR="$pkgdir" -C contrib install
# install Arch specific stuff
install -dm755 "$pkgdir/etc"
install -m644 "$srcdir/pacman.conf" "$pkgdir/etc/pacman.conf"
case $CARCH in
arm)
mycarch="arm"
mychost="armv5tel-unknown-linux-gnueabi"
myflags="-march=armv5te "
;;
armv6h)
mycarch="armv6h"
mychost="armv6l-unknown-linux-gnueabihf"
myflags="-march=armv6 -mfloat-abi=hard -mfpu=vfp "
;;
armv7h)
mycarch="armv7h"
mychost="armv7l-unknown-linux-gnueabihf"
myflags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 "
;;
aarch64)
mycarch="aarch64"
mychost="aarch64-unknown-linux-gnu"
myflags="-march=armv8-a "
;;
esac
# set things correctly in the default conf file
install -m644 "$srcdir/makepkg.conf" "$pkgdir/etc"
sed -i "$pkgdir/etc/makepkg.conf" \
-e "s|@CARCH[@]|$mycarch|g" \
-e "s|@CHOST[@]|$mychost|g" \
-e "s|@CARCHFLAGS[@]|$myflags|g"
sed -i $pkgdir/etc/pacman.conf -e "s|@CARCH[@]|$mycarch|g"
# put bash_completion in the right location
install -dm755 "$pkgdir/usr/share/bash-completion/completions"
mv "$pkgdir/etc/bash_completion.d/pacman" "$pkgdir/usr/share/bash-completion/completions"
rmdir "$pkgdir/etc/bash_completion.d"
for f in makepkg pacman-key; do
ln -s pacman "$pkgdir/usr/share/bash-completion/completions/$f"
done
install -Dm644 contrib/PKGBUILD.vim "$pkgdir/usr/share/vim/vimfiles/syntax/PKGBUILD.vim"
}