Add disclaimer about probably being out-of-date
[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
41         touch configure-stamp
42
43 build: build-stamp
44 build-stamp: configure-stamp 
45         dh_testdir
46
47         $(MAKE)
48
49         touch build-stamp
50
51 clean:
52         dh_testdir
53         dh_testroot
54         rm -f build-stamp configure-stamp
55
56         -$(MAKE) clean
57         -$(MAKE) distclean
58         rm -f privoxy 
59         rm -f configure config.h GNUmakefile 
60         rm -f doc/source/ldp.dsl
61
62         dh_clean
63
64 install: build
65         dh_testdir
66         dh_testroot
67         dh_clean -k
68         dh_installdirs
69
70         install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
71
72         sed -e 's/^\(\(trust\|proxy\)-info-url\|admin-address\)/#\1/'  \
73             -e 's/^\(enable-\(edit-actions\|remote-toggle\)\)/#\1/' \
74             -e 's#^confdir \.#confdir /etc/privoxy#' \
75             -e 's#^logdir \.#logdir /var/log/privoxy#' \
76                 < config > $(DEBDIR)/etc/privoxy/config
77         install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
78         install -m 0644 standard.action $(DEBDIR)/etc/privoxy/standard.action
79         install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
80         install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
81         install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
82
83         cp -r templates $(DEBDIR)/etc/privoxy/
84         rm -f $(DEBDIR)/etc/privoxy/templates/*~
85         rm -rf $(DEBDIR)/etc/privoxy/templates/CVS
86
87
88 # Build architecture-independent files here.
89 binary-indep: build install
90 # We have nothing to do by default.
91
92 # Build architecture-dependent files here.
93 binary-arch: build install
94         dh_testdir
95         dh_testroot
96 #       dh_installdebconf       
97         dh_installdocs -XCVS
98         dh_installexamples
99         dh_installmenu
100         dh_installlogrotate
101 #       dh_installemacsen
102 #       dh_installpam
103 #       dh_installmime
104         dh_installinit
105         dh_installcron
106         dh_installman
107         dh_installinfo
108 #       dh_undocumented
109         dh_installchangelogs ChangeLog
110         dh_link
111         dh_strip
112         dh_compress
113         dh_fixperms
114 #       dh_makeshlibs
115         dh_installdeb
116 #       dh_perl
117         dh_shlibdeps
118         dh_gencontrol
119         dh_md5sums
120         dh_builddeb
121
122 binary: binary-indep binary-arch
123 .PHONY: build clean binary-indep binary-arch binary install configure