monotone

monotone Mtn Source Tree

Root/rules

  • Property mtn:execute set to true
1#!/usr/bin/make -f
2#
3# debian/rules for monotone, by Zack Weinberg
4# Based on a public domain template, originally written by Joey Hess.
5
6# put this up top so it's the default rule.
7#
8# Policy (section 4.9) says that build should depend on build-indep.
9# However, this is only a "should", and it doesn't work, because
10# dpkg-buildpackage uses build even in -B mode. Thus, if build
11# depends on build-indep, even a -B build will try to generate the
12# manuals -- and the buildds will do this having installed only the
13# Build-Depends, for they are ignorant of B-D-I. All die, O the
14# embarrassment. (This has been a festering known problem for
15# nearly a *decade*, with no forward progress since 2007. See bugs
16# #218893 and #229357.)
17#
18# Conversely, not having build depend on build-indep means that if you
19# do a normal dpkg-buildpackage, the manual gets generated in the
20# binary-indep phase rather than the build phase, which works fine (as
21# long as you are being sensible and using fakeroot, anyway; I haven't
22# tried it with actual root privileges and don't propose to).
23#
24# (This is also the primary reason we aren't using "dh" yet; it only
25# knows about the "build" target, not "build-arch"/"build-indep".)
26build: build-arch
27binary: binary-indep binary-arch
28
29# patching
30include /usr/share/quilt/quilt.make
31
32# DEB_BUILD_OPTIONS handling
33
34ifeq "$(findstring noopt,$(DEB_BUILD_OPTIONS))" ""
35DEFAULT_CFLAGS = -g -O2
36else # optimization disabled
37DEFAULT_CFLAGS = -g -O0
38endif
39CFLAGS ?= $(DEFAULT_CFLAGS)
40
41PAR := $(patsubst parallel=%,-j%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
42
43
44# Other tunables
45
46# Thanks to buildd configuration decisions that no one will explain to
47# me in sufficient detail to detect reliably, we have to disable all
48# netsync tests until upstream gets around to converting them to local
49# network sockets.
50export DISABLE_NETWORK_TESTS = 1
51export DH_VERBOSE = 1
52
53# This is a hack to get more detail out of the alpha and sparc testsuite
54# crashes.
55export MTN_STACKTRACE_ON_CRASH = 1
56
57
58# Building
59
60config.status: configure
61dh_testdir
62$(MAKE) -f debian/rules patch
63[ -f config.sub.upstream ] || mv config.sub config.sub.upstream
64[ -f config.guess.upstream ] || mv config.guess config.guess.upstream
65cp -f /usr/share/misc/config.sub config.sub
66cp -f /usr/share/misc/config.guess config.guess
67dh_auto_configure -- CXXFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
68
69# We don't want to generate the info documentation in build-arch.
70build-arch: build-arch-stamp
71build-arch-stamp: config.status
72dh_auto_build -- $(PAR) INFO_DEPS=
73ifeq "$(findstring nocheck,$(DEB_BUILD_OPTIONS))" ""
74if [ `id -u` -eq 0 ]; then \
75 echo "WARNING: Test suite does not work for root - skipping"; \
76else \
77 dh_auto_test -- $(PAR) INFO_DEPS= || sh contrib/dump-test-logs.sh; \
78fi
79endif
80touch $@
81
82# Conversely, in build-indep all we want is the documentation.
83build-indep: build-indep-stamp
84build-indep-stamp: config.status
85make $(PAR) info html monotone.pdf
86touch $@
87
88clean:
89dh_testdir
90dh_auto_clean
91dh_clean
92[ ! -f config.sub.upstream ] || mv -f config.sub.upstream config.sub
93[ ! -f config.guess.upstream ] || mv -f config.guess.upstream config.guess
94$(MAKE) -f debian/rules unpatch
95
96
97# Architecture-dependent binary packages.
98
99binary-arch: build-arch
100dh_testroot
101dh_prep
102dh_installdirs -a
103
104# again, we don't want the documentation in this package; this pair of
105# targets installs everything but
106$(MAKE) DESTDIR=$(shell pwd)/debian/monotone \
107 install-exec-am install-data-local
108
109# dh_installdirs created etc/bash_completion.d. dh_install cannot install
110# a file under a different basename.
111cp contrib/monotone.bash_completion \
112 debian/monotone/etc/bash_completion.d/monotone
113
114dh_installdocs -a
115# upstream file "ChangeLog" is not actually a change log
116dh_installchangelogs -a -X ChangeLog
117dh_installexamples -a
118dh_installman -a
119dh_compress -a
120dh_fixperms -a
121dh_strip -a
122dh_shlibdeps -a
123dh_installdeb -a
124dh_gencontrol -a
125dh_md5sums -a
126dh_builddeb -a
127
128
129# Architecture-independent binary packages.
130#
131# Both monotone-server and monotone-doc are permitted to have their
132# documentation directories be symlinks to the main package's
133# documentation directory, per Policy 12.5. (We are tricksily having
134# monotone-doc add to the contents of the main documentation
135# directory.) This means we should not run dh_installexamples or
136# dh_installchangelogs for either, and should not run dh_installdocs
137# for monotone-server. monotone-doc needs to run dh_installdocs for
138# monotone.pdf and doc-base support, but this requires a few -X flags
139# to avoid conflicting files.
140#
141# The upstream makefiles' install targets do nothing useful for these
142# packages. (In particular, we do not want the monolithic
143# monotone.html installed.) Annoyingly, at present we cannot simply
144# dh_installdocs the entire html directory, because it contains a
145# bunch of unwanted junk; instead we dh_installdirs the directory
146# hierarchy that is required and use cp -p to put all the files in
147# place. (Using globs in monotone-doc.docs would get everything dumped
148# directly into /usr/share/doc/monotone, which doesn't work.)
149
150binary-indep: build-indep
151dh_testroot
152dh_prep
153
154dh_installdirs -i
155cd debian/monotone-doc/usr/share/doc && \
156 ln -s monotone monotone-doc
157cd debian/monotone-server/usr/share/doc && \
158 ln -s monotone monotone-server
159
160cp -p html/*.html html/*.css \
161 debian/monotone-doc/usr/share/doc/monotone/html
162cp -p html/figures/*.png \
163 debian/monotone-doc/usr/share/doc/monotone/html/figures
164dh_installdocs -p monotone-doc -X copyright -X NEWS
165
166cp -p examples/read-permissions \
167 debian/monotone-server/usr/share/monotone/read-permissions.base
168cp -p examples/write-permissions \
169 debian/monotone-server/usr/share/monotone/write-permissions.base
170cp -p contrib/get_passphrase_from_file.lua \
171 debian/monotone-server/usr/share/monotone/hooks.lua.base
172
173dh_installdebconf -i
174
175# we should have logrotate support for monotone-server, but currently we don't
176#dh_installlogrotate -i --name=monotone
177dh_installinit -i --name=monotone
178dh_installinfo -i
179dh_compress -i -X .pdf
180dh_fixperms -i
181dh_installdeb -i
182dh_gencontrol -i
183dh_md5sums -i
184dh_builddeb -i
185
186.PHONY: clean build build-arch build-indep binary binary-arch binary-indep

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status