From: Ivan Rako Date: Fri, 22 Jul 2016 16:23:56 +0000 (+0200) Subject: izmjene za jessie X-Git-Tag: debian/3%2.10.1_cn0^0 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=3b7b43b4ebd18caed1d19c8583699dc73750b084;p=amavisd-cn.git izmjene za jessie --- diff --git a/README.CARNet b/README.CARNet index 7e1813e..fa98d34 100644 --- a/README.CARNet +++ b/README.CARNet @@ -33,7 +33,7 @@ amavisd-new se obavlja preko smtp protokola, u nacelu na nacin opisan u Ukoliko zelite zadrzati jednu datoteku za konfiguraciju kao sto je uobicajeno u upstream verziji, i u Debianu prije izdanja 4.0 / etch, - nemojte koristiti ovaj paket. Ukoliko je prije instalacije amavisd-cn + nemojte koristiti ovaj paket. Ukoliko je prije instalacije amavisd-cn postojala stara datoteka /etc/amavis/amavisd.conf @@ -55,11 +55,9 @@ amavisd-new se obavlja preko smtp protokola, u nacelu na nacin opisan u /usr/share/amavisd-cn/templates/40-carnet -- Stara skripta za restart svih kompomenti mta sustava (clamd + amavisd + - postfix) vise ne bi trebala biti potrebna, ali se jos uvijek moze - koristiti kao - - /etc/init.d/amavisd-cn restart +- Stara skripta za restart svih kompomenti mta sustava + /etc/init.d/amavisd-cn restart (clamd + amavisd + postfix) je izbacena + iz paketa. - Odrzavanje spamassassin bayesian filtera sada dolazi sa Debianovim paketom i nalazi se u @@ -91,4 +89,4 @@ amavisd-new se obavlja preko smtp protokola, u nacelu na nacin opisan u $virus_admin = "postmaster\@$mydomain"; - -- Ivan Rako Mon, 17 Feb 2014 20:23:17 +0100 + -- Ivan Rako Fri, 22 Jul 2016 18:07:10 +0200 diff --git a/debian/changelog b/debian/changelog index bcdffe5..20fa10b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +amavisd-cn (3:2.10.1~cn0) stable; urgency=low + + * Prva verzija za jessie + * Izbacen /etc/init.d/amavisd-cn, koristi se init.d skripte od + Debiana + + -- Ivan Rako Fri, 22 Jul 2016 17:44:38 +0200 + amavisd-cn (3:2.7.1~cn3) stable; urgency=low * Brisanje svih zaostataka starog crona /etc/cron.daily/amavisd-new diff --git a/debian/compat b/debian/compat index 45a4fb7..ec63514 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/debian/conffiles b/debian/conffiles deleted file mode 100644 index e69de29..0000000 diff --git a/debian/control b/debian/control index dca0587..81a78c0 100644 --- a/debian/control +++ b/debian/control @@ -3,13 +3,13 @@ Section: mail Priority: optional Maintainer: Ivan Rako Build-Depends: debhelper (>= 8) -Standards-Version: 3.9.3 +Standards-Version: 3.9.6 Package: amavisd-cn Architecture: all Provides: amavisd-new-cn -Depends: ${misc:Depends}, postfix, clamav-cn (>= 4:0.97), spamassassin-cn (>= 2:3.2.5-6), debianutils (>= 3.4), carnet-tools-cn (>= 2.8.1), procps, arj | unarj, rar | unrar | unrar-free, zoo, nomarch, cpio, lzop, cabextract, zip, unzip, bzip2 -Pre-Depends: amavisd-new (>= 1:2.7.1-2) +Depends: ${misc:Depends}, postfix, clamav-cn (>= 4:0.99), spamassassin-cn (>= 2:3.2.5-6), debianutils (>= 3.4), carnet-tools-cn (>= 2.8.1), procps, arj | unarj, rar | unrar | unrar-free, zoo, nomarch, cpio, lzop, cabextract, zip, unzip, bzip2 +Pre-Depends: amavisd-new (>= 1:2.10.1) Recommends: postfix-cn Conflicts: libsavi-perl (<< 0.15), bunch-perl-modules-cn Description: Easy setup for a postfix/amavisd-new/clamav/spamassassin configuration diff --git a/debian/init b/debian/init deleted file mode 100755 index 3f1b26a..0000000 --- a/debian/init +++ /dev/null @@ -1,167 +0,0 @@ -#!/bin/sh - -# amavisd-cn /etc/init.d/ initscript wrapper for CARNetized amavisd-new -# -# Start and stop Amavis, ClamAV and Postfix/Sendmail - -### BEGIN INIT INFO -# Provides: amavisd-cn -# Required-Start: $local_fs $remote_fs $syslog $named $network $time -# Required-Stop: $local_fs $remote_fs $syslog $named $network -# Should-Start: -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: start and stop Amavis, ClamAV and Postfix/Sendmail -# Description: wrapper for starting/stopping MTA and related services -### END INIT INFO - -set -e - -# options for daemons: -# name init.d/script user ps name for pgrep -f pidfile, relative to /var/run num-fds last-fd-name -options=' -clamd clamav-daemon clamav /usr/sbin/clamd clamav/clamd.pid 5 clamav.log -amavis amavis.amavisd-new amavis amavisd \\(master\\) amavis/amavisd.pid 5 socket -' -# note: pgrep -f takes a regexp, and this is shell expanded once, hence \\ - -start () { - local daemon IFSOLD name script user psname pidfile num fdname - daemon="$1" - IFSOLD="$IFS" - IFS=" " # tab - read name script user psname pidfile num fdname <<-EOPTS - $(echo "$options" | sed 's/ */ /g' | grep ^$daemon) - EOPTS - IFS="$IFSOLD" - /etc/init.d/$script start - wait_for_fds "$daemon" -} - -stop () { - local daemon IFSOLD name script user psname pidfile num fdname - daemon="$1" - n=10 - IFSOLD="$IFS" - IFS=" " # tab - read name script user psname pidfile num fdname <<-EOPTS - $(echo "$options" | sed 's/ */ /g' | grep ^$daemon) - EOPTS - IFS="$IFSOLD" - /etc/init.d/$script stop - pkill -u $user -f "$psname" > /dev/null || true - while pgrep -u $user -f "$psname" > /dev/null && [ "$n" -gt 0 ] - do - sleep 1 - n=$(($n-1)) - done - pkill -9 -u $user -f "$psname" > /dev/null || true - #pkill -9 -u $user -x "$daemon" - if pgrep -u $user -f "$psname" > /dev/null; then # still there? - return 1 - fi -} - -wait_for_fds () { - # wait until process shows some I/O readiness :) - local name IFSOLD num sleep maxtry script user psname pidfile fdname - name="$1" - [ -z "$name" ] && return 1 - IFSOLD="$IFS" - IFS=" " # tab - read name script user psname pidfile num fdname <<-EOPTS - $(echo "$options" | sed 's/ */ /g' | grep ^$name) - EOPTS - IFS="$IFSOLD" - num=${num:-4} - sleep=${sleep:-1} - maxtry=${maxtry:-90} - if [ -n "$pidfile" ]; then - pidfile=/var/run/$pidfile - findpid="[ -f $pidfile ] && cat $pidfile || true" - else - findpid="pgrep -u $user -f \"$psname\" -P 1 | head -1" - fi - - # loop the loop the loop - try=1 - while /bin/true - do - sleep $sleep # 1st, give it a chance to run - pid=`eval $findpid` # 2nd: find it - if [ ! -z "$pid" ]; then - count=`ls -1 /proc/$pid/fd 2>/dev/null| wc -l` # 3rd: count all it's worth - [ "$count" -ge "$num" ] && ls -l /proc/$pid/fd | grep -q $fdname \ - && return # success -- release - fi - try=$(($try+1)) - [ "0$try" -ge "0$maxtry" ] && return 1 # no luck this time - done -} - -# if we're called as amavisd-cn or amavis with start argument, -# act like one; otherwise, pass the call down -case "$(basename $0)" in - amavisd-cn) - arg="i$1" - ;; - amavis) - if [ "$1" = start ]; then - arg="i$1" - else - arg="$1" - fi - ;; - *) - arg="$1" - ;; -esac - -# If there's no diversion, play possum -[ -x /etc/init.d/amavis.amavisd-new ] || exit 0 - -mta=postfix - -case "$arg" in - start|stop|restart|reload|force-reload|debug) - /etc/init.d/amavis.amavisd-new "$arg" - ;; - - istart) - start clamd - start amavis - if [ -x "/etc/init.d/$mta" ]; then - if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d $mta start - else - /etc/init.d/$mta start - fi - fi - ;; - - istop) - if [ -x "/etc/init.d/$mta" ]; then - if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d $mta stop - else - /etc/init.d/$mta stop - fi - fi - stop amavis - stop clamd - ;; - - irestart|ireload|iforce-reload) - $0 stop - sleep 2 - $0 start - ;; - - *) - echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/debian/lintian-overrides b/debian/lintian-overrides index 83cd21d..a4d27ef 100644 --- a/debian/lintian-overrides +++ b/debian/lintian-overrides @@ -1,2 +1,4 @@ -amavisd-cn: postrm-contains-additional-updaterc.d-calls /etc/init.d/amavis -amavisd-cn: diversion-for-unknown-file etc/init.d/amavis preinst:24 +amavisd-cn: preinst-calls-updaterc.d amavis +amavisd-cn: postrm-does-not-call-updaterc.d-for-init.d-script etc/init.d/amavis +amavisd-cn: init.d-script-not-marked-as-conffile etc/init.d/amavis +amavisd-cn: init.d-script-not-included-in-package etc/init.d/amavis diff --git a/debian/postinst b/debian/postinst index 2f9959a..01c8da1 100755 --- a/debian/postinst +++ b/debian/postinst @@ -105,16 +105,6 @@ fi # Fix missing redirection in cron files for amavisd-new-cronjob add_redirection /etc/cron.d/amavisd-new -# Cleanup and finalization -if dpkg --compare-versions "$2" lt 2:20030616p10-4; then - update-rc.d -f amavisd remove > /dev/null - restart_daemon=1 - chown_ahome=1 - # a complicated way to say chmod 750 - dpkg-statoverride --remove $AHOME > /dev/null || true - dpkg-statoverride --update --add amavis amavis 750 $AHOME -fi - if [ -n "$chown_ahome" ]; then # might be slow echo -n "CN: Fixing ownership in /var/*/amavis... " @@ -123,72 +113,13 @@ if [ -n "$chown_ahome" ]; then cp_echo -mailonly "CN: Fixed ownerships in /var/*/amavis." fi -# kill naughty pyzor descendants -- XXX needed for 2.4 or not? -if dpkg --compare-versions "$2" lt 2:20030616p10-7 && \ - pgrep -u amavis -f '/usr/bin/pyzor check' > /dev/null; then - if [ -x "/etc/init.d/amavisd-cn" ]; then - if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d amavisd-cn stop - else - /etc/init.d/amavisd-cn stop - fi - fi - pkill -9 -u amavis -f '/usr/bin/pyzor check' > /dev/null || true - if [ -x "/etc/init.d/amavisd-cn" ]; then - if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d amavisd-cn start - else - /etc/init.d/amavisd-cn start - fi - fi - restart_daemon= - restart_mta= -fi - -# register for automatic start -update-rc.d -f amavis remove >/dev/null || true -update-rc.d amavisd-cn defaults 19 21 >/dev/null - -# START AMAVISD -# about a half of amavisd-cn script is here -#if [ "$restart_daemon" -a -x /etc/init.d/amavis.amavisd-new ]; then -# if [ -x "/etc/init.d/amavis.amavisd-new" ]; then -# if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then -# invoke-rc.d amavis.amavisd-new restart -# else -# /etc/init.d/amavis.amavisd-new restart -# fi -# fi -#fi -## always check that the daemons are running -#if ! wait_for_fds amavis; then -# if [ -x "/etc/init.d/amavis.amavisd-new" ]; then -# if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then -# invoke-rc.d amavis.amavisd-new start -# else -# /etc/init.d/amavis.amavisd-new start -# fi -# fi -# wait_for_fds amavis -#fi -#if [ "$restart_mta" ]; then -# if [ -x "/etc/init.d/$mta" ]; then -# if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then -# invoke-rc.d $mta restart -# else -# /etc/init.d/$mta restart -# fi -# fi -#fi - restart_daemon="1" - -if [ "$restart_daemon" -a -x /etc/init.d/amavisd-cn ]; then - if [ -x "/etc/init.d/amavisd-cn" ]; then +if [ "$restart_daemon" -a -x /etc/init.d/amavis ]; then + if [ -x "/etc/init.d/amavis" ]; then if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then - invoke-rc.d amavisd-cn restart + invoke-rc.d amavis restart else - /etc/init.d/amavisd-cn restart + /etc/init.d/amavis restart fi fi fi @@ -202,13 +133,7 @@ if dpkg --compare-versions "$2" lt "2:20030616p10-4"; then cp_echo "CN: Deleting virus-mail older than 7 days every day at 04:25 AM" cp_echo " (can be changed in $CRONTAB)" fi -# This script is, hopefully, not needed any more. Hide it. -## display this message just once... maybe use debconf instead -#if dpkg --compare-versions "$2" lt "2:20030616p10-4"; then -# cp_echo "" -# cp_echo "CN: To stop, start or restart all of the clamav+amavis+mta components," -# cp_echo "CN: use the /etc/init.d/amavisd-cn script." -#fi + if [ "$failed" ]; then cp_echo "" cp_echo "CN: Services $failed failed to restart!" diff --git a/debian/postrm b/debian/postrm index 21d308e..9a69787 100755 --- a/debian/postrm +++ b/debian/postrm @@ -17,19 +17,13 @@ set -e # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package -if [ "$1" = remove ]; then - rm -f /etc/init.d/amavis - dpkg-divert --quiet --package amavisd-cn --remove --rename \ - --divert /etc/init.d/amavis.amavisd-new /etc/init.d/amavis || true - update-rc.d amavis defaults 19 21 >/dev/null || true -fi - if [ "$1" = purge ]; then # REMOVING /var/lib/amavis/amavis* and /var/run/amavis # /var/run/amavis now deleted in /etc/init.d/amavisd # keeping virusmails until --purge is used rm -fr /var/lib/amavis/amavis* - update-rc.d amavisd-cn remove >/dev/null || true fi exit 0 + +#DEBHELPER# diff --git a/debian/preinst b/debian/preinst index 16a90a7..2e1f55a 100755 --- a/debian/preinst +++ b/debian/preinst @@ -13,28 +13,12 @@ set -e # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package -mv_init () { - echo -n " Renaming to /etc/init.d/amavis.dpkg-old... " - mv /etc/init.d/amavis /etc/init.d/amavis.dpkg-old - echo "done." -} - if [ "$1" = install -o "$1" = upgrade ]; then - dpkg-divert --quiet --package amavisd-cn --rename \ - --divert /etc/init.d/amavis.amavisd-new /etc/init.d/amavis - - # link not in package because woody's dpkg behaves strange when it is - if [ ! -h /etc/init.d/amavis ]; then - if [ -e /etc/init.d/amavis ]; then - echo "CN: Found unknown file at /etc/init.d/amavis." - mv_init - fi - #ln -s amavisd-cn /etc/init.d/amavis - elif ! readlink /etc/init.d/amavis | grep -q '^amavisd-cn$'; then - # Symlink in place, but does it point to us? - echo "CN: Shouldn't happen: found strange /etc/init.d/amavis link." - mv_init - #ln -s amavisd-cn /etc/init.d/amavis + if [ -L /etc/init.d/amavis -a -f /etc/init.d/amavis.amavisd-new ]; then + rm -f /etc/init.d/amavis + dpkg-divert --quiet --package amavisd-cn --remove --rename \ + --divert /etc/init.d/amavis.amavisd-new /etc/init.d/amavis || true + update-rc.d amavis defaults 19 21 >/dev/null || true fi fi diff --git a/debian/prerm b/debian/prerm index 9eb5a0d..4b4be03 100755 --- a/debian/prerm +++ b/debian/prerm @@ -36,8 +36,7 @@ if [ "$1" = remove ]; then cp-update -r $PKG $master_cf >&- del_postconf content_filter echo "Removed postfix configuration for ${PKG}." - if pgrep -u root -f /usr/lib/postfix/master >&- && \ - [ -x /etc/init.d/postfix ] >&- ; then + if [ -x /etc/init.d/postfix ]; then if [ -x /usr/sbin/invoke-rc.d ]; then invoke-rc.d postfix restart else diff --git a/debian/source.lintian-overrides b/debian/source.lintian-overrides deleted file mode 100644 index b2345de..0000000 --- a/debian/source.lintian-overrides +++ /dev/null @@ -1,2 +0,0 @@ -amavisd-cn source: maintainer-script-lacks-debhelper-token debian/postrm -amavisd-cn source: maintainer-script-lacks-debhelper-token debian/postinst diff --git a/src/postfixize.sh b/src/postfixize.sh index 2b01812..945413f 100755 --- a/src/postfixize.sh +++ b/src/postfixize.sh @@ -39,11 +39,11 @@ if [ ! -f $ACONF -o ! -s $ACONF ]; then fi # START AMAVISD -if [ "$restart_daemon" -a -x /etc/init.d/amavis.amavisd-new ]; then - /etc/init.d/amavis.amavisd-new restart +if [ "$restart_daemon" -a -x /etc/init.d/amavisd-new ]; then + /etc/init.d/amavisd-new restart fi # always check that the daemons are running if ! wait_for_fds amavis; then - /etc/init.d/amavis.amavisd-new start < /dev/null + /etc/init.d/amavisd-new start < /dev/null wait_for_fds amavis fi diff --git a/src/variables.sh b/src/variables.sh index 2149641..6d9c293 100644 --- a/src/variables.sh +++ b/src/variables.sh @@ -14,6 +14,6 @@ host=$(/bin/hostname -f) # name init.d/script user ps name for pgrep -f pidfile, relative to /var/run num-fds last-fd-name options=' clamd clamav-daemon clamav /usr/sbin/clamd clamav/clamd.pid 5 clamav.log -amavis amavis.amavisd-new amavis amavisd \\(master\\) amavis/amavisd.pid 5 socket +amavis amavisd-new amavis amavisd \\(master\\) amavis/amavisd.pid 5 socket ' # note: pgrep -f takes a regexp, and this is shell expanded once, hence \\ diff --git a/version.sh b/version.sh index 0b5c576..9be3ee6 100644 --- a/version.sh +++ b/version.sh @@ -1,3 +1,3 @@ -VERSION=2.7.1-1 +VERSION=2.10.1~cn0 POSTTMPLVERSION=3:2.4.2-1 MASTTMPLVERSION=3:2.4.2-1