summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules45
1 files changed, 31 insertions, 14 deletions
diff --git a/debian/rules b/debian/rules
index 24d727175b..af50d0414f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,6 +48,12 @@ ifneq (,$(findstring notest,$(DEB_BUILD_OPTIONS)))
RUN_TEST = no
endif
+# Support passing of parallel=<n> in build options
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif
+
CONF_OPTIONS =
# build against libdmalloc4 - it better be installed
ifneq (,$(findstring with-dmalloc,$(DEB_BUILD_OPTIONS)))
@@ -88,7 +94,7 @@ build-stamp: config.status
src/or/test || true; \
else \
echo "src/or/test"; \
- src/or/test; \
+ src/or/test || true; \
fi; \
else \
echo -e "\n\nSkipping unittests\n\n"; \
@@ -124,7 +130,7 @@ clean: unpatch
dh_testroot
rm -f build-stamp
- -$(MAKE) distclean
+ [ ! -f Makefile ] || $(MAKE) distclean
dh_clean
@@ -156,28 +162,31 @@ install: build
rm -f $(CURDIR)/debian/tor/usr/bin/tor-control.py
+ # tor-dbg doc dir
install -d -m 755 $(CURDIR)/debian/tor-dbg/usr/share/doc
ln -s tor $(CURDIR)/debian/tor-dbg/usr/share/doc/tor-dbg
+ # tor-geoip
+ mv $(CURDIR)/debian/tor/usr/share/tor/geoip $(CURDIR)/debian/tor-geoipdb/usr/share/tor
+ rmdir $(CURDIR)/debian/tor/usr/share/tor || true
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
+ install -d -m 755 $(CURDIR)/debian/tor-geoipdb/usr/share/doc/tor-geoipdb
+ ln -s ../tor/changelog.gz $(CURDIR)/debian/tor-geoipdb/usr/share/doc/tor-geoipdb
+ ln -s ../tor/changelog.Debian.gz $(CURDIR)/debian/tor-geoipdb/usr/share/doc/tor-geoipdb
-# Build architecture-dependent files here.
-binary-arch: build install
+ install -m 644 debian/tor-geoipdb.lintian-override $(CURDIR)/debian/tor-geoipdb/usr/share/lintian/overrides/tor-geoipdb
+
+# Must not depend on anything. This is to be called by
+# binary-arch/binary-indep
+# in another 'make' thread.
+binary-common:
dh_testdir
dh_testroot
- dh_installchangelogs ChangeLog
+ dh_installchangelogs --package=tor ChangeLog
dh_installdocs
dh_installexamples
-# dh_install
-# dh_installdebconf
dh_installlogrotate
-# dh_installemacsen
-# dh_installmime
dh_installinit
-# dh_installcron
dh_installman
dh_link
# Change this for debhelper compatibility level 5 or later!
@@ -189,7 +198,15 @@ binary-arch: build install
dh_gencontrol
dh_md5sums
dh_builddeb
+
+# Build architecture independant packages using the common target.
+binary-indep: install
+ $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+
+# Build architecture dependant packages using the common target.
+binary-arch: install
+ $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
@if [ "$(LOCALHOST_IP)" != "127.0.0.1" ]; then echo; echo; echo; echo; echo; echo "######################################################################"; echo "WARNING: This system does not think localhost is 127.0.0.1. Result of testsuite has been ignored. Please fix your system/chroot."; echo "######################################################################"; echo; echo; echo; echo; echo "Note: 'getent hosts localhost' should return '127.0.0.1 localhost'"; echo; fi
binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+.PHONY: build clean binary-common binary-indep binary-arch binary install