summaryrefslogtreecommitdiffstats
path: root/main/heimdal/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'main/heimdal/APKBUILD')
-rw-r--r--main/heimdal/APKBUILD161
1 files changed, 161 insertions, 0 deletions
diff --git a/main/heimdal/APKBUILD b/main/heimdal/APKBUILD
new file mode 100644
index 00000000..a494e201
--- /dev/null
+++ b/main/heimdal/APKBUILD
@@ -0,0 +1,161 @@
+# Maintainer: Leonardo Arena <rnalrd@gmail.com>
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=heimdal
+pkgver=1.2.1
+pkgrel=3
+pkgdesc="An implementation of Kerberos 5"
+url="http://www.h5l.org/"
+license="BSD"
+depends=
+makedepends="gawk readline-dev e2fsprogs-dev sqlite-dev autoconf automake
+ libtool pkgconfig"
+install=
+subpackages="$pkgname-doc $pkgname-dev $pkgname-ftp $pkgname-telnet \
+$pkgname-su $pkgname-rsh $pkgname-rcp $pkgname-pagsh $pkgname-kf"
+source="http://www.h5l.org/dist/src/$pkgname-$pkgver.tar.gz
+001_all_heimdal-no_libedit.patch
+002_all_heimdal-fPIC.patch
+003_all_heimdal-rxapps.patch
+005_all_heimdal-suid_fix.patch
+013_all_heimdal-pthread-lib.patch
+014_all_heimdal-path.patch
+022_all_heimdal-as-needed.patch
+heimdal-system_sqlite.patch
+heimdal-r23235-kb5-libwind_la.patch
+heimdal-r23238-kb5_locl_h-wind_h.patch
+"
+
+# krb5.h needs com_err.h
+depends_dev="e2fsprogs-dev"
+
+build() {
+ [ -e /usr/lib/libasn1.so ] && echo "## remove old heimdal pkg first ##" && return 1
+
+ cd "$srcdir/$pkgname-$pkgver"
+
+ patch -Np0 -i ../../001_all_heimdal-no_libedit.patch || return 1
+ patch -Np0 -i ../../002_all_heimdal-fPIC.patch || return 1
+ patch -Np0 -i ../../003_all_heimdal-rxapps.patch || return 1
+ patch -Np0 -i ../../005_all_heimdal-suid_fix.patch || return 1
+ patch -Np1 -i ../../013_all_heimdal-pthread-lib.patch || return 1
+ patch -Np0 -i ../../014_all_heimdal-path.patch || return 1
+ patch -Np0 -i ../../022_all_heimdal-as-needed.patch || return 1
+ patch -Np0 -i ../../heimdal-system_sqlite.patch || return 1
+ patch -Np2 -i ../../heimdal-r23235-kb5-libwind_la.patch || return 1
+ patch -Np2 -i ../../heimdal-r23238-kb5_locl_h-wind_h.patch || return 1
+
+ # name clash with ruserpass in netdb.h
+ sed -i -e 's/ruserpass/ruserpw/g' appl/ftp/ftp/*.[ch] || return 1
+
+ sed -i -e 's|var/heimdal|var/lib/heimdal|g' configure.in \
+ doc/setup.texi doc/heimdal.info kadmin/kadmind.8 kdc/kdc.8 \
+ lib/hdb/hdb.h lib/krb5/krb5.conf.5 lib/krb5/krb5.conf.cat5
+
+ sh ./autogen.sh || return 1
+
+ export LDFLAGS="${LDFLAGS} -Wl,--as-needed"
+
+ ./configure --prefix=/usr \
+ --enable-shared=yes --without-x \
+ --disable-berkeley-db \
+ --disable-netinfo \
+ --with-readline-lib=/usr/lib \
+ --with-readline-include=/usr/include/readline \
+ --with-openssl=/usr
+
+ make || return 1
+ 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 -m644 -D krb5.conf ${pkgdir}/etc/krb5.conf || return 1
+ install -m755 -D ../../heimdal-kadmind.init ${pkgdir}/etc/init.d/heimdal-kadmind
+ install -m755 -D ../../heimdal-kdc.init ${pkgdir}/etc/init.d/heimdal-kdc
+ install -m755 -D ../../heimdal-kpasswdd.init ${pkgdir}/etc/init.d/heimdal-kpasswdd
+
+ # Remove editline, we use libreadline
+ rm ${pkgdir}/usr/lib/libeditline.* || return 1
+ rm ${pkgdir}/usr/include/editline.h || return 1
+ rm ${pkgdir}/usr/share/man/man3/editline.* || 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
+ rm -rf ${pkgdir}/usr/share/man/cat{1,3,5,8}
+
+ # Remove conflicts
+ rm ${pkgdir}/usr/share/man/man5/ftpusers.5*
+
+ # Compress info pages
+ for page in heimdal hx509; do
+ gzip -9 ${pkgdir}/usr/share/info/${page}.info
+ done
+
+ # Install the license
+ install -d ${pkgdir}/usr/share/licenses/${pkgname}
+ install -D -m644 ${srcdir}/${pkgname}-${pkgver}/LICENSE \
+ ${pkgdir}/usr/share/licenses/${pkgname}/ || 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="6e5028077e2a6b101a4a72801ba71b9e heimdal-1.2.1.tar.gz
+98e28f11f906c967aac22d6184102c9e 001_all_heimdal-no_libedit.patch
+6d5571bdedba2e2423b90bccdbac2c0a 002_all_heimdal-fPIC.patch
+2feec3924ee5230b54175b4d4000c872 003_all_heimdal-rxapps.patch
+45aeb207f360f9f4e9e0fabc8bfeecbc 005_all_heimdal-suid_fix.patch
+1b8665b771c4eb6b56ea8582c96e56e3 013_all_heimdal-pthread-lib.patch
+8208ae8c0b6ff5ab4f64af1693e9e396 014_all_heimdal-path.patch
+d7649e078c87d2ca997080f0deb527c0 022_all_heimdal-as-needed.patch
+949a389ebe7652861b2e178a7e0f1ed9 heimdal-system_sqlite.patch
+072f6b2550693adb30117394b1dd354e heimdal-r23235-kb5-libwind_la.patch
+7b4537b0e8bde95214211091e55eacf5 heimdal-r23238-kb5_locl_h-wind_h.patch"