aboutsummaryrefslogtreecommitdiffstats
path: root/cerberus/PKGBUILD
blob: 9c6a6ebe177face00c5881a608750a4b1bebe8da (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
# Maintainer: Mattias Andrée <`base64 -d`(bWF0dGlhcy5hbmRyZWU)@protonmail.com>

pkgname=cerberus
pkgver=1598672167
pkgrel=1
pkgdesc="A compile-time configurable minimal login program that uses libpassphrase"
url="https://github.com/GNU-Pony/cerberus"
arch=(i686 x86_64)
license=(GPL3)
depends=(glibc 'libpassphrase>=1400850322' linux)
makedepends=(make coreutils gcc texinfo) # pam
install=cerberus.install
source=("${url}/archive/${pkgver}.tar.gz")
sha256sums=(bb547c467a5735d048aa815e5466df4c8d6910b8f7b710fa18c77a86df0bb98c)

# The dependency on `linux` can be removed if both `OWN_VCS` and `OWN_VCSA` is removed.
# The dependency on `pam` can removed if `auth` is change to not be `pam`.
# See `info cerberus configuring` for details on how to configure `cerberus`.
# Works on armv6h (tested on Raspberry Pi) unless `auth=pam`.


build() {
	cd "${srcdir}/cerberus-${pkgver}"
	
	auth=crypt # can also be set to `crypt` or `none` # pam
	cpp_defs=(OWN_VCS OWN_VCSA USE_TTY_GROUP)
	path_user=/usr/local/bin:/usr/bin
	path_root=/usr/local/sbin:/usr/local/bin:/usr/bin
	
	cpp_flags=()
	for def in "${cpp_defs[@]}"; do
	    cpp_flags+=( -D"${def}" )
	done
	cpp_flags="EXTRA_CPP_FLAGS=${cpp_flags[*]}"
	
	_conf=( AUTH="${auth}" PATH="${path_user}" PATH_ROOT="${path_root}" "${cpp_flags}" )
	
	make clean
	make PKGNAME="${pkgname}" INSTALL_BIN=/bin "${_conf[@]}"
}

package() {
	cd "${srcdir}/cerberus-${pkgver}"
	
	auth=crypt # can also be set to `crypt` or `none` # pam
	cpp_defs=(OWN_VCS OWN_VCSA USE_TTY_GROUP)
	path_user=/usr/local/bin:/usr/bin
	path_root=/usr/local/sbin:/usr/local/bin:/usr/bin
	
	cpp_flags=()
	for def in "${cpp_defs[@]}"; do
	    cpp_flags+=( -D"${def}" )
	done
	cpp_flags="EXTRA_CPP_FLAGS=${cpp_flags[*]}"
	
	_conf=( AUTH="${auth}" PATH="${path_user}" PATH_ROOT="${path_root}" "${cpp_flags}" )
	
	make PKGNAME="${pkgname}" INSTALL_BIN=/bin DESTDIR="${pkgdir}" "${_conf[@]}" install
	
	_dir="${pkgdir}/usr/share/licenses/${pkgname}"
	ln -sf -- "/usr/share/licenses/common/GPL3" "${_dir}/LICENSE"
}