3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
6 # Uncomment this to turn on verbose mode.
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
)
17 include /usr
/share
/dpatch
/dpatch.make
19 # Do not optimize the build with "noopt"
20 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
26 # Do not strip the binary with "nostrip"
27 #ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
28 # INSTALL_PROGRAM += -s
31 # Prevent the design paper from being built with "nodoc"
32 ifneq (,$(findstring nodoc
,$(DEB_BUILD_OPTIONS
)))
36 # Prevent the unit tests from being run with "nocheck"
37 ifneq (,$(findstring nocheck
,$(DEB_BUILD_OPTIONS
)))
40 ifneq (,$(findstring notest
,$(DEB_BUILD_OPTIONS
)))
45 # build against libdmalloc4 - it better be installed
46 ifneq (,$(findstring with-dmalloc
,$(DEB_BUILD_OPTIONS
)))
47 CONF_OPTIONS
+= --with-dmalloc
50 configure
: patch-stamp
51 config.status
: configure
53 CFLAGS
="$(CFLAGS)" .
/configure \
54 --host
=$(DEB_HOST_GNU_TYPE
) \
55 --build
=$(DEB_BUILD_GNU_TYPE
) \
57 --mandir=\
$${prefix}/share
/man \
58 --infodir=\
$${prefix}/share
/info \
59 --localstatedir
=/var \
66 build-stamp
: config.status
73 if
[ "$(RUN_TEST)" != "no" ]; then \
74 src
/or
/test || true
; \
76 echo
-e
"\n\nSkipping unittests\n\n"; \
81 # So, gs-gpl on s390 is broken (#321435) and fails to properly build
82 # .pdf files from .fig files using fig2dev. Therefore we ship them
83 # until this bug is fixed.
85 # of course we can always give it a try
87 # the hexdumps were built using something like
88 # perl -e 'while (<>) { print unpack ("H*", $_); }' interaction.pdf | fold > hexdump-interaction.pdf
89 if
[ "$(DEB_BUILD_GNU_TYPE)" = "s390-linux-gnu" ]; then \
90 cd doc
/design-paper
; \
91 fig2dev
-L pdf cell-struct.fig cell-struct.pdf || \
92 ( echo
"** Using shipped pdf file because fig2dev failed"; \
93 perl
-e
'while (<>) { chomp; print pack ("H*", $$_); }' ..
/..
/debian
/hexdump-cell-struct.pdf
> cell-struct.pdf
); \
94 fig2dev
-L pdf interaction.fig interaction.pdf || \
95 ( echo
"** Using shipped pdf file because fig2dev failed"; \
96 perl
-e
'while (<>) { chomp; print pack ("H*", $$_); }' ..
/..
/debian
/hexdump-interaction.pdf
> interaction.pdf
); \
100 if
[ "$(BUILD_DOC)" != "no" ]; then \
101 make
-C doc
/design-paper tor-design.ps tor-design.pdf || \
102 ( echo
-e
"*\n*\n*\n*"; \
103 echo
"* Building some docs failed, perhaps because you did not install the"; \
104 echo
"* declared build dependencies and then used -o with dpkg-buildpackage."; \
106 echo
"* If you want to skip this part, you can set nodoc in DEB_BUILD_OPTIONS" ; \
107 echo
"* and start the build again. DEB_BUILD_OPTIONS=nodoc dpkg-buildpackage.."; \
108 echo
-e
"*\n*\n*\n*"; \
111 echo
-e
"\n\nSkipping tor-design.{ps,pdf}\n\n"; \
131 $(MAKE
) install DESTDIR
=$(CURDIR
)/debian
/tor
132 # move tor to where it belongs
133 mv
$(CURDIR
)/debian
/tor
/etc
/tor
/torrc.sample
$(CURDIR
)/debian
/tor
/etc
/tor
/torrc
134 mv
$(CURDIR
)/debian
/tor
/usr
/bin
/tor
$(CURDIR
)/debian
/tor
/usr
/sbin
/tor
135 install -d
$(CURDIR
)/debian
/tor
/usr
/share
/man
/man8
136 mv
$(CURDIR
)/debian
/tor
/usr
/share
/man
/man1
/tor
.1 $(CURDIR
)/debian
/tor
/usr
/share
/man
/man8
/tor
.8
138 install -m
755 contrib
/torify
$(CURDIR
)/debian
/tor
/usr
/bin
139 install -m
644 contrib
/torify
.1 $(CURDIR
)/debian
/tor
/usr
/share
/man
/man1
140 install -m
644 contrib
/tor-tsocks.conf
$(CURDIR
)/debian
/tor
/etc
/tor
142 install -m
644 debian
/tor.lintian-override
$(CURDIR
)/debian
/tor
/usr
/share
/lintian
/overrides
/tor
144 dh_link usr
/share
/man
/man8
/tor
.8 usr
/share
/man
/man5
/torrc
.5
146 rm -f
$(CURDIR
)/debian
/tor
/usr
/bin
/tor-control.py
149 # Build architecture-independent files here.
150 binary-indep
: build
install
151 # We have nothing to do by default.
153 # Build architecture-dependent files here.
154 binary-arch
: build
install
157 dh_installchangelogs ChangeLog
159 if
[ "$(BUILD_DOC)" != "no" ]; then \
160 install -m
644 doc
/design-paper
/tor-design.ps
$(CURDIR
)/debian
/tor
/usr
/share
/doc
/tor
/; \
161 install -m
644 doc
/design-paper
/tor-design.pdf
$(CURDIR
)/debian
/tor
/usr
/share
/doc
/tor
/; \
182 binary
: binary-indep binary-arch
183 .PHONY
: build
clean binary-indep binary-arch binary
install