2
# -*- mode: makefile; coding: utf-8 -*-
3
# Copyright © 2003 Jonas Smedegaard <dr@jones.dk>
5
include /usr/share/cdbs/1/rules/debhelper.mk
7
DEB_INSTALL_CHANGELOGS_ALL = docs/awstats_changelog.txt
8
DEB_INSTALL_DOCS_ALL = README.TXT
10
awstats_example_scripts = $(wildcard tools/*.pl) $(debian/examples/*.sh) debian/examples/awstats-update
12
DEB_INSTALL_EXAMPLES_awstats = $(awstats_example_scripts) debian/examples/awstats-update.8 wwwroot/cgi-bin/awstats.model.conf wwwroot/cgi-bin/plugins/example/* wwwroot/css wwwroot/js
13
DEB_COMPRESS_EXCLUDE = $(notdir $(awstats_example_scripts)) awstats.ico
16
# Use sed rather than a diff here, to make sure all relevant
17
# options are checked (upstream defaults have moved around in
20
-e 's!^\(LogFile *= *\).*!\1"/var/log/apache/access.log"!g' \
21
-e 's!^\(DirData *= *\).*!\1"/var/lib/awstats"!g' \
22
-e 's!^\(LogFormat *= *\).*!\14!g' \
23
-e 's!^\(DNSLookup *= *\).*!\11!g' \
24
-e 's!^\(DirIcons *= *\).*!\1"/awstats-icon"!g' \
25
-e 's!^\(HostAliases *= *\).*!\1"localhost 127\.0\.0\.1"!g' \
26
-e 's!^\(DirLang *= *\).*!\1"/usr/share/awstats/lang"!g' \
27
-e 's!^#\(LoadPlugin *= *"hashfiles"\)!\1!' \
28
-e 's!^#\(Include *\)""!\1"/etc/awstats/awstats.conf.local"!' \
29
wwwroot/cgi-bin/awstats.model.conf > debian/awstats.conf
32
rm -f debian/awstats.conf
34
binary-post-install/awstats::
36
find $(DEB_DESTDIR) -type f -name *.gif | xargs -r rm
38
# Remove badly coded PDF
39
find $(DEB_DESTDIR) -type f -name *.pdf | xargs -r rm
41
# Debian stores the GPL at one single spot
42
find $(DEB_DESTDIR) -name COPYING.TXT -o -name LICENSE.TXT | xargs -r rm
44
binary-fixup/awstats::
45
find $(DEB_DESTDIR)/usr/share/awstats -type f | xargs -r chmod -x
46
find $(DEB_DESTDIR)/usr/share/doc/awstats/examples -name *.pl -o -name *.sh | xargs -r chmod +x
47
chmod +x $(addprefix $(DEB_DESTDIR)/usr/share/doc/awstats/examples/,$(notdir $(awstats_example_scripts)))
49
binary-predep/awstats::
50
dh_perl -p$(DEB_CURPACKAGE)