File: rules

package info (click to toggle)
subversion 1.1.4-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,220 kB
  • ctags: 36
  • sloc: makefile: 340; sh: 85; ansic: 40
file content (441 lines) | stat: -rwxr-xr-x 14,487 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
#!/usr/bin/make -f

# Set this variable to 'yes' to build the libsvn-javahl package.
ENABLE_JAVAHL=no

DEB_BUILDDIR=$(PWD)/build-tree/subversion-1.1.4

# This is the debhelper compatability version to use.
export DH_COMPAT=3
PWD              := $(shell pwd)

DEB_TAR_SRCDIR=$(shell ls subversion-*.tar.* | sed -e 's/\.tar.*//')

include /usr/share/cdbs/1/rules/tarball.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
export DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

PERL_BINDINGDIR=subversion/bindings/swig/perl/native
LIBSVN_SWIG_PY=python/libsvn_swig_py/libsvn_swig_py-1.la

confflags=  \
		--mandir=\$${prefix}/share/man \
		--with-apr=/usr \
		--with-apr-util=/usr \
		--with-neon=/usr \
		--prefix=/usr \
		--with-berkeley-db=/usr \
		--with-editor=/usr/bin/editor \
		--with-apxs=/usr/bin/apxs2 \
		--disable-mod-activation \
		--with-swig=/usr

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
  confflags+= --enable-debug 
endif

ifeq ($(ENABLE_JAVAHL), yes)
  # jikes 1.22 cannot compile javahl.
  confflags += --enable-javahl --without-jikes --with-jdk=/usr/lib/kaffe
endif

# FOR AUTOCONF 2.52 AND NEWER ONLY
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  confflags += --build $(DEB_HOST_GNU_TYPE)
else
  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

TESTARCHS=
#TESTARCHS+=alpha
#TESTARCHS+=arm 
#TESTARCHS+=hppa 
#TESTARCHS+=hurd-i386 
#TESTARCHS+=i386 
#TESTARCHS+=ia64 
#TESTARCHS+=m68k 
#TESTARCHS+=mips 
#TESTARCHS+=mipsel 
#TESTARCHS+=powerpc 
#TESTARCHS+=s390 
#TESTARCHS+=sh 
#TESTARCHS+=sparc

# This logic allows subversion to be more easily on woody.
# Some versions of libtool and fakeroot give us build failures
# without patches.
DEB_VERS:=$(shell dpkg -l libtool fakeroot python swig | tail -4)

LIBTOOL_VER:=$(shell echo '$(DEB_VERS)' | \
		sed -e 's/.*libtool[ ]*\([^ ]*\).*/\1/')
FAKEROOT_VER:=$(shell echo '$(DEB_VERS)' | \
		sed -e 's/.*fakeroot[ ]*\([^ ]*\).*/\1/')
PYTHON_VER:=$(shell echo '$(DEB_VERS)' | \
		sed -e 's/.*python[ ]*\([^ ]\{3\}\).*/\1/')
SWIG_VER:=$(shell echo '$(DEB_VERS)' | \
		sed -e 's/.*swig[ ]*\([^-]*\).*/\1/')

PYTHON_PKG=python$(PYTHON_VER)-subversion

ifeq (yes,$(shell if dpkg --compare-versions $(FAKEROOT_VER) lt 0.4.5 ; then \
			echo yes; fi))
  SVN_LD_PRELOAD="/usr/lib/libfakeroot/libfakeroot.so"
endif

SVN_TESTS_LD_LIBRARY_PATH=$(PWD)/$(DEB_BUILDDIR)/subversion/tests/.libs/"
SVN_LD_LIBRARY_PATH="$(INSTALL_PREFIX)/lib:$(SVN_TESTS_LD_LIBRARY_PATH)

INSTALL_PREFIX=$(PWD)/debian/tmp/usr
LIBEXECDIR=$(PWD)/debian/libapache2-svn/usr/lib/apache2/modules

