2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
5 # Uncomment this to turn on verbose mode.
8 # These are used for cross-compiling and for saving the configure script
9 # from having to guess our platform (since we know it already)
10 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
11 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13 DEBDIR=`pwd`/debian/privoxy
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
22 configure: configure-stamp
28 env CFLAGS="$(OPTIMIZE) -g" \
29 ./configure --prefix=/usr --sysconfdir=/etc \
30 --mandir=/usr/share/man $(WITHDEBUG)
35 build-stamp: configure-stamp
40 # backup formatted upstream documentation:
41 for x in text webserver pdf; do \
42 if [ ! -d doc/$$x.dist ]; then \
43 cp -a doc/$$x doc/$$x.dist; \
46 for x in INSTALL README privoxy.1; do \
47 if [ ! -f $$x.dist ]; then \
52 (cd doc/source; $(MAKE) pdf)
53 (cd doc/source; $(MAKE) all)
60 rm -f build-stamp configure-stamp
65 rm -f configure config.h GNUmakefile
66 rm -f doc/source/ldp.dsl
68 rm -f ActivityConsole.jar
69 rm -f src/java/org/privoxy/activityconsole/*.class
71 # restore formatted upstream documentation:
72 for x in text webserver pdf; do \
73 if [ -d doc/$$x.dist ]; then \
75 mv doc/$$x.dist doc/$$x; \
78 for x in INSTALL README privoxy.1; do \
79 if [ -f $$x.dist ]; then \
93 install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
95 sed -e 's/^\(\(trust\|proxy\)-info-url\|admin-address\)/#\1/' \
96 -e 's/^\(enable-\(edit-actions\|remote-toggle\)\)[ ]*1/\1 0/' \
97 -e 's#^confdir .*#confdir /etc/privoxy#' \
98 -e 's#^logdir .*#logdir /var/log/privoxy#' \
99 -e 's%^#\(user-manual\).*%\1 /usr/share/doc/privoxy/user-manual%' \
100 -e 's/\(Sample Configuration File for Privoxy\).*/\1/' \
101 -e 's/Id: config,v.*/Id: config,v $$/' \
102 < config > $(DEBDIR)/etc/privoxy/config
103 install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
104 install -m 0644 standard.action $(DEBDIR)/etc/privoxy/standard.action
105 install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
106 install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
107 install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
109 cp -r templates $(DEBDIR)/etc/privoxy/
110 rm -f $(DEBDIR)/etc/privoxy/templates/*~
111 rm -rf $(DEBDIR)/etc/privoxy/templates/CVS
114 # Build architecture-independent files here.
115 binary-indep: build install
116 # We have nothing to do by default.
118 # Build architecture-dependent files here.
119 binary-arch: build install
124 (cd $(DEBDIR)/usr/share/doc/privoxy/; \
125 mv privoxy-index.html index.html)
137 dh_installchangelogs ChangeLog
150 binary: binary-indep binary-arch
151 .PHONY: build clean binary-indep binary-arch binary install configure