Disable fast-redirects for .gravater.com/
[privoxy.git] / debian / rules
1 #!/usr/bin/make -f
2 #
3 # (c) 2002-2021 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 $@
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                 --enable-extended-statistics \
27                 --enable-pcre-host-patterns \
28                 --with-mbedtls \
29                 --with-brotli \
30                 --with-docbook=/usr/share/sgml/docbook/stylesheet/dsssl/modular
31
32 override_dh_auto_build:
33         $(MAKE)
34 #       preserve auto build documentation from source package:
35         tar cf debian/doc.tar README INSTALL AUTHORS doc/source doc/webserver
36         env -u LANG LC_ALL=C.UTF-8 $(MAKE) dok
37         rm -f doc/webserver/user-manual/*.bak
38         env -u LANG LC_ALL=C.UTF-8 $(MAKE) man
39         env -u LANG LC_ALL=C.UTF-8 $(MAKE) man2html
40
41 override_dh_auto_clean:
42 #       restore auto build documentation from source package:
43         [ ! -f debian/doc.tar ] || tar xf debian/doc.tar
44         rm -f debian/doc.tar
45         find doc/source -name \*.html | xargs -r rm -f
46         [ ! -f GNUmakefile ] || $(MAKE) clean
47         [ ! -f GNUmakefile ] || $(MAKE) distclean
48         rm -f configure config.h GNUmakefile
49         rm -f privoxy.8
50         rm -rf obj
51         rm -f ActivityConsole.jar
52         rm -f src/java/org/privoxy/activityconsole/*.class
53         rm -f doc/source/ldp.dsl
54         rm -rf doc/source/temp
55         dh_clean -Xrc.privoxy.orig
56
57 override_dh_auto_install:
58         install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
59         sed -e 's/\(Sample Configuration File for Privoxy\).*/\1/;' < config \
60             > $(DEBDIR)/usr/share/privoxy/config
61         install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
62         install -m 0644 match-all.action $(DEBDIR)/etc/privoxy/match-all.action
63         install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
64         install -m 0644 regression-tests.action \
65                 $(DEBDIR)/etc/privoxy/regression-tests.action
66         install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
67         install -m 0644 user.filter $(DEBDIR)/etc/privoxy/user.filter
68         install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
69
70         install -m 0755 tools/privoxy-log-parser.pl \
71                 $(DEBDIR)/usr/bin/privoxy-log-parser
72         pod2man tools/privoxy-log-parser.pl \
73                 > $(DEBDIR)/usr/share/man/man1/privoxy-log-parser.1
74
75         install -m 0755 tools/privoxy-regression-test.pl \
76                 $(DEBDIR)/usr/bin/privoxy-regression-test
77         pod2man tools/privoxy-regression-test.pl \
78                 > $(DEBDIR)/usr/share/man/man1/privoxy-regression-test.1
79
80         cp -r templates $(DEBDIR)/etc/privoxy/
81         rm -f $(DEBDIR)/etc/privoxy/templates/*~
82
83 #      Remove trailing spaces from config files:
84         find $(DEBDIR)/etc/privoxy -type f \
85         | xargs grep -l ' $$' \
86         | while read f; do \
87             sed -e 's/  *$$//' < $$f > $$f.new; \
88             mv -f $$f.new $$f; \
89         done
90
91 override_dh_install:
92         dh_install
93         install -m0644 debian/apparmor/usr.sbin.privoxy \
94                 $(DEBDIR)/etc/apparmor.d/
95         dh_apparmor --profile-name=usr.sbin.privoxy
96
97 override_dh_installdocs:
98         dh_installdocs
99         (cd $(DEBDIR)/usr/share/doc/privoxy/; \
100          mv privoxy-index.html index.html)
101         (cd $(DEBDIR)/usr/share/doc/privoxy/user-manual; ln -s '../p_doc.css')
102
103 override_dh_perl:
104 #       We only need perl-base:
105         dh_perl -d