57 kx #!/bin/sh
57 kx
57 kx # Preserve new files
57 kx install_file() {
57 kx NEW="$1"
57 kx OLD="`dirname $NEW`/`basename $NEW .new`"
57 kx # If there's no file by that name, mv it over:
57 kx if [ ! -r $OLD ]; then
57 kx mv $NEW $OLD
57 kx elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
57 kx rm $NEW
57 kx fi
57 kx # Otherwise, we leave the .new copy for the admin to consider...
57 kx }
57 kx
57 kx
57 kx # arg 1: the new package version
57 kx pre_install() {
57 kx /bin/true
57 kx }
57 kx
57 kx # arg 1: the new package version
57 kx post_install() {
57 kx #
57 kx # NOTE:
57 kx # 'install-info' can work using relative paths and we can make use build machine
57 kx # utility during installation to the some partition and use target 'install-info'
57 kx # during installation directly on the running target machine.
57 kx #
57 kx if [ -x /usr/bin/install-info ] ; then
57 kx install-info --info-dir=usr/share/info usr/share/info/gnutls.info.gz 2>/dev/null
57 kx elif ! grep "(gnutls)" usr/share/info/dir 1> /dev/null 2> /dev/null ; then
57 kx cat << EOF >> usr/share/info/dir
57 kx
57 kx Software libraries
57 kx * GnuTLS: (gnutls). GNU Transport Layer Security Library.
57 kx
57 kx System Administration
57 kx * certtool: (gnutls)certtool Invocation.
57 kx Manipulate certificates and keys.
57 kx * gnutls-cli-debug: (gnutls)gnutls-cli-debug Invocation.
57 kx GnuTLS debug client.
57 kx * gnutls-cli: (gnutls)gnutls-cli Invocation.
57 kx GnuTLS test client.
57 kx * gnutls-serv: (gnutls)gnutls-serv Invocation.
57 kx GnuTLS test server.
57 kx * psktool: (gnutls)psktool Invocation.
57 kx Simple TLS-Pre-Shared-Keys manager.
57 kx * srptool: (gnutls)srptool Invocation.
57 kx Simple SRP password tool.
57 kx EOF
57 kx fi
57 kx }
57 kx
57 kx # arg 1: the new package version
57 kx # arg 2: the old package version
57 kx pre_update() {
57 kx /bin/true
57 kx }
57 kx
57 kx # arg 1: the new package version
57 kx # arg 2: the old package version
57 kx post_update() {
57 kx post_install
57 kx }
57 kx
57 kx # arg 1: the old package version
57 kx pre_remove() {
57 kx if [ -x /usr/bin/install-info ] ; then
57 kx install-info --delete --info-file=usr/share/info/gnutls.info.gz --dir-file=usr/share/info/dir 2> /dev/null || /bin/true
57 kx fi
57 kx }
57 kx
57 kx # arg 1: the old package version
57 kx post_remove() {
57 kx /bin/true
57 kx }
57 kx
57 kx
57 kx operation=$1
57 kx shift
57 kx
57 kx $operation $*