summaryrefslogtreecommitdiff
path: root/system/linux-pam/APKBUILD
blob: bf6a19f93009cc2363fef32a31c98a96ceae01c9 (plain) (blame)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=linux-pam
pkgver=1.3.1
pkgrel=0
pkgdesc="Pluggable Authentication Modules"
url="http://www.kernel.org/pub/linux/libs/pam"
arch="all"
license="BSD"
depends_dev="gettext-tiny-dev"
makedepends_host="$depends_dev utmps-dev"
makedepends_build="$depends_dev bison flex-dev autoconf automake libtool"
makedepends="$makedepends_host $makedepends_build"
options="suid"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://github.com/$pkgname/$pkgname/releases/download/v1.3.1/Linux-PAM-$pkgver.tar.xz
	fix-compat.patch
	libpam-fix-build-with-eglibc-2.16.patch
	musl-fix-pam_exec.patch
	use-utmpx.patch

	base-auth.pamd
	base-account.pamd
	base-password.pamd
	base-session.pamd
	base-session-noninteractive.pamd
	other.pamd
	su.pamd
	"

builddir="$srcdir"/Linux-PAM-$pkgver
prepare() {
	cd "$builddir"
	default_prepare
	# disable insecure modules
	sed -e 's/pam_rhosts//g' -i modules/Makefile.am
}

build() {
	cd "$builddir"
	autoreconf -vif
	[ "$CLIBC" = "musl" ] && export ac_cv_search_crypt=no
	LIBS="-lutmps -lskarnet" ./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--libdir=/lib \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-db
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install

	# do not install pam.d files bundled with the source, they could be broken
	rm -rf "$pkgdir"/etc/pam.d

	# install our pam.d files
	mkdir "$pkgdir"/etc/pam.d
	for i in $source; do
		case $i in
		*.pamd)
			basename=$(echo $i | cut -d. -f1)
			cp "$srcdir"/$i "$pkgdir"/etc/pam.d/"$basename"
			# ensure users can use PAM services without SUID
			chmod 644 "$pkgdir"/etc/pam.d/"$basename"
			;;
		esac
	done

	chgrp shadow "$pkgdir"/sbin/unix_chkpwd \
		&& chmod g+s "$pkgdir"/sbin/unix_chkpwd
}

sha512sums="6bc8e2a5b64686f0a23846221c5228c88418ba485b17c53b3a12f91262b5bb73566d6b6a5daa1f63bbae54310aee918b987e44a72ce809b4e7c668f0fadfe08e  Linux-PAM-1.3.1.tar.xz
1a8ae3a212684b0dfef12aaeb1d4cec6e85b056a79b13ddc9ebe1cd61fe8da1a6210a06eb3e4f5bacc0c2fa71b82346d87f673921ce1453cbc46cb905e86a6c6  fix-compat.patch
f49edf3876cc6bcb87bbea4e7beaeb0a382d596898c755f5fbaf6c2ed4e0c8f082b2cd16dde8a74af82bb09a1334f463e07a4bb5b8a48f023ff90a67ad2fdd44  libpam-fix-build-with-eglibc-2.16.patch
82fb1ec27b370ed5d30451f31aecbacf94ff8aff9db52e79090466dcdd1b1b2c18ca7e0641b1b51a3ed78ea7203fe9464b50f63d6dbf661e10f68366c79196ae  musl-fix-pam_exec.patch
8352c0bd36f776251143d1e73d92a1e746e8f23778462e441cc989afd4204887aca6b310d87ab8e5b315b13c4ad1225c87531b71a0fef693772fc7e12bcde418  use-utmpx.patch
0672ab21adb969af2a0082e2559f1196d8a4f8b1cff2836f97e5f24edb03b6aed156c61cf335a4df978e423dcd9934ffee8cb5784ed5dde704d7e5ddec4ba9f6  base-auth.pamd
85462201a4044c7e170e617d39b0eceb4790abc6c0504999117548030a16d80a9d2078d1ad97690d7d346e6374201f0c52e792ccb08ce2b1c4bbf0cc2be96f5b  base-account.pamd
8223b815148c3b9b874d2c283840f6428c266e56c7cf49ce8fc508c4945ae31c837bef96dab17f64a60812d1c9cd0055cf0a50d7951d23070b69bd2e5bb9666d  base-password.pamd
b0138f662715974bd865d755c5e7d403faf5b9ad1b7e2b1d1598ad7eb5764a9ff407f1a5e6ce7f16db9fc10f8d643323b494563416fd6a654032529b52213c5b  base-session.pamd
444e20046843057b17c0aac14d2b71a68923b989b3d8b478bbf684698673683186e928e5ca2e6cb9a1c76abc4248044a0e10ef6b06b3f51857106796ecce250d  base-session-noninteractive.pamd
d103ba06b2c4929171e09c845f9866539220cd20d8d56a03d25850342ef5eabe281e958dfe1eaefd550c00f9440e8700c1d74c88c3001f933134ca6fd7cb9b7b  other.pamd
b512d691f2a6b11fc329bf91dd05ca9c589bbd444308b27d3c87c75262dedf6afc68a9739229249a4bd3d0c43cb1f871eecbb93c4fe559e0f38bdabbffd06ad7  su.pamd"