aboutsummaryrefslogtreecommitdiffstats
path: root/main/sudo/APKBUILD
blob: 17f88a00ce0e33c24f08b4f1dc0986f091b1a28a (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
67
68
69
70
71
72
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sudo
pkgver=1.9.5p1
if [ "${pkgver%_*}" != "$pkgver" ]; then
	_realver=${pkgver%_*}${pkgver#*_}
else
	_realver=$pkgver
fi
pkgrel=0
pkgdesc="Give certain users the ability to run some commands as root"
url="https://www.sudo.ws/sudo/"
arch="all"
license="custom ISC"
makedepends="zlib-dev bash mandoc"
subpackages="$pkgname-doc $pkgname-dev"
source="https://www.sudo.ws/dist/sudo-$_realver.tar.gz
	fix-cross-compile.patch
	SIGUNUSED.patch
	"
options="suid"
builddir="$srcdir/sudo-$_realver"

# secfixes:
#   1.9.5-r0:
#     - CVE-2021-23239
#     - CVE-2021-23240
#   1.8.31-r0:
#     - CVE-2019-18634
#   1.8.28-r0:
#     - CVE-2019-14287
#   1.8.20_p2-r0:
#     - CVE-2017-1000368

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--libexecdir=/usr/lib \
		--mandir=/usr/share/man \
		--disable-nls \
		--enable-pie \
		--with-env-editor \
		--with-mdoc \
		--without-pam \
		--without-skey \
		--with-sendmail=/usr/sbin/sendmail \
		--with-passprompt="[sudo] password for %p: "

	# Workaround until SIGUNUSED.patch is not needed anymore
	rm lib/util/mksiglist.h lib/util/mksigname.h
	make -C lib/util DEVEL=1 mksiglist.h mksigname.h
	make
}

check() {
	make check
}

package() {
	# the sudo's mkinstalldir script miscreates the leading
	# path components with bad permissions. fix this.
	install -d -m0755 "$pkgdir"/var "$pkgdir"/var/db
	make -j1 DESTDIR="$pkgdir" install
	rm -rf "$pkgdir"/var/run
}

sha512sums="0168f0b61a6c2d2f60a92b5b4d3c3254aed4116decabac3821d9ac2fd7f74bb7b019e35bb8955335315b3b00ddf4e4acd82540df0addc1d9bf4f44b60447a878  sudo-1.9.5p1.tar.gz
f476bb5ac02c3222d3be7eecb828131374e0baf806cc0fd548fb9d4a90f40a848d0ef58851a63ea1d988b720fe259312f3a457ca994ac0e93ed9e16fc72d5234  fix-cross-compile.patch
03a2cef9fcc26cc2711edb5928c945fcf214b22139bb88d77538d25f3bfd144d17b6c9dabb1e01960ac1697d83b3452397a5ef4c7d0e68ea72548a631b212e6d  SIGUNUSED.patch"