Just moved "int i" up 3 lines in function unload_configfile, out of the "ifdef FEATUR...
[privoxy.git] / debian / rules
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
7
8 # This is the debhelper compatibility version to use.
9 export DH_COMPAT=3
10
11 # These are used for cross-compiling and for saving the configure script
12 # from having to guess our platform (since we know it already)
13 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15
16 DEBDIR=`pwd`/debian/privoxy
17
18 CFLAGS="-O2"
19 WITHDEBUG=""
20 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
21         CFLAGS += -g
22         WITHDEBUG="--with-debug"
23 endif
24
25 # hppa doesn't support -pthread option, so we complety disable pthread
26 # on hppa until there is a better solution in configure.
27 ifeq "$(DEB_HOST_GNU_TYPE)" "hppa-linux"
28         WITHOUTPTHREAD="--disable-pthread"
29 endif
30
31 configure: configure-stamp
32 configure-stamp:
33         dh_testdir
34
35         autoheader
36         autoconf
37         env CFLAGS=$(CFLAGS) \
38                 ./configure --prefix=/usr --sysconfdir=/etc \
39                 --mandir=/usr/share/man $(WITHDEBUG) $(WITHOUTPTHREAD) \
40                 --with-docbook=no
41
42         touch configure-stamp
43
44 build: build-stamp
45 build-stamp: configure-stamp 
46         dh_testdir
47
48         $(MAKE)
49
50         touch build-stamp
51
52 clean:
53         dh_testdir
54         dh_testroot
55         rm -f build-stamp configure-stamp
56
57         -$(MAKE) clean
58         -$(MAKE) distclean
59         rm -f privoxy 
60         rm -f configure config.h GNUmakefile 
61         rm -f doc/source/ldp.dsl
62
63         dh_clean
64
65 install: build
66         dh_testdir
67         dh_testroot
68         dh_clean -k
69         dh_installdirs
70
71         install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
72
73         sed -e 's/^\(\(trust\|proxy\)-info-url\|admin-address\)/#\1/'  \
74             -e 's/^\(enable-\(edit-actions\|remote-toggle\)\)/#\1/' \
75             -e 's#^confdir \.#confdir /etc/privoxy#' \
76             -e 's#^logdir \.#logdir /var/log/privoxy#' \
77             -e 's/\(Sample Configuration File for Privoxy\).*/\1/' \
78             -e 's/Id: config,v.*/Id: config,v $$/' \
79                 < config > $(DEBDIR)/etc/privoxy/config
80         install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
81         install -m 0644 standard.action $(DEBDIR)/etc/privoxy/standard.action
82         install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
83         install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
84         install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
85
86         cp -r templates $(DEBDIR)/etc/privoxy/
87         rm -f $(DEBDIR)/etc/privoxy/templates/*~
88         rm -rf $(DEBDIR)/etc/privoxy/templates/CVS
89
90
91 # Build architecture-independent files here.
92 binary-indep: build install
93 # We have nothing to do by default.
94
95 # Build architecture-dependent files here.
96 binary-arch: build install
97         dh_testdir
98         dh_testroot
99 #       dh_installdebconf       
100         dh_installdocs -XCVS
101         dh_installexamples
102         dh_installmenu
103         dh_installlogrotate
104 #       dh_installemacsen
105 #       dh_installpam
106 #       dh_installmime
107         dh_installinit
108         dh_installcron
109         dh_installman
110         dh_installinfo
111 #       dh_undocumented
112         dh_installchangelogs ChangeLog
113         dh_link
114         dh_strip
115         dh_compress
116         dh_fixperms
117 #       dh_makeshlibs
118         dh_installdeb
119 #       dh_perl
120         dh_shlibdeps
121         dh_gencontrol
122         dh_md5sums
123         dh_builddeb
124
125 binary: binary-indep binary-arch
126 .PHONY: build clean binary-indep binary-arch binary install configure