From 2572a7e51941751deca23d1e06b885dbd141230e Mon Sep 17 00:00:00 2001 From: Ivan Rako Date: Mon, 16 Jul 2018 15:48:06 +0200 Subject: [PATCH] prva verzija za stretch --- README.CARNet | 4 +- debian/changelog | 6 +++ debian/control | 10 ++-- debian/postinst | 139 ++++++++++++++++++++++---------------------------- debian/postrm | 30 +++++------ debian/preinst | 34 ++++++------ debian/prerm | 20 ++++---- debian/source/format | 1 - 8 files changed, 116 insertions(+), 128 deletions(-) delete mode 100644 debian/source/format diff --git a/README.CARNet b/README.CARNet index e47c68e..e132938 100644 --- a/README.CARNet +++ b/README.CARNet @@ -1,14 +1,14 @@ webalizer-cn ~~~~~~~~~~~~ -Webalizer stranicama mozete pristupiti na web adresi +Webalizer stranicama mozete pristupiti na web adresi: http://host.domena.hr/stats/ gdje je 'host' hostname posluzitelja na kojem je webalizer-cn paket instaliran, a 'domena.hr' domena Vase ustanove. -Pristup se postavlja pomocu 'htpasswd' alata. Datoteka koja +Pristup se postavlja pomocu alata 'htpasswd'. Datoteka koja sadrzi popis korisnika i zaporke nalazi se na lokaciji: /var/www/webalizer/.htpasswd diff --git a/debian/changelog b/debian/changelog index 0a8c584..afe55dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +webalizer-cn (1:2.23.08~cn0) stable; urgency=low + + * Prva verzija za stretch + + -- Ivan Rako Mon, 16 Jul 2018 15:47:47 +0200 + webalizer-cn (2.23.08+1) stable; urgency=low * Prva inacica paketa za Debian jessie distribuciju. diff --git a/debian/control b/debian/control index 4837bbd..c75105b 100644 --- a/debian/control +++ b/debian/control @@ -1,15 +1,15 @@ Source: webalizer-cn Priority: optional Section: web -Maintainer: Dragan Dosen -Build-Depends: debhelper (>> 9), apache2-dev (>= 2.4.10) -Standards-Version: 3.9.6 +Maintainer: Ivan Rako +Build-Depends: debhelper (>> 9), apache2-dev (>= 2.4.25) +Standards-Version: 3.9.8 Homepage: http://www.mrunix.net/webalizer/ Package: webalizer-cn Architecture: all -Pre-Depends: apache2-cn (>= 2.4.10+1) -Depends: webalizer (>= 2.23.08-1), makepasswd, carnet-tools-cn (>= 3.1.0), ${misc:Depends} +Pre-Depends: apache2-cn (>= 2.4.25-3) +Depends: webalizer (>= 2.23.08-1), makepasswd, carnet-tools-cn (>= 3.2.1), ${misc:Depends} Description: web server log analysis program The Webalizer was designed to scan web server log files in various formats and produce usage statistics in HTML format for viewing through a browser. diff --git a/debian/postinst b/debian/postinst index 9c07c04..0797f1f 100755 --- a/debian/postinst +++ b/debian/postinst @@ -3,28 +3,13 @@ set -e [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx +[ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx -case "$1" in - configure) - # continue below - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - exit 0 - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 0 - ;; -esac - - -# Load debconf +# Load Debconf . /usr/share/debconf/confmodule db_version 2.0 -# Include CARNet functions +# Include CARNet Tools . /usr/share/carnet-tools/functions.sh PKG="webalizer-cn" @@ -39,69 +24,67 @@ customized=0 if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then - . /usr/share/apache2/apache2-maintscript-helper + . /usr/share/apache2/apache2-maintscript-helper - webalizer_enable() { - cp_echo "CN: Enabling $PKG configuration for Apache2." - return 0 - } + webalizer_enable() { + cp_echo "CN: Enabling $PKG configuration for Apache2." + return 0 + } else - cp_echo "CN: Could not load Apache 2.4 maintainer script helper." + cp_echo "CN: Could not load Apache 2.4 maintainer script helper." - webalizer_enable() { - return 1 - } + webalizer_enable() { + return 1 + } fi webalizer_error() { - cp_echo "CN: Error while trying to enable $PKG configuration for Apache2." + cp_echo "CN: Error while trying to enable $PKG configuration for Apache2." } mv_conffile() { - local oldconffile="$1" - local newconffile="$2" + local oldconffile="$1" + local newconffile="$2" - rm -f $oldconffile.dpkg-remove - [ -e "$oldconffile" ] || return 0 + rm -f $oldconffile.dpkg-remove + [ -e "$oldconffile" ] || return 0 - cp_echo "CN: Preserving user changes to $newconffile (renamed from $oldconffile)." - mv -f "$newconffile" "$newconffile.dpkg-new" - mv -f "$oldconffile" "$newconffile" + cp_echo "CN: Preserving user changes to $newconffile (renamed from $oldconffile)." + mv -f "$newconffile" "$newconffile.dpkg-new" + mv -f "$oldconffile" "$newconffile" } -mv_conffile /etc/apache2/conf.d/$PKG.conf \ - /etc/apache2/conf-available/$PKG.conf +mv_conffile /etc/apache2/conf.d/$PKG.conf /etc/apache2/conf-available/$PKG.conf if [ -f "$WCONF" ]; then - - # Backup first. - if cp_check_and_backup "$WCONF"; then - cp_echo "CN: Old $WCONF saved as /var/backups/$WCONFBAK.bak." - fi - - # Check for OutputDir - temp=`awk 'tolower($1) == "outputdir" { print $2; }' $WCONF | tail -n 1` - if [ "$temp" != "$WDIR" ]; then - cp_echo "CN: Found custom OutputDir value: $temp" - db_set webalizer/directory "$temp" || true - customized=1 - fi - - # Check for ReportTitle - temp=`awk 'tolower($1) == "reporttitle" { for(i=2; i /dev/null - cp_echo "" - cp_echo "CN: Webalizer URL is http://`hostname -f`/stats/" - cp_echo "CN: User: admin" - cp_echo "CN: Password: $passwd" - cp_echo "" - cp_echo "CN: Use \"htpasswd -m $WHTPASSWD admin\" to change it." - else - cp_echo "CN: File $WHTPASSWD already exists." - fi + if [ ! -f "$WHTPASSWD" ]; then + passwd="$(makepasswd --chars 8)" + htpasswd -bcm $WHTPASSWD admin $passwd 2> /dev/null + cp_echo "" + cp_echo "CN: Webalizer URL is http://`hostname -f`/stats/" + cp_echo "CN: User: admin" + cp_echo "CN: Password: $passwd" + cp_echo "" + cp_echo "CN: Use \"htpasswd -m $WHTPASSWD admin\" to change it." + else + cp_echo "CN: File $WHTPASSWD already exists." + fi else - cp_echo "CN: Skipping file $WHTPASSWD" + cp_echo "CN: Skipping file $WHTPASSWD" fi #DEBHELPER# if ! apache2ctl configtest >/dev/null 2>&1; then - cp_echo "CN: Your Apache2 configuration seems to be broken." - cp_echo "CN: Please, check the service after the installation finishes!" + cp_echo "CN: Your Apache2 configuration seems to be broken." + cp_echo "CN: Please, check the service after the installation finishes!" fi # Mail root. diff --git a/debian/postrm b/debian/postrm index a447401..abf0d1f 100755 --- a/debian/postrm +++ b/debian/postrm @@ -5,31 +5,31 @@ set -e PKG="webalizer-cn" if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then - . /usr/share/apache2/apache2-maintscript-helper + . /usr/share/apache2/apache2-maintscript-helper - webalizer_enable() { - echo "CN: Purging $PKG configuration for Apache2." - return 0 - } + webalizer_enable() { + echo "CN: Purging $PKG configuration for Apache2." + return 0 + } else - echo "CN: Could not load Apache 2.4 maintainer script helper." + echo "CN: Could not load Apache 2.4 maintainer script helper." - webalizer_enable() { - return 1 - } + webalizer_enable() { + return 1 + } fi webalizer_error() { - echo "CN: Error while trying to purge $PKG configuration for Apache2." + echo "CN: Error while trying to purge $PKG configuration for Apache2." } if [ "$1" = "abort-install" ] || [ "$1" = "abort-upgrade" ]; then - conffile=/etc/apache2/conf.d/$PKG.conf + conffile=/etc/apache2/conf.d/$PKG.conf - if [ -e "$conffile.dpkg-remove" ]; then - echo "CN: Reinstalling $conffile that was moved away." - mv "$conffile.dpkg-remove" "$conffile" - fi + if [ -e "$conffile.dpkg-remove" ]; then + echo "CN: Reinstalling $conffile that was moved away." + mv "$conffile.dpkg-remove" "$conffile" + fi fi #DEBHELPER# diff --git a/debian/preinst b/debian/preinst index f54a70f..c0dd6ea 100755 --- a/debian/preinst +++ b/debian/preinst @@ -5,31 +5,31 @@ set -e PKG="webalizer-cn" prepare_mv_conffile() { - local conffile="$1" + local conffile="$1" - [ -e "$conffile" ] || return 0 + [ -e "$conffile" ] || return 0 - local md5sum="$(md5sum $conffile | sed -e 's/ .*//')" - local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKG | \ - sed -n -e "\' $conffile ' { s/ obsolete$//; s/.* //; p }")" + local md5sum="$(md5sum $conffile | sed -e 's/ .*//')" + local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKG | \ + sed -n -e "\' $conffile ' { s/ obsolete$//; s/.* //; p }")" - if [ "$md5sum" = "$old_md5sum" ]; then - mv -f "$conffile" "$conffile.dpkg-remove" - fi + if [ "$md5sum" = "$old_md5sum" ]; then + mv -f "$conffile" "$conffile.dpkg-remove" + fi } case "$1" in - install|upgrade) - prepare_mv_conffile /etc/apache2/conf.d/$PKG.conf - ;; + install|upgrade) + prepare_mv_conffile /etc/apache2/conf.d/$PKG.conf + ;; - abort-upgrade) - ;; + abort-upgrade) + ;; - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; esac #DEBHELPER# diff --git a/debian/prerm b/debian/prerm index c369827..ef570e4 100755 --- a/debian/prerm +++ b/debian/prerm @@ -5,22 +5,22 @@ set -e PKG="webalizer-cn" if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then - . /usr/share/apache2/apache2-maintscript-helper + . /usr/share/apache2/apache2-maintscript-helper - webalizer_enable() { - echo "CN: Disabling $PKG configuration for Apache2." - return 0 - } + webalizer_enable() { + echo "CN: Disabling $PKG configuration for Apache2." + return 0 + } else - echo "CN: Could not load Apache 2.4 maintainer script helper." + echo "CN: Could not load Apache 2.4 maintainer script helper." - webalizer_enable() { - return 1 - } + webalizer_enable() { + return 1 + } fi webalizer_error() { - echo "CN: Error while trying to disable $PKG configuration for Apache2." + echo "CN: Error while trying to disable $PKG configuration for Apache2." } #DEBHELPER# diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 89ae9db..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (native) -- 1.7.10.4