diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | debian/naskpass.postinst | 5 | ||||
-rwxr-xr-x | debian/naskpass.postrm | 33 | ||||
-rwxr-xr-x | debian/naskpass.prerm | 4 | ||||
-rwxr-xr-x | debian/rules | 3 |
5 files changed, 45 insertions, 2 deletions
diff --git a/debian/control b/debian/control index dc3c228..93503a0 100644 --- a/debian/control +++ b/debian/control @@ -11,5 +11,7 @@ Homepage: https://github.com/freecoding/naskpass.git Package: naskpass Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, cryptsetup (= 2:1.6.6-5), libncurses5, libtinfo5, coreutils +Recommends: openssh-server +Conflicts: dropbear Description: Ncurses based cryptsetup askpass replacement NULL. diff --git a/debian/naskpass.postinst b/debian/naskpass.postinst index 4d9cc42..981f62b 100755 --- a/debian/naskpass.postinst +++ b/debian/naskpass.postinst @@ -24,6 +24,11 @@ case "$1" in else nask_deactivate fi + if [ -x /usr/bin/ssh-keygen ]; then + [ -r /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key ] || /usr/bin/ssh-keygen -t rsa -N '' -b 4096 -f /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key + [ -r /etc/initramfs-tools/etc/ssh/ssh_host_dsa_key ] || /usr/bin/ssh-keygen -t dsa -N '' -b 1024 -f /etc/initramfs-tools/etc/ssh/ssh_host_dsa_key + [ -r /etc/initramfs-tools/etc/ssh/authorized_keys ] || touch /etc/initramfs-tools/etc/ssh/authorized_keys + fi update-initramfs -u ;; diff --git a/debian/naskpass.postrm b/debian/naskpass.postrm new file mode 100755 index 0000000..0963e23 --- /dev/null +++ b/debian/naskpass.postrm @@ -0,0 +1,33 @@ +#!/bin/sh +# postrm script for naskpass +# +# see: dh_installdeb(1) + +set -e + + +. /usr/share/debconf/confmodule + +case "$1" in + purge) + rm -f /etc/initramfs-tools/etc/ssh/authorized_keys + rm -f /etc/initramfs-tools/etc/ssh/ssh_host_dsa_key + rm -f /etc/initramfs-tools/etc/ssh/ssh_host_dsa_key.pub + rm -f /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key + rm -f /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key.pub + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/naskpass.prerm b/debian/naskpass.prerm index afcf9b1..47beafb 100755 --- a/debian/naskpass.prerm +++ b/debian/naskpass.prerm @@ -10,7 +10,7 @@ set -e . /usr/share/naskpass/naskconf case "$1" in - remove|purge) + remove) nask_deactivate db_purge update-initramfs -u @@ -19,7 +19,7 @@ case "$1" in ;; *) - echo "postrm called with unknown argument \`$1'" >&2 + echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac diff --git a/debian/rules b/debian/rules index 5375c6b..2311fb3 100755 --- a/debian/rules +++ b/debian/rules @@ -25,6 +25,7 @@ clean: dh_testroot rm -f build-stamp configure-stamp dh_clean + dh_auto_clean distclean: build $(MAKE) distclean @@ -45,6 +46,8 @@ install: build install -D -m755 ./scripts/naskpass.initconf $(CURDIR)/debian/naskpass/usr/share/naskpass/ install -D -m755 ./scripts/naskpass.pre $(CURDIR)/debian/naskpass/usr/share/naskpass/ install -D -m755 ./scripts/naskpass.post $(CURDIR)/debian/naskpass/usr/share/naskpass/ + install -d -m755 $(CURDIR)/debian/naskpass/etc/initramfs-tools/etc/ssh/ + install -D -m644 ./scripts/sshd_config $(CURDIR)/debian/naskpass/etc/initramfs-tools/etc/ssh/ binary-indep: build install |