Removed build dependency on docbook by making generation of docs a
[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 configure: configure-stamp
26 configure-stamp:
27         dh_testdir
28
29         autoheader
30         autoconf
31         env CFLAGS=$(CFLAGS) WDUMP=w3m \
32                 ./configure --prefix=/usr --sysconfdir=/etc \
33                 --mandir=/usr/share/man $(WITHDEBUG) \
34                 --with-docbook=/usr/share/sgml/docbook/stylesheet/dsssl/modular
35         touch configure-stamp
36
37 build: build-stamp
38 build-stamp: configure-stamp 
39         dh_testdir
40
41         $(MAKE)
42         touch build-stamp
43
44 clean:
45         dh_testdir
46         dh_testroot
47         rm -f build-stamp configure-stamp
48
49         -$(MAKE) clean
50         -$(MAKE) distclean
51         rm -f privoxy 
52         rm -f configure config.h GNUmakefile 
53         rm -f doc/source/ldp.dsl
54
55         dh_clean
56
57 install: build
58         dh_testdir
59         dh_testroot
60         dh_clean -k
61         dh_installdirs
62
63         install -m 0755 privoxy $(DEBDIR)/usr/sbin/privoxy
64
65         sed -e 's/^\(\(trust\|proxy\)-info-url\|admin-address\)/#\1/'  \
66             -e 's/^\(enable-\(edit-actions\|remote-toggle\)\)/#\1/' \
67             -e 's#^confdir \.#confdir /etc/privoxy#' \
68             -e 's#^logdir \.#logdir /var/log/privoxy#' \
69                 < config > $(DEBDIR)/etc/privoxy/config
70         install -m 0644 default.action $(DEBDIR)/etc/privoxy/default.action
71         install -m 0644 standard.action $(DEBDIR)/etc/privoxy/standard.action
72         install -m 0644 user.action $(DEBDIR)/etc/privoxy/user.action
73         install -m 0644 default.filter $(DEBDIR)/etc/privoxy/default.filter
74         install -m 0644 trust $(DEBDIR)/etc/privoxy/trust
75
76         cp -r templates $(DEBDIR)/etc/privoxy/
77         rm -f $(DEBDIR)/etc/privoxy/templates/*~
78         rm -rf $(DEBDIR)/etc/privoxy/templates/CVS
79
80
81 # Build architecture-independent files here.
82 binary-indep: build install
83 # We have nothing to do by default.
84
85 # Build architecture-dependent files here.
86 binary-arch: build install
87         dh_testdir
88         dh_testroot
89 #       dh_installdebconf       
90         dh_installdocs -XCVS
91         dh_installexamples
92         dh_installmenu
93         dh_installlogrotate
94 #       dh_installemacsen
95 #       dh_installpam
96 #       dh_installmime
97         dh_installinit
98         dh_installcron
99         dh_installman
100         dh_installinfo
101 #       dh_undocumented
102         dh_installchangelogs ChangeLog
103         dh_link
104         dh_strip
105         dh_compress
106         dh_fixperms
107 #       dh_makeshlibs
108         dh_installdeb
109 #       dh_perl
110         dh_shlibdeps
111         dh_gencontrol
112         dh_md5sums
113         dh_builddeb
114
115 # Use this target on Debian because we need to make sure configure
116 # was run with docbook's correct path (see configure-stamp above)
117 debian-dok: configure-stamp
118         $(MAKE) dok
119
120 binary: binary-indep binary-arch
121 .PHONY: build clean binary-indep binary-arch binary install configure