3 # (c) 2002-2021 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 --enable-extended-statistics \
27 --enable-pcre-host-patterns \
30 --with-docbook=/usr/share/sgml/docbook/stylesheet/dsssl/modular
32 override_dh_auto_build:
35 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
36 # preserve auto build documentation from source package:
37 tar cf debian/doc.tar README INSTALL AUTHORS doc/webserver privoxy.8
38 env -u LANG LC_ALL=C.UTF-8 $(MAKE) dok
39 rm -f doc/webserver/user-manual/*.bak
40 env -u LANG LC_ALL=C.UTF-8 $(MAKE) man
41 env -u LANG LC_ALL=C.UTF-8 $(MAKE) man2html
44 override_dh_auto_clean:
45 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
46 # restore auto build documentation from source package:
47 [ ! -f debian/doc.tar ] || tar xf debian/doc.tar
50 find doc/source -name \*.html | xargs -r rm -f
51 [ ! -f GNUmakefile ] || $(MAKE) clean
52 [ ! -f GNUmakefile ] || $(MAKE) distclean
53 rm -f configure config.h GNUmakefile
55 rm -f ActivityConsole.jar
56 rm -f src/java/org/privoxy/activityconsole/*.class
57 rm -f doc/source/ldp.dsl
58 rm -rf doc/source/temp
61 override_dh_auto_install:
62 install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
63 sed -e 's/\(Sample Configuration File for Privoxy\).*/\1/;' < config \
64 > $(DEBDIR)/usr/share/privoxy/config
65 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
68 # use remote user-manual (default) on nodoc configuration:
69 sed -i 's/^user-manual/#user-manual/' \
70 $(DEBDIR)/usr/share/privoxy/config
72 install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
73 install -m 0644 match-all.action $(DEBDIR)/etc/privoxy/match-all.action
74 install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
75 install -m 0644 regression-tests.action \
76 $(DEBDIR)/etc/privoxy/regression-tests.action
77 install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
78 install -m 0644 user.filter $(DEBDIR)/etc/privoxy/user.filter
79 install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
81 install -m 0755 tools/privoxy-log-parser.pl \
82 $(DEBDIR)/usr/bin/privoxy-log-parser
83 pod2man tools/privoxy-log-parser.pl \
84 > $(DEBDIR)/usr/share/man/man1/privoxy-log-parser.1
86 install -m 0755 tools/privoxy-regression-test.pl \
87 $(DEBDIR)/usr/bin/privoxy-regression-test
88 pod2man tools/privoxy-regression-test.pl \
89 > $(DEBDIR)/usr/share/man/man1/privoxy-regression-test.1
91 cp -r templates $(DEBDIR)/etc/privoxy/
92 rm -f $(DEBDIR)/etc/privoxy/templates/*~
94 # Remove trailing spaces from config files:
95 find $(DEBDIR)/etc/privoxy -type f \
96 | xargs grep -l ' $$' \
98 sed -e 's/ *$$//' < $$f > $$f.new; \
104 install -m0644 debian/apparmor/usr.sbin.privoxy \
105 $(DEBDIR)/etc/apparmor.d/
106 dh_apparmor --profile-name=usr.sbin.privoxy
108 override_dh_installdocs:
110 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
111 (cd $(DEBDIR)/usr/share/doc/privoxy/; \
112 mv privoxy-index.html index.html)
113 (cd $(DEBDIR)/usr/share/doc/privoxy/user-manual; ln -s '../p_doc.css')
117 # We only need perl-base: