~ubuntu-branches/ubuntu/vivid/awstats/vivid

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Sergey B Kirpichev
  • Date: 2013-10-07 20:43:11 UTC
  • Revision ID: package-import@ubuntu.com-20131007204311-gv80anlpgdatflla
Tags: 7.1.1~dfsg-2
* Remove unsupported copyright_hints (autogenerated)
* Use patch (not perl) to apply Debian-specific configuration changes
* Add debian/awstats.examples
* Drop absoleted binary-post-install/awstats target
* drop binary-fixup target
* Add patch with build.xml
* Drop obsoleted control.in
* Transition to dh build system, drop CDBS dependence
* Override dh_compress
* Fix permissions on doc/awstats/examples/*.pl

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
 
# -*- mode: makefile; coding: utf-8 -*-
3
 
# Copyright © 2003-2010 Jonas Smedegaard <dr@jones.dk>
4
 
# Description: Main Debian packaging script for AWStats
5
 
#
6
 
# This program is free software; you can redistribute it and/or
7
 
# modify it under the terms of the GNU General Public License as
8
 
# published by the Free Software Foundation; either version 2, or (at
9
 
# your option) any later version.
10
 
#
11
 
# This program is distributed in the hope that it will be useful, but
12
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
# General Public License for more details.
15
 
#
16
 
# You should have received a copy of the GNU General Public License
17
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 
 
19
 
include /usr/share/cdbs/1/rules/upstream-tarball.mk
20
 
include /usr/share/cdbs/1/rules/utils.mk
21
 
include /usr/share/cdbs/1/class/ant.mk
22
 
include /usr/share/cdbs/1/rules/debhelper.mk
23
 
 
24
 
DEB_UPSTREAM_URL = http://prdownloads.sourceforge.net/awstats
25
 
DEB_UPSTREAM_TARBALL_BASENAME_MANGLE = s/(-7\.1)\.(\d)/$$1$$2/
26
 
DEB_UPSTREAM_TARBALL_MD5 = 9ee8cb9c89295a519638ae1cf6a4e1e2
27
 
 
28
 
DEB_UPSTREAM_REPACKAGE_EXCLUDE = wwwroot/icon/browser/firefox.png
29
 
 
30
 
DEB_INSTALL_CHANGELOGS_ALL = docs/awstats_changelog.txt
31
 
DEB_INSTALL_DOCS_ALL = README.TXT
32
 
 
33
 
awstats_example_scripts = $(filter-out %/logresolvemerge.pl %/awstats_buildstaticpages.pl,$(wildcard tools/*.pl)) $(wildcard debian/examples/*.sh)
34
 
 
35
 
DEB_INSTALL_EXAMPLES_awstats = $(awstats_example_scripts) debian/examples/apache.conf wwwroot/cgi-bin/awstats.model.conf wwwroot/cgi-bin/plugins/example/* wwwroot/css wwwroot/js tools/xslt
36
 
DEB_COMPRESS_EXCLUDE = $(notdir $(awstats_example_scripts)) awstats.ico
37
 
 
38
 
JAVA_HOME = /usr/lib/jvm/default-java
39
 
DEB_ANT_BUILDFILE = debian/build.xml
40
 
DEB_ANT_BUILD_TARGET = bin-jar
41
 
DEB_ANT_ARGS = -Dpackage=awgraphapplet -Dversion=$(DEB_NOEPOCH_VERSION)
42
 
 
43
 
# Adjust for Debian (and cleanup) main config file
44
 
common-configure-indep::
45
 
        # Use perl rather than a diff here, to make sure all relevant
46
 
        # options are checked (upstream defaults have moved around in
47
 
        # the past)
48
 
# Perl in shell in make requires extra care:
49
 
#  * Single-quoting ('...') protects against shell expansion
50
 
#  * Double-dollar ($$) expands to plain dollar ($) in make
51
 
        perl -wp \
52
 
                -e 's,^(LogFile\s*=\s*).*,$$1"/var/log/apache2/access.log",;' \
53
 
                -e 's,^(DirData\s*=\s*).*,$$1"/var/lib/awstats",;' \
54
 
                -e 's,^(LogFormat\s*=\s*).*,$${1}4,;' \
55
 
                -e 's,^(DNSLookup\s*=\s*).*,$${1}1,;' \
56
 
                -e 's,^(DirIcons\s*=\s*).*,$$1"/awstats-icon",;' \
57
 
                -e 's,^(HostAliases\s*=\s*).*,$$1"localhost 127.0.0.1",;' \
58
 
                -e 's,^(DirLang\s*=\s*).*,$$1"/usr/share/awstats/lang",;' \
59
 
                -e 's,^#(LoadPlugin\s*=\s*"hashfiles"),$$1,;' \
60
 
                -e 's,^#(Include\s*)"",$$1"/etc/awstats/awstats.conf.local",;' \
61
 
                -e 's,^(#LoadPlugin\s*=\s*"geoip\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIP.dat",;' \
62
 
                -e 's,^(#LoadPlugin\s*=\s*"geoip_region_maxmind\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIPRegion.dat",;' \
63
 
                -e 's,^(#LoadPlugin\s*=\s*"geoip_city_maxmind\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIPCity.dat",;' \
64
 
                -e 's,^(#LoadPlugin\s*=\s*"geoip_isp_maxmind\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIPISP.dat",;' \
65
 
                -e 's,^(#LoadPlugin\s*=\s*"geoip_org_maxmind\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIPOrg.dat",;' \
66
 
                < wwwroot/cgi-bin/awstats.model.conf > debian/awstats.conf
67
 
clean::
68
 
        rm -f debian/awstats.conf
69
 
 
70
 
# Install (and cleanup) java applet
71
 
# TODO: use DEB_DH_INSTALL_ARGS_awstats when some day implemented in CDBS
72
 
DEB_DH_LINK_awstats = usr/share/java/awstats/awgraphapplet$(DEB_NOEPOCH_VERSION).jar usr/share/java/awstats/awgraphapplet.jar
73
 
binary-install/awstats:: DEB_DH_INSTALL_ARGS = wwwroot/classes/awgraphapplet$(DEB_NOEPOCH_VERSION).jar usr/share/java/awstats/
74
 
clean::
75
 
        rm -f wwwroot/classes/awgraphapplet?*.jar
76
 
 
77
 
# Remove badly coded PDF and superfluous GPL license texts
78
 
binary-post-install/awstats::
79
 
        find $(DEB_DESTDIR) -type f \
80
 
                \( -name '*.pdf' -o -name COPYING.TXT -o -name LICENSE.TXT \) \
81
 
                -exec rm '{}' +
82
 
 
83
 
# Set scripts executable - and unset other files
84
 
binary-fixup/awstats::
85
 
        find $(DEB_DESTDIR)/usr/share/awstats -type f  -exec chmod -x '{}' +
86
 
        find $(DEB_DESTDIR)/usr/share/awstats/tools $(DEB_DESTDIR)/usr/share/doc/awstats/examples \
87
 
                \( -name '*.pl' -o -name '*.sh' \) -exec chmod +x '{}' +
88
 
        find $(DEB_DESTDIR)/usr/share/doc/awstats/examples \
89
 
                \( -name '*.css' -o -name '*.xsd' -o -name '*.txt' -o -name '*.xslt' -o -name '*.js' \) \
90
 
                -exec chmod -x '{}' +
91
 
        chmod +x $(DEB_DESTDIR)/usr/lib/cgi-bin/awstats.pl
92
 
 
93
 
# Needed (often/sometimes) at runtime
94
 
# * Recent coreutils needed for cron scripts (doing mktemp --tmpdir)
95
 
CDBS_RECOMMENDS := libnet-xwhois-perl, coreutils (>= 7.4)
96
 
CDBS_SUGGESTS := apache2 | httpd, libnet-dns-perl, libnet-ip-perl, libgeo-ipfree-perl, liburi-perl
97
 
 
98
 
# Needed by upstream build process
99
 
CDBS_BUILD_DEPENDS += , ant, default-jdk
100
 
 
101
 
# Needed for our packaging
102
 
CDBS_BUILD_DEPENDS += , sharutils
 
2
 
 
3
DEB_VERSION := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
 
4
 
 
5
%:
 
6
        dh $@
 
7
 
 
8
override_dh_installchangelogs:
 
9
        dh_installchangelogs docs/awstats_changelog.txt
 
10
 
 
11
override_dh_auto_install:
 
12
        dh_auto_install
 
13
        dh_install \
 
14
                wwwroot/classes/awgraphapplet-$(DEB_VERSION).jar \
 
15
                usr/share/java/awstats/
 
16
        cp wwwroot/cgi-bin/awstats.model.conf debian/awstats/etc/awstats/awstats.conf
 
17
 
 
18
override_dh_link:
 
19
        dh_link
 
20
        dh_link \
 
21
                usr/share/java/awstats/awgraphapplet-$(DEB_VERSION).jar \
 
22
                usr/share/java/awstats/awgraphapplet.jar
 
23
 
 
24
override_dh_compress:
 
25
        dh_compress -X.sh -X.pl -X.ico
 
26
 
 
27
override_dh_fixperms:
 
28
        dh_fixperms
 
29
        chmod +x debian/awstats/usr/share/doc/awstats/examples/*.pl
 
30
        chmod +x debian/awstats/usr/share/doc/awstats/examples/*.sh
 
31
 
 
32
override_dh_auto_build:
 
33
        dh_auto_build \
 
34
                --buildsystem=ant \
 
35
                --sourcedirectory=wwwroot/classes -- \
 
36
                -Dversion=$(DEB_VERSION) bin-jar
 
37
 
 
38
override_dh_auto_clean:
 
39
        -dh_auto_clean \
 
40
                --buildsystem=ant \
 
41
                --sourcedirectory=wwwroot/classes -- \
 
42
                -Dversion=$(DEB_VERSION)