chiark / gitweb /
alpine: passwordless masterpasword file
authorits-pointless <its-pointless@users.noreply.github.com>
Thu, 8 Feb 2018 23:57:35 +0000 (10:57 +1100)
committerFredrik Fornwall <fredrik@fornwall.net>
Thu, 8 Feb 2018 23:57:35 +0000 (00:57 +0100)
packages/alpine/build.sh

index 87f9ef36e1a11b9525dbb95829d93d2c0f1ba804..cb116b245aab8650bb11497a7e5f6a8b3a897a02 100644 (file)
@@ -2,7 +2,8 @@ TERMUX_PKG_HOMEPAGE=http://repo.or.cz/alpine.git
 TERMUX_PKG_DESCRIPTION="Fast, easy to use email client"
 TERMUX_PKG_VERSION=2.21
 TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/alpine-$TERMUX_PKG_VERSION.tar.xz
-TERMUX_PKG_DEPENDS="libcrypt, ncurses, openssl"
+TERMUX_PKG_DEPENDS="libcrypt, ncurses, openssl-tool"
+TERMUX_PKG_REVISION=1
 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
 --disable-debug
 --with-c-client-target=lnx
@@ -41,4 +42,14 @@ termux_step_post_configure() {
        $CC_FOR_BUILD help_h_gen.c -o help_h_gen
        touch -d "next hour" help_c_gen help_h_gen
 }
+termux_step_create_debscripts () {
+
+        echo "#!$TERMUX_PREFIX/bin/sh" >> postinst
+       echo "if [ ! -e $TERMUX_ANDROID_HOME/.alpine-smime/.pwd/MasterPassword.crt ] && [ ! -e $HOME/.alpine-smime/.pwd/MasterPassword.key ]; then" >> postinst
+        echo "echo 'warning making a passwordless masterpasword file'" >> postinst
+       echo "mkdir -p \$HOME/.alpine-smime/public \$HOME/.alpine-smime/.pwd \$HOME/.alpine-smime/private \$HOME/.alpine-smime/ca" >> postinst
+       echo "openssl req -x509 -newkey rsa:2048 -keyout \$HOME/.alpine-smime/.pwd/MasterPassword.key -out \$HOME/.alpine-smime/.pwd/MasterPassword.crt -days 10000 -nodes -subj '/C=US/ST=dont/L=use/O=this Name/OU=for/CN=anything.com.termux'" >> postinst
+       echo "touch \$HOME/.pine-passfile" >> postinst
+       echo "fi" >> postinst
+}