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