debian/control:: debian/control.m4
	rm -f debian/control
	m4 \
		-DPYTHON_VER=$(PYTHON_VER) \
		-DENABLE_JAVAHL=$(ENABLE_JAVAHL) \
		debian/control.m4 \
		> debian/control
	chmod 0444 debian/control

autogen: debian/stamp-autogen
debian/stamp-autogen: debian/stamp-$(wildcard *.tar.gz)
	@if ! grep "^Package: python$(PYTHON_VER)-subversion"                \
		debian/control > /dev/null ; then                            \
		echo "Python version mismatch.  Recreating debian/control."; \
		rm -f debian/control;                                        \
		debian/rules debian/control;                                 \
		echo ;                                                       \
		echo "Version mismatch fixed.  Retry the build now." ;       \
		exit 1;                                                      \
	fi

	cd $(DEB_BUILDDIR) && ./autogen.sh
ifeq (yes,$(shell if dpkg --compare-versions $(LIBTOOL_VER) lt 1.4.2-7.1 ; \
			then echo yes; fi))
	# If you build on woody you get a broken ltmain.sh without this patch.
	cat debian/patches/ltmain.sh.patch | (cd $(DEB_BUILDDIR) && patch -p0)
endif
	touch $@

configure: debian/stamp-configure
debian/stamp-configure: debian/stamp-autogen
	dh_testdir

	cd $(DEB_BUILDDIR) && ./configure \
		$(confflags) CFLAGS="-g -Wall -O2" \

	touch $@

build: debian/stamp-build
debian/stamp-build: debian/stamp-configure
	dh_testdir

	$(MAKE) -C $(DEB_BUILDDIR) all swig-py \
		swig_pydir=/usr/lib/python$(PYTHON_VER)/site-packages/libsvn \
		swig_pydir_extra=/usr/lib/python$(PYTHON_VER)/site-packages/svn

ifeq ($(ENABLE_JAVAHL), yes)
	$(MAKE) -C $(DEB_BUILDDIR) javahl \
		javahl_javadir=/usr/share/java \
		javahl_libdir=/usr/lib \
		javahl_javahdir=/usr/include/svn-javahl
endif

	touch $@

clean:: debian/control cleanbuilddir
	dh_testdir
	dh_testroot
	dh_clean
	$(MAKE) -C debian/tools clean
	rm -f debian/stamp-*

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) local-install install-swig-py \
		INSTALL_MOD_SHARED=echo \
		DESTDIR=$(PWD)/debian/tmp \
		swig_pydir=/usr/lib/python$(PYTHON_VER)/site-packages/libsvn \
		swig_pydir_extra=/usr/lib/python$(PYTHON_VER)/site-packages/svn \
		-C $(DEB_BUILDDIR)

ifeq ($(ENABLE_JAVAHL), yes)
	$(MAKE) -C $(DEB_BUILDDIR) install-javahl \
		DESTDIR=$(PWD)/debian/tmp \
		javahl_javadir=/usr/share/java \
		javahl_libdir=/usr/lib \
		javahl_javahdir=/usr/include/svn-javahl
