5 kx #!/bin/sh
5 kx
5 kx # Preserve new files
5 kx install_file() {
5 kx NEW="$1"
5 kx OLD="`dirname $NEW`/`basename $NEW .new`"
5 kx # If there's no file by that name, mv it over:
5 kx if [ ! -r $OLD ]; then
5 kx mv $NEW $OLD
5 kx elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
5 kx rm $NEW
5 kx fi
5 kx # Otherwise, we leave the .new copy for the admin to consider...
5 kx }
5 kx
5 kx
5 kx # arg 1: the new package version
5 kx pre_install() {
5 kx /bin/true
5 kx }
5 kx
5 kx # arg 1: the new package version
5 kx post_install() {
5 kx #
5 kx # NOTE:
5 kx # 'install-info' can work using relative paths and we can make use build machine
5 kx # utility during installation to the some partition and use target 'install-info'
5 kx # during installation directly on the running target machine.
5 kx #
5 kx if [ -x /usr/bin/install-info ] ; then
5 kx install-info --info-dir=usr/share/info usr/share/info/gettext.info.gz 2>/dev/null
5 kx elif ! grep "(gettext)" usr/share/info/dir 1> /dev/null 2> /dev/null ; then
5 kx cat << EOF >> usr/share/info/dir
5 kx
5 kx GNU Gettext Utilities
5 kx * autopoint: (gettext)autopoint Invocation.
5 kx Copy gettext infrastructure.
5 kx * envsubst: (gettext)envsubst Invocation.
5 kx Expand environment variables.
5 kx * gettextize: (gettext)gettextize Invocation.
5 kx Prepare a package for gettext.
5 kx * gettext: (gettext). GNU gettext utilities.
5 kx * ISO3166: (gettext)Country Codes.
5 kx ISO 3166 country codes.
5 kx * ISO639: (gettext)Language Codes.
5 kx ISO 639 language codes.
5 kx * msgattrib: (gettext)msgattrib Invocation.
5 kx Select part of a PO file.
5 kx * msgcat: (gettext)msgcat Invocation.
5 kx Combine several PO files.
5 kx * msgcmp: (gettext)msgcmp Invocation.
5 kx Compare a PO file and template.
5 kx * msgcomm: (gettext)msgcomm Invocation.
5 kx Match two PO files.
5 kx * msgconv: (gettext)msgconv Invocation.
5 kx Convert PO file to encoding.
5 kx * msgen: (gettext)msgen Invocation.
5 kx Create an English PO file.
5 kx * msgexec: (gettext)msgexec Invocation.
5 kx Process a PO file.
5 kx * msgfilter: (gettext)msgfilter Invocation.
5 kx Pipe a PO file through a filter.
5 kx * msgfmt: (gettext)msgfmt Invocation.
5 kx Make MO files out of PO files.
5 kx * msggrep: (gettext)msggrep Invocation.
5 kx Select part of a PO file.
5 kx * msginit: (gettext)msginit Invocation.
5 kx Create a fresh PO file.
5 kx * msgmerge: (gettext)msgmerge Invocation.
5 kx Update a PO file from template.
5 kx * msgunfmt: (gettext)msgunfmt Invocation.
5 kx Uncompile MO file into PO file.
5 kx * msguniq: (gettext)msguniq Invocation.
5 kx Unify duplicates for PO file.
5 kx * ngettext: (gettext)ngettext Invocation.
5 kx Translate a message with plural.
5 kx * xgettext: (gettext)xgettext Invocation.
5 kx Extract strings into a PO file.
5 kx EOF
5 kx fi
5 kx }
5 kx
5 kx # arg 1: the new package version
5 kx # arg 2: the old package version
5 kx pre_update() {
5 kx /bin/true
5 kx }
5 kx
5 kx # arg 1: the new package version
5 kx # arg 2: the old package version
5 kx post_update() {
5 kx post_install
5 kx }
5 kx
5 kx # arg 1: the old package version
5 kx pre_remove() {
5 kx if [ -x /usr/bin/install-info ] ; then
5 kx install-info --delete --info-file=usr/share/info/gettext.info.gz --dir-file=usr/share/info/dir 2> /dev/null || /bin/true
5 kx fi
5 kx }
5 kx
5 kx # arg 1: the old package version
5 kx post_remove() {
5 kx /bin/true
5 kx }
5 kx
5 kx
5 kx operation=$1
5 kx shift
5 kx
5 kx $operation $*