#!/usr/bin/make -f # -*- makefile -*- # # debian/rules for monotone, by Richard Levitte # based on the dh7 template provided by dh_make(1) # put this up top so it's the default rule. # # Policy (version 3.9.1.0, 2010-07-26, section 4.9) says that when # different binary packages are produced in different ways, it doesn't # make sense to have a build target that builds it all. Quoted: # # or some packages, notably ones where the same source tree is # compiled in different ways to produce two binary packages, the # build target does not make much sense. For these packages it is # good enough to provide two (or more) targets (build-a and build-b # or whatever) for each of the ways of building the package, and a # build target that does nothing. The binary target will have to # build the package in each of the possible ways and make the binary # package out of each. # # ... # # When a package has a configuration and build routine which takes a # long time, or when the makefiles are poorly designed, or when # build needs to run clean first, it is a good idea to touch build # when the build process is complete. This will ensure that if # debian/rules build is run again it will not rebuild the whole # program. # # We definitely have this situation, as we have -indep packages and # -arch packages, and we need to treat them separately, because the # buildds will build with -B after having installed only the Build- # Depends (for they are ignorant of B-D-I. All die, O the # embarrassment) # # However, it also means that we're having configuring, building and # testing done via fakeroot, which isn't a good idea. However, that's # easy to deal with with a little hack (see the file 'nofakeroot' in # this directory) and overrides for those cases. # # So, we disable the build target entirely and let the binary targets # take care of building as well (which dh provides support for, so we # really need nothing extra here). build: @echo 'The build target is disabled, please use the appropriate binary target.' # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 # Enable all hardening features. export DEB_BUILD_MAINT_OPTIONS = hardening=+all # Use the date of the last changelog entry as the build date to # get reproducible builds. export BUILD_DATE = $(shell LC_ALL=C \ date -u --date="`dpkg-parsechangelog -SDate`" +'%Y-%m-%d') # It is desirable to be able to pass the "--parallel" option to dh. # Unfortunately, parallel builds of monotone currently cause make to # enter an infinite loop. When the cause has been determined and # resolved, this option should be re-enabled. %: dh $@ --with=bash_completion,autoreconf override_dh_auto_configure: debian/nofakeroot dh_auto_configure override_dh_auto_clean: test ! -f Makefile || $(MAKE) -C $(CURDIR) clean rm -rf config.h config.guess stamp-h1 config.status Makefile # To enable documentation to only be built for the monotone-doc # package (really, any -indep target), we need to make sure all # relevant dh_auto_* calls behave differently for arch and indep # calls. override_dh_auto_build: LANG=POSIX debian/nofakeroot \ dh_auto_build -pmonotone-doc -- info pdf html LANG=POSIX debian/nofakeroot \ dh_auto_build --remaining-packages -- INFO_DEPS='' # Thanks to buildd configuration decisions that no one will explain to # me in sufficient detail to detect reliably, we have to disable all # netsync tests until upstream gets around to converting them to local # network sockets. export DISABLE_NETWORK_TESTS = 1 # This is a hack to get more detail out of the alpha and sparc testsuite # crashes. export MTN_STACKTRACE_ON_CRASH = 1 override_dh_auto_test: # While dh_auto_test checks for 'nocheck', running it through # nofakeroot seems to confuse it. So we do the check, here. ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) debian/nofakeroot dh_auto_test -pmonotone -- INFO_DEPS='' || \ sh extra/building/dump-test-logs.sh endif override_dh_auto_install: dh_auto_install -Nmonotone-doc -- INFO_DEPS='' dh_auto_install -pmonotone-doc # monotone-server uses these mkdir -p debian/tmp/usr/share/monotone for x in read-permissions write-permissions server-setup/serverrc; do \ cp -p examples/$$x debian/tmp/usr/share/monotone/$${x##*/}.base; \ done # Finally, there are a few overrides needed for the install phase. # Targets where we rely entirely on the upstream installation override_dh_install: dh_install --sourcedir=debian/tmp # Upstream file "ChangeLog" is not actually a change log override_dh_installchangelogs: dh_installchangelogs -X ChangeLog # colorize seems to compress to something weird, Lintian keeps warning # about it. PDFs should generally not be compressed. override_dh_compress: dh_compress -Xcolorize -X.pdf # For now, we link /usr/share/doc/monotone-doc to /usr/share/doc/monotone. # # Note that the monotone-server postinst script relies on # /usr/share/doc/monotone-server being a symlink (or an empty # directory after removal). override_dh_installdocs: dh_installdocs --link-doc=monotone # Install init for monotone-server, but with the name monotone override_dh_installinit: dh_installinit --name=monotone # we should have logrotate support for monotone-server, but currently we don't #override_dh_installlogrotate: # dh_installlogrotate --name=monotone