endif

	# Create our default configuration files to be installed in
	# /etc/subversion/
	$(MAKE) -C debian/tools DEB_SRCDIR=$(DEB_BUILDDIR) \
	       LD_LIBRARY_PATH="$(SVN_LD_LIBRARY_PATH)"

	LD_PRELOAD="$(SVN_LD_PRELOAD)" \
	       LD_LIBRARY_PATH="$(SVN_LD_LIBRARY_PATH)" \
	       $(MAKE) DESTDIR=$(PWD)/debian/tmp \
	       revision-install \
	       -C $(DEB_BUILDDIR)

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	# If we aren't cross-compiling we might run the testsuite

	# Since the testsuite takes a while to run it is only enabled on
	# archs that need it.  In general when a new upstream version is
	# available all archs have the testsuite enabled.  Any arch that
	# passes the testsuite then has the testsuite disabled for future
	# Debian versions of that upstream version.
	@if echo " $(TESTARCHS) " | \
	    grep -q "[[:space:]]$(DEB_HOST_ARCH)[[:space:]]" ; then \
	  echo "################################################";  \
	  echo "Running Testsuite, this may take a while, "      ;  \
	  echo "edit debian/rules to disable"                    ;  \
	  echo "################################################";  \
	  if ! LC_ALL=C LD_PRELOAD="$(SVN_LD_PRELOAD)" \
	       LD_LIBRARY_PATH="$(SVN_LD_LIBRARY_PATH)" \
	       /usr/bin/time $(MAKE) -C $(DEB_BUILDDIR) check ; then \
	        echo "Testsuite failed" ; \
		cat $(DEB_BUILDDIR)/tests.log; \
		exit 1; \
	  fi \
	else \
	  echo "################################################";  \
	  echo "Running basic tests." ; \
	  echo "################################################";  \
	  if ! LC_ALL=C LD_PRELOAD="$(SVN_LD_PRELOAD)" \
	       LD_LIBRARY_PATH="$(SVN_LD_LIBRARY_PATH)" \
	       /usr/bin/time $(MAKE) -C $(DEB_BUILDDIR) check \
	       TESTS=subversion/tests/clients/cmdline/basic_tests.py ; then \
	        echo "Testsuite failed" ; \
		cat $(DEB_BUILDDIR)/tests.log; \
		exit 1; \
	  fi \
	fi
endif

	$(MAKE) -C $(DEB_BUILDDIR) swig-pl check-swig-pl

	cd $(DEB_BUILDDIR)/$(PERL_BINDINGDIR) && \
		env APR_CONFIG=/usr/bin/apr-config perl Makefile.PL \
			INSTALLDIRS=vendor

	for file in Makefile Makefile.client Makefile.delta Makefile.fs \
	  Makefile.ra Makefile.repos Makefile.wc ; do \
	    sed -e 's/^LD_RUN_PATH/\#LD_RUN_PATH/' < \
	      $(DEB_BUILDDIR)/$(PERL_BINDINGDIR)/$$file \
	      > $(DEB_BUILDDIR)/$(PERL_BINDINGDIR)/$$file.tmp;\
	    cp $(DEB_BUILDDIR)/$(PERL_BINDINGDIR)/$$file.tmp\
	      $(DEB_BUILDDIR)/$(PERL_BINDINGDIR)/$$file;\
	done

	cd $(DEB_BUILDDIR)/$(PERL_BINDINGDIR) && \
		make all test OTHERLDFLAGS="-L $(INSTALL_PREFIX)/lib" \
			OPTIMIZE="-O2 -g -Wall"

	$(MAKE) -C $(DEB_BUILDDIR) install-swig-pl-lib \
		DESTDIR=$(PWD)/debian/tmp 
	$(MAKE) -C $(DEB_BUILDDIR)/$(PERL_BINDINGDIR) install \
		MAN3EXT=3perl DESTDIR=$(PWD)/debian/tmp 

ifeq ($(ENABLE_JAVAHL), yes)
	dh_movefiles --package=libsvn-javahl \
		usr/share/java \
		usr/lib/libsvnjavahl-1.a \
		usr/lib/libsvnjavahl-1.la \
		usr/lib/libsvnjavahl-1.so \
		usr/lib/libsvnjavahl-1.so.0 \
		usr/lib/libsvnjavahl-1.so.0.0.0 \
		usr/include/svn-javahl
