autossh: Update from 1.4e to 1.4f
[termux-packages] / packages / krb5 / build.sh
index 160ac80..162f14a 100644 (file)
@@ -1,25 +1,51 @@
-TERMUX_PKG_HOMEPAGE='https://web.mit.edu/kerberos'
-TERMUX_PKG_DESCRIPTION='The Kerberos network authentication system'
-TERMUX_PKG_VERSION='1.15'
-TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, readline, c-ares, openssl, libutil"
+TERMUX_PKG_HOMEPAGE=https://web.mit.edu/kerberos
+TERMUX_PKG_DESCRIPTION="The Kerberos network authentication system"
+TERMUX_PKG_VERSION=1.16
+TERMUX_PKG_SHA256=faeb125f83b0fb4cdb2f99f088140631bb47d975982de0956d18c85842969e08
 TERMUX_PKG_SRCURL="https://web.mit.edu/kerberos/dist/krb5/$TERMUX_PKG_VERSION/krb5-$TERMUX_PKG_VERSION.tar.gz"
-TERMUX_PKG_SHA256='fd34752774c808ab4f6f864f935c49945f5a56b62240b1ad4ab1af7b4ded127c'
-TERMUX_PKG_FOLDERNAME="krb5-$TERMUX_PKG_VERSION/src"
-TERMUX_PKG_MAINTAINER='Vishal Biswas @vishalbiswas'
-TERMUX_PKG_EXTRA_CONFIGURE_ARGS=' --with-readline --with-netlib=-lcares --without-system-verto'
+TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, readline, openssl, libutil, libdb"
+TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
+TERMUX_PKG_CONFFILES="etc/krb5.conf var/krb5kdc/kdc.conf"
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-readline
+--without-system-verto
+--with-netlib=-lc
+--enable-dns-for-realm
+--sbindir=$TERMUX_PREFIX/bin
+--with-size-optimizations
+--with-system-db
+DEFCCNAME=$TERMUX_PREFIX/tmp/krb5cc_%{uid}
+DEFKTNAME=$TERMUX_PREFIX/etc/krb5.keytab
+DEFCKTNAME=$TERMUX_PREFIX/var/krb5/user/%{euid}/client.keytab
+"
+
+termux_step_post_extract_package() {
+       TERMUX_PKG_SRCDIR+="/src"
+}
 
 termux_step_pre_configure () {
-    # cannot test these when cross compiling
-    export krb5_cv_attr_constructor_destructor='yes,yes'
-    export ac_cv_func_regcomp='yes'
-    export ac_cv_printf_positional='yes'
+       # cannot test these when cross compiling
+       export krb5_cv_attr_constructor_destructor='yes,yes'
+       export ac_cv_func_regcomp='yes'
+       export ac_cv_printf_positional='yes'
+
+       # bionic doesn't have getpass
+       cp "$TERMUX_PKG_BUILDER_DIR/netbsd_getpass.c" "$TERMUX_PKG_SRCDIR/clients/kpasswd/"
+
+       CFLAGS="$CFLAGS -D_PASSWORD_LEN=PASS_MAX"
+       LDFLAGS="$LDFLAGS -landroid-glob -llog"
+}
+
+termux_step_post_make_install () {
+       # Enable logging to STDERR by default
+       echo -e "\tdefault = STDERR" >> $TERMUX_PKG_SRCDIR/config-files/krb5.conf
 
-    # disable some -Werror=
-    export krb5_cv_cc_flag__dash_Werror_eq_uninitialized='no'
-    export krb5_cv_cc_flag__dash_Werror_dash_implicit_dash_function_dash_declaration='no'
+       # Sample KDC config file
+       install -dm 700 $TERMUX_PREFIX/var/krb5kdc
+       install -pm 600 $TERMUX_PKG_SRCDIR/config-files/kdc.conf $TERMUX_PREFIX/var/krb5kdc/kdc.conf
 
-    # bionic doesn't have getpass
-    cp "$TERMUX_PKG_BUILDER_DIR/netbsd_getpass.c" "$TERMUX_PKG_SRCDIR/clients/kpasswd/"
+       # Default configuration file
+       install -pm 600 $TERMUX_PKG_SRCDIR/config-files/krb5.conf $TERMUX_PREFIX/etc/krb5.conf
 
-    LDFLAGS="$LDFLAGS -landroid-glob -llog"
+       install -dm 700 $TERMUX_PREFIX/share/aclocal
+       install -m 600 $TERMUX_PKG_SRCDIR/util/ac_check_krb5.m4 $TERMUX_PREFIX/share/aclocal
 }