3 # (C) 2002-2003 Roland Rosenfeld <roland@debian.org>, based on
4 # Sample debian/rules that uses debhelper.
5 # This file is public domain software, originally written by Joey Hess.
7 # Uncomment this to turn on verbose mode.
10 # These are used for cross-compiling and for saving the configure script
11 # from having to guess our platform (since we know it already)
12 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
13 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15 DEBDIR=`pwd`/debian/privoxy
18 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24 configure: configure-stamp
30 env CFLAGS="$(OPTIMIZE) -g" \
31 ./configure --prefix=/usr --sysconfdir=/etc \
32 --mandir=/usr/share/man $(WITHDEBUG) \
33 --with-docbook=/usr/share/sgml/docbook/stylesheet/dsssl/modular
38 build-stamp: configure-stamp
41 # backup formatted upstream documentation:
42 for x in source text webserver pdf; do \
43 if [ ! -d doc/$$x.dist ]; then \
44 cp -a doc/$$x doc/$$x.dist; \
47 for x in INSTALL README AUTHORS privoxy.1; do \
48 if [ ! -f $$x.dist ]; then \
57 # remove trailing whitespaces:
58 for x in developer-manual user-manual faq; do \
59 sed -e 's/[ ]*$$//' < doc/text/$$x.txt > doc/text/$$x.nws;\
60 mv -f doc/text/$$x.nws doc/text/$$x.txt; \
68 rm -f build-stamp configure-stamp
72 rm -f privoxy privoxy.8
73 rm -f configure config.h GNUmakefile
76 rm -f ActivityConsole.jar
77 rm -f src/java/org/privoxy/activityconsole/*.class
79 # restore formatted upstream documentation:
80 for x in source text webserver pdf; do \
81 if [ -d doc/$$x.dist ]; then \
83 mv doc/$$x.dist doc/$$x; \
86 for x in INSTALL README AUTHORS privoxy.1; do \
87 if [ -f $$x.dist ]; then \
93 rm -f doc/source/ldp.dsl
103 install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
105 sed -e 's/^\(\(trust\|proxy\)-info-url\|admin-address\)/#\1/' \
106 -e 's/^\(enable-\(edit-actions\|remote-toggle\)\)[ ]*1/\1 0/' \
107 -e 's#^confdir .*#confdir /etc/privoxy#' \
108 -e 's#^logdir .*#logdir /var/log/privoxy#' \
109 -e 's%^#\(user-manual\).*%\1 /usr/share/doc/privoxy/user-manual%' \
110 -e 's/\(Sample Configuration File for Privoxy\).*/\1/' \
111 -e 's/Id: config,v.*/Id: config,v $$/' \
113 < config > $(DEBDIR)/etc/privoxy/config
114 install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
115 install -m 0644 standard.action $(DEBDIR)/etc/privoxy/standard.action
116 install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
117 install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
118 install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
120 sed -e 's/"1"/"8"/' < privoxy.1 > privoxy.8
122 cp -r templates $(DEBDIR)/etc/privoxy/
123 rm -f $(DEBDIR)/etc/privoxy/templates/*~
124 rm -rf $(DEBDIR)/etc/privoxy/templates/CVS
127 # Build architecture-independent files here.
128 binary-indep: build install
129 # We have nothing to do by default.
131 # Build architecture-dependent files here.
132 binary-arch: build install
137 (cd $(DEBDIR)/usr/share/doc/privoxy/; \
138 mv privoxy-index.html index.html)
150 dh_installchangelogs ChangeLog
163 binary: binary-indep binary-arch
164 .PHONY: build clean binary-indep binary-arch binary install configure