archrelease: copy trunk to staging-x86_64
[arch-packages.git] / libcap / trunk / PKGBUILD
blob5009ca7ef297c59c5f10c6ff8a72e55bf4576838
1 # Maintainer:  David Runge <dvzrv@archlinux.org>
2 # Contributor: BartÅ‚omiej Piotrowski <bpiotrowski@archlinux.org>
3 # Contributor: Allan McRae <allan@archlinux.org>
4 # Contributor: Hugo Doria <hugo@archlinux.org>
6 pkgname=libcap
7 pkgver=2.68
8 pkgrel=1
9 pkgdesc="POSIX 1003.1e capabilities"
10 arch=(x86_64)
11 url="https://sites.google.com/site/fullycapable/"
12 license=(GPL2)
13 depends=(
14   gcc-libs
15   glibc
16   pam
18 makedepends=(
19   go
20   linux-api-headers
22 provides=(
23   libcap.so
24   libpsx.so
26 source=(
27   https://kernel.org/pub/linux/libs/security/linux-privs/${pkgname}2/$pkgname-$pkgver.tar.{xz,sign}
28   libcap-2.68-cgo_flags.patch  # provide flags to go build (sent upstream)
30 sha512sums=('ede3e1356aef22e18a46dc8ff0727500ab023bea698cf2bb822abb06625e272940afea52ad6457d0cd8cf1c7f435f1b568baf0a6bf0a08ae96fbf6d7502f9de2'
31             'SKIP'
32             '08db53f996a4d686fe54b43159def06b60f996277023e3729a1855dbc1f26d2279512183fdf852da787cc6b4c4b9a582d789e8dea6a4b6717359e7e08f20a173')
33 b2sums=('659ee2b0f92ab7490e7f4c9ccd6aafa02ae36c509654fdb53a0b9da4d5ba8be2d1b5afd2073b2b1c75f9585a0593a9d3e70af59fe0c213e178782bbd11cd3b3d'
34         'SKIP'
35         '40c4e760efdb203d6a680b1c7f58e45ff7c971cade170a3619db620fdd39d75d9063e6ba1193172a29e3304a948d5e7a77abe803cb803d5124a2c0d8622b5a5a')
36 validpgpkeys=(38A644698C69787344E954CE29EE848AE2CCF3F4) # Andrew G. Morgan <morgan@kernel.org>
38 prepare() {
39   patch -Np1 -d $pkgname-$pkgver -i ../libcap-2.68-cgo_flags.patch
42 build() {
43   export CGO_CPPFLAGS="$CPPFLAGS"
44   export CGO_CFLAGS="$CFLAGS"
45   export CGO_CXXFLAGS="$CXXFLAGS"
46   export CGO_LDFLAGS="$LDFLAGS"
47   export CGO_REQUIRED="1"
48   export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
50   local make_options=(
51     CGO_CPPFLAGS="$CPPFLAGS"
52     CGO_CFLAGS="$CFLAGS"
53     CGO_CXXFLAGS="$CXXFLAGS"
54     CGO_LDFLAGS="$LDFLAGS"
55     CGO_REQUIRED="1"
56     GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
57     DYNAMIC=yes
58     KERNEL_HEADERS=/usr/include
59     lib=lib
60     prefix=/usr
61     sbindir=bin
62     -C $pkgname-$pkgver
63   )
65   make "${make_options[@]}"
68 check() {
69   make test -k -C $pkgname-$pkgver
72 package() {
73   local make_options=(
74     DESTDIR="$pkgdir"
75     RAISE_SETFCAP=no
76     lib=lib
77     prefix=/usr
78     sbindir=bin
79     install
80     -C $pkgname-$pkgver
81   )
83   make "${make_options[@]}"
84   install -vDm 644 $pkgname-$pkgver/{CHANGELOG,README} -t "$pkgdir/usr/share/doc/$pkgname/"
85   install -vDm 644 $pkgname-$pkgver/pam_cap/capability.conf -t "$pkgdir/usr/share/doc/$pkgname/examples/"