summaryrefslogtreecommitdiff
path: root/pam_cap/APKBUILD
blob: 1f8357e192434ededd5deb16fcad3e5c301f9327 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Maintainer:

# when changing _ver or _rel make sure they match main/libcap
_ver=2.73
_rel=0

pkgname=pam_cap
pkgver=$_ver
pkgrel=$_rel
pkgdesc="POSIX 1003.1e capabilities, pam module"
arch="all"
license="BSD-3-Clause OR GPL-2.0-only"
url="https://sites.google.com/site/fullycapable/"
depends="libcap2=$_ver-r$_rel"
makedepends="libcap-dev linux-headers linux-pam-dev perl bash"
#subpackages="$pkgname-doc" # libcap-doc owns the manpages
source="https://kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-$pkgver.tar.xz"
options="!check"
builddir="$srcdir/libcap-$_ver"

prepare() {
	default_prepare
	# verify the libcap version, based on zfs-lts APKBUILD prepare()
	local _libcap_apkbuild="$startdir"/../../main/libcap/APKBUILD
	if [ -f $_libcap_apkbuild ]; then
		(
			. $_libcap_apkbuild
			pkgname=$_name
			[ "$_ver" != "$pkgver" ] && die "please update _ver to $pkgver"
			[ "$_rel" != "$pkgrel" ] && die "please update _rel to $pkgrel"
			return 0
		)
	fi
}

build() {
	make -C pam_cap\
		BUILD_CC=gcc \
		CC="${CC:-gcc}" \
		lib=lib  \
		prefix=/usr \
		lib_prefix= \
		GOLANG=no \
		PAM_CAP=yes \
		DESTDIR="$pkgdir"
}

package() {
	make -C pam_cap \
		lib=lib \
		prefix=/usr \
		lib_prefix= \
		GOLANG=no \
		PAM_CAP=yes \
		DESTDIR="$pkgdir" \
		install

	install -D -m644 -t "$pkgdir"/etc/security pam_cap/capability.conf
	# libcap-doc owns these: 
	#install -D -m644 -t "$pkgdir"/usr/share/man/man5 doc/capability.conf.5
	#install -D -m644 -t "$pkgdir"/usr/share/man/man8 doc/pam_cap.8
}

sha512sums="
8ab72cf39bf029656b2a4a5972a0da4ab4b46a3d8a8da66d6cde925e06fe34df2fa5fc4d0b62c9cec4972b0b2678fdac6ef9421b6fb83c2a5bf869cf8d5fdb16  libcap-2.73.tar.xz
"