APKBUILD 4.14 KB
Newer Older
Leonardo Arena's avatar
Leonardo Arena committed
1
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
2
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
root's avatar
root committed
3
pkgname=heimdal
4
pkgver=7.7.0
5
_ver=${pkgver/_rc/rc}
Leo's avatar
Leo committed
6 7
pkgrel=2
pkgdesc="Iplementation of Kerberos 5"
8
arch="all"
Leo's avatar
Leo committed
9
url="https://github.com/heimdal/"
10
license="BSD-3-Clause"
11
depends="krb5-conf"
Leo's avatar
Leo committed
12
depends_dev="openssl-dev e2fsprogs-dev"
13
makedepends="$depends_dev autoconf automake bash gawk libtool
Leo's avatar
Leo committed
14
	ncurses-dev perl readline-dev sqlite-dev texinfo perl-json gdbm-dev"
15
options="suid !check" #FIXME: FAIL: snprintf-test
A. Wilcox's avatar
A. Wilcox committed
16
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-openrc"
17
source="https://github.com/heimdal/heimdal/releases/download/heimdal-$pkgver/heimdal-$pkgver.tar.gz
18 19 20 21
	heimdal-kadmind.initd
	heimdal-kdc.initd
	heimdal-kpasswdd.initd

22 23
	005_all_heimdal-suid_fix.patch
	heimdal_missing-include.patch
24
	CVE-2018-16860.patch
25
	"
26

27
# secfixes:
Leonardo Arena's avatar
Leonardo Arena committed
28
#   7.5.3-r4:
29
#     - CVE-2018-16860
30 31
#   7.4.0-r2:
#     - CVE-2017-17439
32
#   7.4.0-r0:
33
#     - CVE-2017-11103
Leonardo Arena's avatar
Leonardo Arena committed
34

35
prepare() {
root's avatar
root committed
36 37
	[ -e /usr/lib/libasn1.so ] && echo "## remove old heimdal pkg first ##" && return 1

38
	default_prepare
Natanael Copa's avatar
Natanael Copa committed
39

40
	sh ./autogen.sh
41
}
42

43
build() {
Leo's avatar
Leo committed
44
	export LDFLAGS="$LDFLAGS -Wl,--as-needed"
root's avatar
root committed
45

46 47 48 49
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
Leonardo Arena's avatar
Leonardo Arena committed
50 51
		--enable-shared=yes \
		--without-x \
Leo's avatar
Leo committed
52
		--without-berkeley-db \
root's avatar
root committed
53 54
		--with-readline-lib=/usr/lib \
		--with-readline-include=/usr/include/readline \
55
		--with-sqlite3=/usr \
Leo's avatar
Leo committed
56 57
		--without-openssl \
		--with-db-type-preference=
58 59 60 61

	# make sure we use system version
	rm -r lib/sqlite lib/com_err

62
	# workarount a parallell build issue
63 64
	make -C lib/asn1 der-protos.h der-private.h
	make -C lib/kadm5 kadm5-protos.h kadm5-private.h kadm5_err.h
65
	make -C lib/krb5 krb5-protos.h krb5-private.h krb5_err.h krb_err.h \
66 67 68 69 70 71 72
		heim_err.h k524_err.h
	make -C lib/hx509 hx509-private.h  hx509-protos.h
	make
}

check() {
	make check
73 74 75
}

package() {
76 77 78 79
	make DESTDIR="$pkgdir" exec_prefix=/usr sysconfdir=/etc \
	mandir=/usr/share/man infodir=/usr/share/info datadir=/var/lib/heimdal \
	localstatedir=/var/lib/heimdal libexecdir=/usr/sbin install

80

81
	install -m755 -D "$srcdir"/heimdal-kadmind.initd \
82
		"$pkgdir"/etc/init.d/heimdal-kadmind
83
	install -m755 -D "$srcdir"/heimdal-kdc.initd \
84
		"$pkgdir"/etc/init.d/heimdal-kdc
85
	install -m755 -D "$srcdir"/heimdal-kpasswdd.initd \
86
		"$pkgdir"/etc/init.d/heimdal-kpasswdd
87

88
	for i in 1 3 5 8; do
89
		rm -rf "$pkgdir"/usr/share/man/cat$i
90
	done
91

92
	# Remove conflicts
93 94
	# e2fsprogs
	rm -f "$pkgdir"/usr/bin/compile_et \
95
		"$pkgdir"/usr/share/man/man1/compile_et.1
96 97 98

	# Compress info pages
	for page in heimdal hx509; do
Leo's avatar
Leo committed
99
		gzip -9 "$pkgdir"/usr/share/info/$page.info
100 101 102
	done

	# Install the license
103
	install -d "$pkgdir"/usr/share/licenses/$pkgname
104
	install -D -m644 "$srcdir"/$pkgname-$_ver/LICENSE \
105
		"$pkgdir"/usr/share/licenses/$pkgname/
106 107
}

108 109 110
libs() {
	pkgdesc="Heimdal libraries"
	replaces="heimdal"
111
	depends="krb5-conf"
112
	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/sbin
113
	mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
114 115
	mv "$pkgdir"/usr/bin/string2key \
		"$pkgdir"/usr/bin/verify_krb5_conf \
116
		"$subpkgdir"/usr/bin/
117 118
	mv "$pkgdir"/usr/sbin/kdigest \
		"$pkgdir"/usr/sbin/digest-service \
119
		"$subpkgdir"/usr/sbin/
120 121 122

}

123
sha512sums="6660939b5a36ce36310721a08a089fb671d1e3d2e8ac74ea4775bfa5f8f772d32de805551456200fe96cc486c092c44beb84f5dd877008bc305490ee971bbf99  heimdal-7.7.0.tar.gz
124 125 126
0ae0fec4bdb3907d9e82e788e12ef185dd00e6db4c17f55758da5600fedd72ed1118b6b492d039f91cc54d54bf2f79f624ea38a68067e424b737b128494a4bbd  heimdal-kadmind.initd
4dca69bb1c1c6dfce8c0fc1da84855e4549be478ab09511fa5143ee61d1609fed7f3303179bc1e499b0f20445e04c41eda132dd1c5f72e2fea4fcf60a35ad2a9  heimdal-kdc.initd
abee8390632fa775e74900d09e5c72b02fe4f9616b43cc8d0a76175486ed6d4707fb3ce4d06ceb09b0e8d1384e037c3cff6525e11def0122c35c32eebd0d196f  heimdal-kpasswdd.initd
127
2a6b20588a86a9ea3c35209b96ef2da0b39bc3112aec1505e69a60efc9ffb9ddc1d0dbdfaf864142e9d2f81da3d2653de56d6ffa01871c20fde17e4642625c56  005_all_heimdal-suid_fix.patch
128 129
e89efdc942c512363aac1d9797c6bf622324e9200e282bc5ed680300b9e1b39a4ea20f059cdac8f22f972eb0af0e625fd41f267ebcafcfec0aaa81192aff79c1  heimdal_missing-include.patch
36738795eb3478b55790bf1927f85a421b13b6b47dcc273daeb6630c39a4e1c1258148fa0e9f004ae59a9ac89caf54cb25efedb417e852e42a2c32d02e43fd56  CVE-2018-16860.patch"