summaryrefslogtreecommitdiff
path: root/repo/heimdal/heimdal.xibuild
blob: 6d0e31c30e68b7e6eb35c2bf9060722fb294a728 (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
73
74
75
76
77
78
79
80
81
82
#!/bin/sh

NAME="heimdal"
DESC="Iplementation of Kerberos 5"

MAKEDEPS="xipkg openssl e2fsprogs autoconf automake bash gawk libtool ncurses perl readline sqlite3 texinfo perl-json gdbm "

PKG_VER=7.7.0
SOURCE="https://github.com/heimdal/heimdal/releases/download/heimdal-$PKG_VER/heimdal-$PKG_VER.tar.gz"

ADDITIONAL="
005_all_heimdal-suid_fix.patch
CVE-2018-16860.patch
autoconf-270.patch
heimdal-kadmind.initd
heimdal-kdc.initd
heimdal-kpasswdd.initd
heimdal_missing-include.patch
silence-include-headers-redirect-warnings.patch
"

prepare() {
	[ -e /usr/lib/libasn1.so ] && xi -yl remove heimdal
    apply_patches
	sh ./autogen.sh
}

build() {
	export LDFLAGS="$LDFLAGS -Wl,--as-needed"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-shared=yes \
		--without-x \
		--without-berkeley-db \
		--with-readline-lib=/usr/lib \
		--with-readline-include=/usr/include/readline \
		--with-sqlite3=/usr \
		--without-openssl \
		--with-db-type-preference=

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

	# workarount a parallell build issue
	make -C lib/asn1 der-protos.h der-private.h
	make -C lib/kadm5 kadm5-protos.h kadm5-private.h kadm5_err.h
	make -C lib/krb5 krb5-protos.h krb5-private.h krb5_err.h krb_err.h \
		heim_err.h k524_err.h
	make -C lib/hx509 hx509-private.h  hx509-protos.h
	make
}

package() {
	make DESTDIR="$PKG_DEST" 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


	install -m755 -D "$BUILD_ROOT"/heimdal-kadmind.initd \
		"$PKG_DEST"/etc/init.d/heimdal-kadmind
	install -m755 -D "$BUILD_ROOT"/heimdal-kdc.initd \
		"$PKG_DEST"/etc/init.d/heimdal-kdc
	install -m755 -D "$BUILD_ROOT"/heimdal-kpasswdd.initd \
		"$PKG_DEST"/etc/init.d/heimdal-kpasswdd

	for i in 1 3 5 8; do
		rm -rf "$PKG_DEST"/usr/share/man/cat$i
	done

	# Remove conflicts
	# e2fsprogs
	rm -f "$PKG_DEST"/usr/bin/compile_et \
		"$PKG_DEST"/usr/share/man/man1/compile_et.1

	# Compress info pages
	for page in heimdal hx509; do
		gzip -9 "$PKG_DEST"/usr/share/info/$page.info
	done
}