Modify 02_add_debian_files_in_manpage to still apply
[tor.git] / debian / rules
blob0249692ee430e51e427a3c44a11dec9b2df0dd61
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 CFLAGS = -Wall -g
16 export PACKAGE=tor
17 include /usr/share/dpatch/dpatch.make
19 # Do not optimize the build with "noopt"
20 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21 CFLAGS += -O0
22 else
23 CFLAGS += -O2
24 endif
26 # Do not strip the binary with "nostrip"
27 #ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
28 # INSTALL_PROGRAM += -s
29 #endif
31 # Prevent the design paper from being built with "nodoc"
32 ifneq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
33 BUILD_DOC = no
34 endif
36 # Prevent the unit tests from being run with "nocheck"
37 ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
38 RUN_TEST = no
39 endif
40 ifneq (,$(findstring notest,$(DEB_BUILD_OPTIONS)))
41 RUN_TEST = no
42 endif
44 configure: patch-stamp
45 config.status: configure
46 dh_testdir
47 CFLAGS="$(CFLAGS)" ./configure \
48 --host=$(DEB_HOST_GNU_TYPE) \
49 --build=$(DEB_BUILD_GNU_TYPE) \
50 --prefix=/usr \
51 --mandir=\$${prefix}/share/man \
52 --infodir=\$${prefix}/share/info \
53 --localstatedir=/var \
54 --sysconfdir=/etc
57 build: build-stamp
59 build-stamp: config.status
60 dh_testdir
62 $(MAKE)
63 @echo
64 @echo
65 # Running unit tests
66 if [ "$(RUN_TEST)" != "no" ]; then \
67 src/or/test; \
68 else \
69 echo -e "\n\nSkipping unittests\n\n"; \
71 @echo
73 # make design paper
74 if [ "$(BUILD_DOC)" != "no" ]; then \
75 make -C doc/design-paper tor-design.ps tor-design.pdf || \
76 ( echo -e "*\n*\n*\n*"; \
77 echo "* Building some docs failed, perhaps because you did not install the"; \
78 echo "* declared build dependencies and then used -o with dpkg-buildpackage."; \
79 echo "*"; \
80 echo "* If you want to skip this part, you can set nodoc in DEB_BUILD_OPTIONS" ; \
81 echo "* and start the build again. DEB_BUILD_OPTIONS=nodoc dpkg-buildpackage.."; \
82 echo -e "*\n*\n*\n*"; \
83 false ); \
84 else \
85 echo -e "\n\nSkipping tor-design.{ps,pdf}\n\n"; \
88 touch build-stamp
90 clean: unpatch
91 dh_testdir
92 dh_testroot
93 rm -f build-stamp
95 -$(MAKE) distclean
97 dh_clean
99 install: build
100 dh_testdir
101 dh_testroot
102 dh_clean -k
103 dh_installdirs
105 $(MAKE) install DESTDIR=$(CURDIR)/debian/tor
106 # move tor to where it belongs
107 mv $(CURDIR)/debian/tor/etc/tor/torrc.sample $(CURDIR)/debian/tor/etc/tor/torrc
108 mv $(CURDIR)/debian/tor/usr/bin/tor $(CURDIR)/debian/tor/usr/sbin/tor
109 install -d $(CURDIR)/debian/tor/usr/share/man/man8
110 mv $(CURDIR)/debian/tor/usr/share/man/man1/tor.1 $(CURDIR)/debian/tor/usr/share/man/man8/tor.8
112 install -m 755 contrib/torify $(CURDIR)/debian/tor/usr/bin
113 install -m 644 contrib/torify.1 $(CURDIR)/debian/tor/usr/share/man/man1
114 install -m 644 contrib/tor-tsocks.conf $(CURDIR)/debian/tor/etc/tor
116 install -m 644 debian/tor.lintian-override $(CURDIR)/debian/tor/usr/share/lintian/overrides/tor
119 # Build architecture-independent files here.
120 binary-indep: build install
121 # We have nothing to do by default.
123 # Build architecture-dependent files here.
124 binary-arch: build install
125 dh_testdir
126 dh_testroot
127 dh_installchangelogs ChangeLog
128 dh_installdocs
129 if [ "$(BUILD_DOC)" != "no" ]; then \
130 install -m 644 doc/design-paper/tor-design.ps $(CURDIR)/debian/tor/usr/share/doc/; \
131 install -m 644 doc/design-paper/tor-design.pdf $(CURDIR)/debian/tor/usr/share/doc/; \
133 dh_installexamples
134 # dh_install
135 # dh_installdebconf
136 dh_installlogrotate
137 # dh_installemacsen
138 # dh_installmime
139 dh_installinit
140 # dh_installcron
141 dh_installman
142 dh_link
143 #dh_strip
144 dh_compress
145 dh_fixperms
146 dh_installdeb
147 dh_shlibdeps
148 dh_gencontrol
149 dh_md5sums
150 dh_builddeb
152 binary: binary-indep binary-arch
153 .PHONY: build clean binary-indep binary-arch binary install