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