
# - wheezy
apt-get install libgd2-xpm libgd2-xpm-dev libgd-tools
apt-get install libdb-dev libdb++-dev

#apt-get install libdb4.6 libdb4.6++ libdb4.6++-dev libdb4.6-dev

#apt-get install libgd-dev libgd-noxpm-dev libgd1-noxpm
#apt-get install libgd2-dev libgd2-noxpm libgd2-noxpm-dev libgd-tools
#apt-get install libdb4.2++ libdb4.2++-dev libdb4.2-dev
#apt-get install libdb2-util

# - jessie
## -
apt-get install libgd2-xpm-dev libgd-tools
apt-get install libdb-dev libdb++-dev

# -  Preparations
# -
mkdir -p /usr/local/src/webalizer
cd /usr/local/src/webalizer

# - Download
# - 
wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.23-08-src.tgz 

# - Unpack
# -
gunzip < webalizer-2.23-08-src.tgz | tar -xf -

cd webalizer-2.23-08

# - Configure
# -
#./configure  --prefix=/usr/local/webalizer-2.23-08 --with-etcdir=/usr/local/webalizer-2.23-08/etc --with-language=german --enable-dns --with-db=/usr/include --with-dblib=/usr/lib

LDFLAGS="-s" \
./configure  --prefix=/usr/local/webalizer-2.23-08 \
   --with-language=german \
   --enable-dns \
   --enable-geoip \
   --with-db=/usr/include \
   --with-dblib=/usr/lib

# - Make
# -
make

# - Install
# -
make install


# -Bemerkung: das Manpage-Verzeichns wird fälschlicherweise im root Verzeichnis
# -           angelegt.
# -           # mv /man /usrLocal/webalizer-2.23-08/
mv /man /usr/local/webalizer-2.23-08/


# - !! Don't forget to generate statistics !!
# -
# - Add to '/etc/logrotate.d/apache2' at end of section 'postrotate':
# -
# -    postrotate
# -       ...
# -       if [[ -x "/root/bin/webalizer/generate_webstats.sh" ]]; then
# -          ps ax > /tmp/ps_ax_logrotate_apache2.log
# -          /root/bin/webalizer/generate_webstats.sh
# -       fi
# - 
# -    endscript
