-# 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
+# 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