# Description: Network Authentication Protocol
# URL: http://web.mit.edu/kerberos
# Maintainer: Jose V Beneyto, sepen at crux dot nu
# Packager: Alan Mizrahi, alan at mizrahi dot com dot ve
# Depends on: openldap e2fsprogs

name=krb5
version=1.14
release=1
source=(http://web.mit.edu/kerberos/dist/$name/$version/$name-$version.tar.gz \
        $name-config_LDFLAGS.patch)

build() {
	cd $name-$version/src/build-tools
	patch -p1 -i $SRC/$name-config_LDFLAGS.patch

	cd $SRC/$name-$version/src
        sed -e '/KRB5ROOT=/ s/\/local//' -i util/ac_check_krb5.m4

	export CFLAGS="${CFLAGS/-Os/-O2} -I/usr/include/et"

	./configure --prefix=/usr \
                    --localstatedir=/var \
                    --enable-shared \
                    --disable-rpath \
                    --without-tcl \
                    --with-ldap \
                    --with-system-et \
                    --with-system-ss \
                    --without-system-verto

	make
    	make DESTDIR=$PKG install
	rm -rf $PKG/usr/share $PKG/usr/man/cat* $PKG/usr/man5/.*

	# comment this if you want kerberized versions of ftp and telnet
	rm -rf $PKG/usr/bin/{ftp,telnet} $PKG/usr/man/man1/{ftp,telnet}.1
}
