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