3 # (c) 2002-2018 Roland Rosenfeld <roland@debian.org>
5 # Uncomment this to turn on verbose mode.
9 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
11 DEBDIR=`pwd`/debian/privoxy
16 override_dh_auto_configure:
19 dh_auto_configure -- \
22 --mandir=/usr/share/man \
25 --enable-external-filters \
26 --with-docbook=/usr/share/sgml/docbook/stylesheet/dsssl/modular
28 override_dh_auto_build:
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
36 override_dh_auto_clean:
37 # restore auto build documentation from source package:
38 [ ! -f debian/doc.tar ] || tar xf 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
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
52 override_dh_auto_install:
53 install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
54 sed -e 's/\(Sample Configuration File for Privoxy\).*/\1/;' < config \
55 > $(DEBDIR)/usr/share/privoxy/config
56 install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
57 install -m 0644 match-all.action $(DEBDIR)/etc/privoxy/match-all.action
58 install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
59 install -m 0644 regression-tests.action \
60 $(DEBDIR)/etc/privoxy/regression-tests.action
61 install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
62 install -m 0644 user.filter $(DEBDIR)/etc/privoxy/user.filter
63 install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
65 install -m 0755 tools/privoxy-log-parser.pl \
66 $(DEBDIR)/usr/bin/privoxy-log-parser
67 pod2man tools/privoxy-log-parser.pl \
68 > $(DEBDIR)/usr/share/man/man1/privoxy-log-parser.1
70 install -m 0755 tools/privoxy-regression-test.pl \
71 $(DEBDIR)/usr/bin/privoxy-regression-test
72 pod2man tools/privoxy-regression-test.pl \
73 > $(DEBDIR)/usr/share/man/man1/privoxy-regression-test.1
75 cp -r templates $(DEBDIR)/etc/privoxy/
76 rm -f $(DEBDIR)/etc/privoxy/templates/*~
78 # Remove trailing spaces from config files:
79 find $(DEBDIR)/etc/privoxy -type f \
80 | xargs grep -l ' $$' \
82 sed -e 's/ *$$//' < $$f > $$f.new; \
86 override_dh_installdocs:
88 (cd $(DEBDIR)/usr/share/doc/privoxy/; \
89 mv privoxy-index.html index.html)
90 (cd $(DEBDIR)/usr/share/doc/privoxy/user-manual; ln -s '../p_doc.css')
93 # We only need perl-base: