Add all Debian changes from 3.0.19-2 to 3.0.24-1
[privoxy.git] / debian / rules
1 #!/usr/bin/make -f
2 #
3 # (c) 2002-2015 Roland Rosenfeld <roland@debian.org>
4 #
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
7 #export DH_OPTIONS=-v
8
9 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
10
11 DEBDIR=`pwd`/debian/privoxy
12
13 %:
14         dh $@ --with autotools_dev --with systemd
15
16 override_dh_auto_configure:
17         autoheader
18         autoconf
19         dh_auto_configure -- \
20                 --prefix=/usr \
21                 --sysconfdir=/etc \
22                 --mandir=/usr/share/man \
23                 --enable-zlib \
24                 --enable-no-gifs \
25                 --enable-external-filters \
26                 --with-docbook=/usr/share/sgml/docbook/stylesheet/dsssl/modular
27
28 override_dh_auto_build:
29         $(MAKE)
30 #       preserve auto build documentation from source package:
31         tar cf debian/doc.tar README INSTALL AUTHORS doc/source doc/webserver
32         env -u LANG LC_ALL=C.UTF-8 $(MAKE) dok
33         rm -f doc/webserver/user-manual/*.bak
34         env -u LANG LC_ALL=C.UTF-8 $(MAKE) man
35
36 override_dh_auto_clean:
37 #       restore auto build documentation from source package:
38         [ ! -f debian/doc.tar ] || tar xf debian/doc.tar
39         rm -f debian/doc.tar
40         find doc/source -name \*.html | xargs -r rm -f
41         [ ! -f GNUmakefile ] || $(MAKE) clean
42         [ ! -f GNUmakefile ] || $(MAKE) distclean
43         rm -f configure config.h GNUmakefile
44         rm -f privoxy.8
45         rm -rf obj
46         rm -f ActivityConsole.jar
47         rm -f src/java/org/privoxy/activityconsole/*.class
48         rm -f doc/source/ldp.dsl
49         rm -rf doc/source/temp
50         dh_clean -Xrc.privoxy.orig
51
52 override_dh_auto_install:
53         install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
54         install -m 644 config $(DEBDIR)/etc/privoxy/config
55         install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
56         install -m 0644 match-all.action $(DEBDIR)/etc/privoxy/match-all.action
57         install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
58         install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
59         install -m 0644 user.filter $(DEBDIR)/etc/privoxy/user.filter
60         install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
61
62         install -m 0755 tools/privoxy-log-parser.pl \
63                 $(DEBDIR)/usr/bin/privoxy-log-parser
64         pod2man tools/privoxy-log-parser.pl \
65                 > $(DEBDIR)/usr/share/man/man1/privoxy-log-parser.1
66
67         cp -r templates $(DEBDIR)/etc/privoxy/
68         rm -f $(DEBDIR)/etc/privoxy/templates/*~
69         rm -rf $(DEBDIR)/etc/privoxy/templates/CVS
70
71 #       Remove CVS tags and trailing spaces from config files:
72         find $(DEBDIR)/etc/privoxy -type f \
73         | xargs grep -l '\$$[A-Z][^$$]*:[^$$]*\$$' \
74         | while read f; do \
75             sed -e 's/\$$\(Id: [^$$]*,v\)[^$$]*\$$/\1/' \
76                 -e 's/\$$\(Source: [^$$]*\)\$$/\1/' \
77                 -e 's/\$$\(Log: [^$$]*\)\$$/\1/' \
78                 -e 's/ *$$//' < $$f > $$f.new; \
79             mv -f $$f.new $$f; \
80         done
81
82 override_dh_installdocs:
83         dh_installdocs -XCVS
84         (cd $(DEBDIR)/usr/share/doc/privoxy/; \
85          mv privoxy-index.html index.html)
86
87 override_dh_perl:
88 #       We only need perl-base:
89         dh_perl -d