3 # (c) 2002-2020 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 \
28 --with-docbook=/usr/share/sgml/docbook/stylesheet/dsssl/modular
30 override_dh_auto_build:
32 # preserve auto build documentation from source package:
33 tar cf debian/doc.tar README INSTALL AUTHORS doc/source doc/webserver
34 env -u LANG LC_ALL=C.UTF-8 $(MAKE) dok
35 rm -f doc/webserver/user-manual/*.bak
36 env -u LANG LC_ALL=C.UTF-8 $(MAKE) man
37 env -u LANG LC_ALL=C.UTF-8 $(MAKE) man2html
39 override_dh_auto_clean:
40 # restore auto build documentation from source package:
41 [ ! -f debian/doc.tar ] || tar xf debian/doc.tar
43 find doc/source -name \*.html | xargs -r rm -f
44 [ ! -f GNUmakefile ] || $(MAKE) clean
45 [ ! -f GNUmakefile ] || $(MAKE) distclean
46 rm -f configure config.h GNUmakefile
49 rm -f ActivityConsole.jar
50 rm -f src/java/org/privoxy/activityconsole/*.class
51 rm -f doc/source/ldp.dsl
52 rm -rf doc/source/temp
53 dh_clean -Xrc.privoxy.orig
55 override_dh_auto_install:
56 install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
57 sed -e 's/\(Sample Configuration File for Privoxy\).*/\1/;' < config \
58 > $(DEBDIR)/usr/share/privoxy/config
59 install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
60 install -m 0644 match-all.action $(DEBDIR)/etc/privoxy/match-all.action
61 install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
62 install -m 0644 regression-tests.action \
63 $(DEBDIR)/etc/privoxy/regression-tests.action
64 install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
65 install -m 0644 user.filter $(DEBDIR)/etc/privoxy/user.filter
66 install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
68 install -m 0755 tools/privoxy-log-parser.pl \
69 $(DEBDIR)/usr/bin/privoxy-log-parser
70 pod2man tools/privoxy-log-parser.pl \
71 > $(DEBDIR)/usr/share/man/man1/privoxy-log-parser.1
73 install -m 0755 tools/privoxy-regression-test.pl \
74 $(DEBDIR)/usr/bin/privoxy-regression-test
75 pod2man tools/privoxy-regression-test.pl \
76 > $(DEBDIR)/usr/share/man/man1/privoxy-regression-test.1
78 cp -r templates $(DEBDIR)/etc/privoxy/
79 rm -f $(DEBDIR)/etc/privoxy/templates/*~
81 # Remove trailing spaces from config files:
82 find $(DEBDIR)/etc/privoxy -type f \
83 | xargs grep -l ' $$' \
85 sed -e 's/ *$$//' < $$f > $$f.new; \
89 override_dh_installdocs:
91 (cd $(DEBDIR)/usr/share/doc/privoxy/; \
92 mv privoxy-index.html index.html)
93 (cd $(DEBDIR)/usr/share/doc/privoxy/user-manual; ln -s '../p_doc.css')
96 # We only need perl-base: