aboutsummaryrefslogtreecommitdiffstats
path: root/main/heimdal/APKBUILD
blob: f4941ce11327018ff58628485eec6255a927a33c (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
pkgname=heimdal
pkgver=1.6_rc2
_ver=${pkgver/_rc/rc}
pkgrel=4
pkgdesc="An implementation of Kerberos 5"
arch="all"
url="http://www.h5l.org/"
license="BSD"
depends="krb5-conf"
depends_dev="openssl-dev e2fsprogs-dev db-dev"
makedepends="$depends_dev autoconf automake bash gawk libtool
	ncurses-dev perl readline-dev sqlite-dev texinfo perl-json"
install=
options="suid"
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs
	$pkgname-ftp $pkgname-telnet $pkgname-su $pkgname-rsh $pkgname-rcp
	$pkgname-pagsh $pkgname-kf"
source="http://ftp4.de.freesbie.org/pub/misc/heimdal/src/$pkgname-$_ver.tar.gz
	heimdal-kadmind.initd
	heimdal-kdc.initd
	heimdal-kpasswdd.initd

	003_all_heimdal-rxapps.patch
	005_all_heimdal-suid_fix.patch
	014_all_heimdal-path.patch
	telnetd.patch
	heimdal_missing-include.patch
	heimdal-remove-broken-auth.patch
	libkadm5clnt-version-script.patch
	"

_builddir="$srcdir/$pkgname-$_ver"

prepare() {
	[ -e /usr/lib/libasn1.so ] && echo "## remove old heimdal pkg first ##" && return 1

	cd "$_builddir"

	for i in $source; do
		case $i in
		*.patch) msg "Applying patch $i"; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	# name clash with ruserpass in netdb.h
	sed -i -e 's/ruserpass/ruserpw/g' appl/ftp/ftp/*.[ch] || return 1

	sh ./autogen.sh || return 1
}

build() {
	cd "$_builddir"
	export LDFLAGS="${LDFLAGS} -Wl,--as-needed"
	export LIBS="-ldb"

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

	# 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 || return 1
	make -C lib/kadm5 kadm5-protos.h kadm5-private.h kadm5_err.h || return 1
	make -C lib/krb5 krb5-protos.h krb5-private.h krb5_err.h krb_err.h \
		heim_err.h k524_err.h || return 1
	make -C lib/hx509 hx509-private.h  hx509-protos.h || return 1
	make || return 1
}

package() {
	cd "$_builddir"
	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


	install -m755 -D "$srcdir"/heimdal-kadmind.initd \
		"$pkgdir"/etc/init.d/heimdal-kadmind || return 1
	install -m755 -D "$srcdir"/heimdal-kdc.initd \
		"$pkgdir"/etc/init.d/heimdal-kdc || return 1
	install -m755 -D "$srcdir"/heimdal-kpasswdd.initd \
		"$pkgdir"/etc/init.d/heimdal-kpasswdd || return 1

	# Rename daemons and their manpages
	for i in telnetd ftpd rshd; do
		mv ${pkgdir}/usr/share/man/man8/${i}.8 ${pkgdir}/usr/share/man/man8/k${i}.8 || return 1
		mv ${pkgdir}/usr/sbin/${i} ${pkgdir}/usr/sbin/k${i} || return 1
	done

	# Rename clients and their manpages
	for i in rcp rsh telnet ftp su login; do
		if [ -f ${pkgdir}/usr/share/man/man1/${i}.1 ]; then
			mv ${pkgdir}/usr/share/man/man1/${i}.1 ${pkgdir}/usr/share/man/man1/k${i}.1 || return 1
		fi
		mv ${pkgdir}/usr/bin/${i} ${pkgdir}/usr/bin/k${i} || return 1
	done
	for i in 1 3 5 8; do
		rm -rf "$pkgdir"/usr/share/man/cat$i
	done

	# Remove conflicts 
	# e2fsprogs
	rm -f "$pkgdir"/usr/bin/compile_et \
		"$pkgdir"/usr/share/man/man1/compile_et.1 || return 1
	# man-page
	rm "$pkgdir"/usr/share/man/man5/ftpusers.5* || return 1
	# erlang
	rm "$pkgdir"/usr/share/man/man3/os.3* || return 1

	# Compress info pages
	for page in heimdal hx509; do
		gzip -9 "$pkgdir"/usr/share/info/${page}.info || return 1
	done

	# Install the license
	install -d "$pkgdir"/usr/share/licenses/$pkgname
	install -D -m644 "$srcdir"/$pkgname-$_ver/LICENSE \
		"$pkgdir"/usr/share/licenses/$pkgname/ || return 1
}

libs() {
	pkgdesc="Heimdal libraries"
	replaces="heimdal"
	depends="krb5-conf"
	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/sbin
	mv "$pkgdir"/usr/lib "$subpkgdir"/usr/ || return 1
	mv "$pkgdir"/usr/bin/string2key \
		"$pkgdir"/usr/bin/verify_krb5_conf \
		"$subpkgdir"/usr/bin/ || return 1
	mv "$pkgdir"/usr/sbin/kdigest \
		"$pkgdir"/usr/sbin/digest-service \
		"$subpkgdir"/usr/sbin/ || return 1

}

ftp() {
	mkdir -p $subpkgdir/usr/bin/
	mv $pkgdir/usr/bin/kftp $subpkgdir/usr/bin/kftp
	mkdir -p $subpkgdir/usr/sbin/
	mv $pkgdir/usr/sbin/kftpd $subpkgdir/usr/sbin/kftpd
}

telnet() {
	mkdir -p $subpkgdir/usr/bin/
	mv $pkgdir/usr/bin/ktelnet $subpkgdir/usr/bin/ktelnet
	mkdir -p $subpkgdir/usr/sbin/
	mv $pkgdir/usr/sbin/ktelnetd $subpkgdir/usr/sbin/ktelnetd
}

su() {
	mkdir -p $subpkgdir/usr/bin/
	mv $pkgdir/usr/bin/ksu $subpkgdir/usr/bin/ksu
}

rsh() {
	mkdir -p $subpkgdir/usr/bin/
	mv $pkgdir/usr/bin/krsh $subpkgdir/usr/bin/krsh
	mkdir -p $subpkgdir/usr/sbin/
	mv $pkgdir/usr/sbin/krshd $subpkgdir/usr/sbin/krshd
}

rcp() {
        mkdir -p $subpkgdir/usr/bin/
	mv $pkgdir/usr/bin/krcp $subpkgdir/usr/bin/krcp
}

pagsh() {
        mkdir -p $subpkgdir/usr/bin/
        mv $pkgdir/usr/bin/pagsh $subpkgdir/usr/bin/pagsh
}

kf() {
        mkdir -p $subpkgdir/usr/bin/
        mv $pkgdir/usr/bin/kf $subpkgdir/usr/bin/kf
}

md5sums="152ca82660864acf7f712ae1a57e6795  heimdal-1.6rc2.tar.gz
872a6de29fc4dd2d4001d66f9e2206f7  heimdal-kadmind.initd
823a47e3bfc9530f19353dc02c96c290  heimdal-kdc.initd
ba4ecfbd48cd59b6a239835a501a0c36  heimdal-kpasswdd.initd
51b6af2072105b52c96a851a5bd1f461  003_all_heimdal-rxapps.patch
efa764866eed4c589dc9d2aedfe1c140  005_all_heimdal-suid_fix.patch
86f5afbba54fd6d3dcbe9dd8fbac9620  014_all_heimdal-path.patch
c2c2bab875bb1d258c23c88b4c237857  telnetd.patch
9a8db1ed3098a1b1073aa8b75b8084c8  heimdal_missing-include.patch
5a0fd2107233391beb73907600918d25  heimdal-remove-broken-auth.patch
d45444b92259e95a51d52145851d5206  libkadm5clnt-version-script.patch"
sha256sums="8fe19e0f12ff0d0c2f20a6cf56727deaabd89db9c197288022fb489e103b730d  heimdal-1.6rc2.tar.gz
a69218c8320b730b884631aa4a2548ddc0dbd864b458e26314c22bf903d6ddbd  heimdal-kadmind.initd
4cb005716e195116421d9fbf021d6d6178e487232610854f9c9a1d0aaf798d56  heimdal-kdc.initd
0bbe7c4231ba8126f6cac2869da5c8b074b987c23a3940b9bda8caa269fc6bfd  heimdal-kpasswdd.initd
c4f3550e3938b82e31a616b90fbe9fb2f2bd775e108e31cc355d29ac5ab6a25a  003_all_heimdal-rxapps.patch
05b10444d50a3b4074b7539ea2ba39569b1e0704c061e9e93fdb6bd3fc59feb6  005_all_heimdal-suid_fix.patch
7fa05b0a5a149ce852d7c61ae97a6ed99022010d6a8c5ed9fe6686527ac4c289  014_all_heimdal-path.patch
6b78762077e6952e775b3e3471b8c53828d9b284866c4cdd2891acb26393f8ec  telnetd.patch
1cd63bd7ecbcf502859c37777a6f64c043c6da298a24ac582490e7c0b06fc5c0  heimdal_missing-include.patch
28d4828914f8ffcf940aaea54b1051caa4b9ae0618a24e82506c004bed8a1bdc  heimdal-remove-broken-auth.patch
f23b413b444e4866c4cf3b516cff835cdd03ec438f8487ec8dae39bca489b854  libkadm5clnt-version-script.patch"
sha512sums="18c1bdbb003c18535f19fcde4121c80544597d0409fcde83721f6489ef8f16bdd320a4dee0392cf57555dfd76ffe8b416b11b1086759bbfca112db959ed53f5f  heimdal-1.6rc2.tar.gz
0ae0fec4bdb3907d9e82e788e12ef185dd00e6db4c17f55758da5600fedd72ed1118b6b492d039f91cc54d54bf2f79f624ea38a68067e424b737b128494a4bbd  heimdal-kadmind.initd
4dca69bb1c1c6dfce8c0fc1da84855e4549be478ab09511fa5143ee61d1609fed7f3303179bc1e499b0f20445e04c41eda132dd1c5f72e2fea4fcf60a35ad2a9  heimdal-kdc.initd
abee8390632fa775e74900d09e5c72b02fe4f9616b43cc8d0a76175486ed6d4707fb3ce4d06ceb09b0e8d1384e037c3cff6525e11def0122c35c32eebd0d196f  heimdal-kpasswdd.initd
9aaa09cdaddb958ee08f3341f6f72c4f8949680be4ebd489dc4a1e83308164674d46d9a3ba5254d23943650f26b67d0df01b6e5448e0d75d8fa773835728ac77  003_all_heimdal-rxapps.patch
2a6b20588a86a9ea3c35209b96ef2da0b39bc3112aec1505e69a60efc9ffb9ddc1d0dbdfaf864142e9d2f81da3d2653de56d6ffa01871c20fde17e4642625c56  005_all_heimdal-suid_fix.patch
b242cbdbd5e656e30b39fa88767d2024e9895ea6c047c061f15bbde003d02289f0fc8b63aaa7ab1e4166e2ce9adf6d2a361ae3f8ed6af7e338865be9ef909205  014_all_heimdal-path.patch
cc8775c02197ee6dc60bd62a34a03b57bafbc8e040da62028c64832bb036c29b0664eb7d19c5ff8bcf3aeb10d413fd06b7cefac610a906dafa8c2f527a73195c  telnetd.patch
e89efdc942c512363aac1d9797c6bf622324e9200e282bc5ed680300b9e1b39a4ea20f059cdac8f22f972eb0af0e625fd41f267ebcafcfec0aaa81192aff79c1  heimdal_missing-include.patch
74be145d6ebffa275e9411f2dbb1c3ccac41935457cb3b9482a7346ade987696a037f41cebd2677274b4827777c88a07a5336f494923fc4715dfda026ed918d2  heimdal-remove-broken-auth.patch
157e0a6f11688c93253aaae74f1ee3892e66413baa152bbc104ac0d61efc22ffcff53130ac897c4f5e49b4f160f260f159e68396d7cf1f3ca6dd72e3ac694ae3  libkadm5clnt-version-script.patch"