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 preserve_perms() {
5 kx NEW="$1"
5 kx OLD="$(dirname $NEW)/$(basename $NEW .new)"
5 kx if [ -e $OLD ]; then
5 kx cp -a $OLD ${NEW}.incoming
5 kx cat $NEW > ${NEW}.incoming
5 kx touch -r $NEW ${NEW}.incoming
5 kx mv ${NEW}.incoming $NEW
5 kx fi
5 kx install_file $NEW
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 preserve_perms etc/rc.d/rc.cyrus-imapd.new
5 kx install_file etc/cyrus.conf.new
5 kx install_file etc/imapd.conf.new
5 kx if ! grep "DBI|" @PERL_LOCAL_POD@ 1> /dev/null 2> /dev/null ; then
5 kx cat << EOF >> @PERL_LOCAL_POD@
5 kx =head2 Sat Nov 5 22:29:56 2022: C<Module> L<Cyrus::Annotator::Daemon|Cyrus::Annotator::Daemon>
5 kx
5 kx =over 4
5 kx
5 kx =item *
5 kx
5 kx C<installed into: /usr/share/perl5/vendor_perl>
5 kx
5 kx =item *
5 kx
5 kx C<LINKTYPE: dynamic>
5 kx
5 kx =item *
5 kx
5 kx C<VERSION: 1.00>
5 kx
5 kx =item *
5 kx
5 kx C<EXE_FILES: >
5 kx
5 kx =back
5 kx
5 kx =head2 Sat Nov 5 22:29:56 2022: C<Module> L<Cyrus::IMAP|Cyrus::IMAP>
5 kx
5 kx =over 4
5 kx
5 kx =item *
5 kx
5 kx C<installed into: /usr/share/perl5/vendor_perl>
5 kx
5 kx =item *
5 kx
5 kx C<LINKTYPE: dynamic>
5 kx
5 kx =item *
5 kx
5 kx C<VERSION: 1.00>
5 kx
5 kx =item *
5 kx
5 kx C<EXE_FILES: cyradm>
5 kx
5 kx =back
5 kx
5 kx =head2 Sat Nov 5 22:29:56 2022: C<Module> L<Cyrus::SIEVE::managesieve|Cyrus::SIEVE::managesieve>
5 kx
5 kx =over 4
5 kx
5 kx =item *
5 kx
5 kx C<installed into: /usr/share/perl5/vendor_perl>
5 kx
5 kx =item *
5 kx
5 kx C<LINKTYPE: dynamic>
5 kx
5 kx =item *
5 kx
5 kx C<VERSION: 0.01>
5 kx
5 kx =item *
5 kx
5 kx C<EXE_FILES: >
5 kx
5 kx =back
5 kx
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 /bin/true
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 $*