- rm -rf $(DEBDIR)/etc/privoxy/templates/CVS
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
-# dh_installdebconf
- dh_installdocs -XCVS
- dh_installexamples
- dh_installmenu
- dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
- dh_installinit
- dh_installcron
- dh_installman
- dh_installinfo
-# dh_undocumented
- dh_installchangelogs ChangeLog
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
-# dh_makeshlibs
- dh_installdeb
-# dh_perl
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-# Use this target on Debian because we need to make sure configure
-# was run with docbook's correct path (see configure-stamp above)
-debian-dok: configure-stamp
- $(MAKE) dok
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+
+# Remove trailing spaces from config files:
+ find $(DEBDIR)/etc/privoxy -type f \
+ | xargs grep -l ' $$' \
+ | while read f; do \
+ sed -e 's/ *$$//' < $$f > $$f.new; \
+ mv -f $$f.new $$f; \
+ done
+
+override_dh_install:
+ dh_install
+ install -m0644 debian/apparmor/usr.sbin.privoxy \
+ $(DEBDIR)/etc/apparmor.d/
+ dh_apparmor --profile-name=usr.sbin.privoxy
+
+override_dh_installdocs:
+ dh_installdocs
+ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
+ (cd $(DEBDIR)/usr/share/doc/privoxy/; \
+ mv privoxy-index.html index.html)
+ (cd $(DEBDIR)/usr/share/doc/privoxy/user-manual; ln -s '../p_doc.css')
+endif
+
+override_dh_perl:
+# We only need perl-base:
+ dh_perl -d
+
+override_dh_installsystemd:
+ dh_installsystemd
+ dh_installsystemd --name privoxy-cleanup