izmjene za jessie debian/3%2.10.1_cn0
authorIvan Rako <irako@nekkar.carnet.hr>
Fri, 22 Jul 2016 16:23:56 +0000 (18:23 +0200)
committerIvan Rako <irako@nekkar.carnet.hr>
Fri, 22 Jul 2016 16:23:56 +0000 (18:23 +0200)
15 files changed:
README.CARNet
debian/changelog
debian/compat
debian/conffiles [deleted file]
debian/control
debian/init [deleted file]
debian/lintian-overrides
debian/postinst
debian/postrm
debian/preinst
debian/prerm
debian/source.lintian-overrides [deleted file]
src/postfixize.sh
src/variables.sh
version.sh

index 7e1813e..fa98d34 100644 (file)
@@ -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 <Ivan.Rako@CARNet.hr>  Mon, 17 Feb 2014 20:23:17 +0100
+ -- Ivan Rako <Ivan.Rako@CARNet.hr>  Fri, 22 Jul 2016 18:07:10 +0200
index bcdffe5..20fa10b 100644 (file)
@@ -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 <Ivan.Rako@CARNet.hr>  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
index 45a4fb7..ec63514 100644 (file)
@@ -1 +1 @@
-8
+9
diff --git a/debian/conffiles b/debian/conffiles
deleted file mode 100644 (file)
index e69de29..0000000
index dca0587..81a78c0 100644 (file)
@@ -3,13 +3,13 @@ Section: mail
 Priority: optional
 Maintainer: Ivan Rako <Ivan.Rako@CARNet.hr>
 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 (executable)
index 3f1b26a..0000000
+++ /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
index 83cd21d..a4d27ef 100644 (file)
@@ -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
index 2f9959a..01c8da1 100755 (executable)
@@ -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!"
index 21d308e..9a69787 100755 (executable)
@@ -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#
index 16a90a7..2e1f55a 100755 (executable)
@@ -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
 
index 9eb5a0d..4b4be03 100755 (executable)
@@ -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 (file)
index b2345de..0000000
+++ /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
index 2b01812..945413f 100755 (executable)
@@ -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
index 2149641..6d9c293 100644 (file)
@@ -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 \\
index 0b5c576..9be3ee6 100644 (file)
@@ -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