endif

	# Install files for 'libsvn-core-perl' package.
	dh_movefiles --package=libsvn-core-perl \
		usr/lib/perl5/ \
		usr/share/man/man3 \

	# Install files for 'python$(PYTHON_VER)-subversion' package.
	dh_movefiles --package=$(PYTHON_PKG) \
		usr/lib/python$(PYTHON_VER)/

	install -d debian/$(PYTHON_PKG)/usr/share/doc/$(PYTHON_PKG)
	install -m 0644 debian/pythonX.Y-subversion.README.Debian \
		debian/$(PYTHON_PKG)/usr/share/doc/$(PYTHON_PKG)/README.Debian

	# Install files for 'subversion' package.
	dh_movefiles --package=subversion \
		usr/bin \
		usr/share

	install -d debian/subversion/etc/bash_completion.d/
	install -m 0644 $(DEB_BUILDDIR)/tools/client-side/bash_completion \
		debian/subversion/etc/bash_completion.d/subversion

	install -d debian/subversion/etc/subversion/
	install -m 0644 debian/tools/svn-defaults/config \
		debian/tools/svn-defaults/servers \
		debian/subversion/etc/subversion

	$(MAKE) -C $(DEB_BUILDDIR)/doc/book install-book-html \
		DESTDIR=$(PWD)/debian/subversion/ \
		BOOK_ALL_SOURCE= BOOK_VERSION_SOURCE=

	# Install some other useful examples.
	install -d debian/subversion/usr/share/doc/subversion/examples/
	install $(DEB_BUILDDIR)/tools/dev/gnuify-changelog.pl \
		debian/subversion/usr/share/doc/subversion/examples/

	install -m 0644 $(DEB_BUILDDIR)/HACKING \
		$(DEB_BUILDDIR)/INSTALL \
		$(DEB_BUILDDIR)/README \
		debian/subversion/usr/share/doc/subversion/

	# Install emacs scripts.
	install -d debian/subversion/usr/share/emacs/site-lisp/	
	install -m 0644 \
		$(DEB_BUILDDIR)/contrib/client-side/vc-svn.el \
		$(DEB_BUILDDIR)/contrib/client-side/psvn/psvn.el \
		debian/subversion/usr/share/emacs/site-lisp/

	# Emacs binding will auto-load only after the commands
	# in these files are uncommented.
	install -d debian/subversion/etc/emacs/site-start.d/
	install -m 0644 \
		debian/etc/50psvn.el \
		debian/etc/50vc-svn.el \
		debian/subversion/etc/emacs/site-start.d/

	install -m 0644 $(DEB_BUILDDIR)/CHANGES \
		debian/subversion/usr/share/doc/subversion/changelog

	# Install files for 'libapache2-svn' package.
	install -d $(LIBEXECDIR)
	cd $(DEB_BUILDDIR)/subversion/mod_dav_svn/ && \
		 cp ./.libs/mod_dav_svn.so $(LIBEXECDIR)/mod_dav_svn.so
	cd $(DEB_BUILDDIR)/subversion/mod_authz_svn && \
		 cp ./.libs/mod_authz_svn.so $(LIBEXECDIR)/mod_authz_svn.so
	install -d debian/libapache2-svn/etc/apache2/mods-available/
	install -m 0644 debian/dav_svn.load debian/dav_svn.conf \
		debian/libapache2-svn/etc/apache2/mods-available/

	install -d debian/libapache2-svn/usr/share/doc/libapache2-svn
	install $(DEB_BUILDDIR)/subversion/mod_authz_svn/INSTALL \
		debian/libapache2-svn/usr/share/doc/libapache2-svn/INSTALL.authz

	install -d debian/libapache2-svn/var/www/apache2-default/
	install -m 0644 $(DEB_BUILDDIR)/tools/xslt/svnindex.xsl \
		$(DEB_BUILDDIR)/tools/xslt/svnindex.css \
		debian/libapache2-svn/var/www/apache2-default/

	dh_movefiles --package=libsvn0 \
		`cd debian/tmp ; ls usr/lib/libsvn_*-1.so.0*`

	dh_movefiles --package=libsvn0-dev \
		usr/include \
		usr/lib

	# Install files for 'subversion-tools' package.
	install -d debian/subversion-tools/usr/bin/

	install -d debian/subversion-tools/usr/share/doc/subversion-tools/

	install	$(DEB_BUILDDIR)/contrib/client-side/svn_load_dirs.pl \
		debian/subversion-tools/usr/bin/svn_load_dirs

	install $(DEB_BUILDDIR)/contrib/client-side/svn_load_dirs.README \
		debian/subversion-tools/usr/share/doc/subversion-tools/ \

	install -d debian/subversion-tools/usr/lib/subversion/
	install $(DEB_BUILDDIR)/tools/backup/hot-backup.py \
		debian/subversion-tools/usr/lib/subversion/

	install -d debian/subversion-tools/usr/lib/subversion/
	sed -e \
	   's|/usr/local/BerkeleyDB.4.0/bin/db_archive|/usr/bin/db4.1_archive|;\
	    s|/usr/local/BerkeleyDB.4.0/bin/db_recover|/usr/bin/db4.1_recover|'\
	   $(DEB_BUILDDIR)/tools/backup/hot-backup.py \
	   > debian/subversion-tools/usr/lib/subversion/hot-backup.py
	chmod 0755 debian/subversion-tools/usr/lib/subversion/hot-backup.py

	install -d debian/subversion-tools/usr/lib/subversion/hook-scripts
	cp -a $(DEB_BUILDDIR)/tools/hook-scripts/* \
		debian/subversion-tools/usr/lib/subversion/hook-scripts
	rm debian/subversion-tools/usr/lib/subversion/hook-scripts/*.in
	
	# Overwrite some files just installed with files with the proper 
	# perl interpreter.
	for file in commit-email.pl \
	            propchange-email.pl \
		    commit-access-control.pl ; do \
	    sed -e \
	       's|^#!/usr/bin/env perl -w$$|#!/usr/bin/perl -w|'\
               < $(DEB_BUILDDIR)/tools/hook-scripts/$$file \
               > debian/subversion-tools/usr/lib/subversion/hook-scripts/$$file ; \
	done

	# Overwrite some files just installed with files with the proper 
	# python interpreter.
	for file in mailer/mailer.py \
	            mailer/tests/mailer-tweak.py \
	            svnperms.py ; do \
	sed -e 's|^#!/usr/bin/env python2$$|#!/usr/bin/env python$(PYTHON_VER)|' \
	    < $(DEB_BUILDDIR)/tools/hook-scripts/$$file \
	    > debian/subversion-tools/usr/lib/subversion/hook-scripts/$$file; \
	done

	install -d debian/python$(PYTHON_VER)-subversion/usr/bin
	sed -e 's|^#!/usr/bin/env python2$$|#!/usr/bin/env python$(PYTHON_VER)|' \
	    < $(DEB_BUILDDIR)/tools/examples/svnshell.py \
	    > debian/python$(PYTHON_VER)-subversion/usr/bin/svnshell
	chmod 0755 debian/python$(PYTHON_VER)-subversion/usr/bin/svnshell

	for package in `dh_listpackages` ; do \
		if [ -f debian/NEWS.Debian ] ; then \
			mkdir -p debian/$$package/usr/share/doc/$$package; \
			cp debian/NEWS.Debian \
				debian/$$package/usr/share/doc/$$package; \
		fi \
	done

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs -i
	dh_installman -i
	dh_installdirs -i
	dh_installchangelogs -i
	dh_compress -i
	dh_fixperms -i
	dh_perl -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs -a
	dh_installdirs -a
	dh_installchangelogs -a
	dh_fixperms -a
	dh_strip -a
	dh_compress -a
	dh_makeshlibs -a -V
	dh_perl -a
	dh_python -a -V $(PYTHON_VER)
	dh_installdeb -a
	dh_shlibdeps -a -l$(PWD)/debian/libsvn0/usr/lib
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure autogen