File: rules

package info (click to toggle)
geneweb 5.01-8lenny1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,232 kB
  • ctags: 3,690
  • sloc: ml: 57,243; sh: 1,088; makefile: 608
file content (137 lines) | stat: -rwxr-xr-x 3,340 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
#!/usr/bin/make -f

PACKAGE=geneweb

DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)

# Hack to workaround #335578 and geneweb not buildable on alpha
# as long as ocaml is not fixed
# We temporarily build using bytecode on alpha
ifeq ($(DEB_HOST_ARCH),alpha)
        WAY=out
else
        WAY=$(shell if [ -f "/usr/bin/ocamlc.opt" ]; then echo "opt";           \
        else echo "out";                                                \
        fi)
endif

# Use quilt for patches
include /usr/share/quilt/quilt.make

configure:

configure-stamp:	patch
	dh_testdir
	touch configure-stamp


build: configure-stamp build-stamp
build-stamp:
	dh_testdir
	bash -n debian/geneweb.postinst
	bash -n debian/geneweb.postrm
	bash -n debian/geneweb.preinst
	bash -n debian/geneweb.prerm
	bash -n debian/geneweb.init
	dh_installdirs -A

	# Move the proper makefile into place	
	cp -f `pwd`/tools/Makefile.inc.$(WAY) `pwd`/tools/Makefile.inc

	$(MAKE) $(WAY)

	$(MAKE) distrib
	touch build-stamp

clean:	clean-patched unpatch

clean-patched:	
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp configure-stamp
	rm -rf debian/iso-codes
	rm -rf debian/pobuild
	rm -f debian/geneweb.templates.tmp
	rm -f debian/geneweb.templates

	debconf-updatepo

	# Add here commands to clean up after the build process.
	[ ! -f tools/Makefile.inc ] || [ ! -f Makefile] || $(MAKE) clean

	# Clean out cruft left by former builds
	rm -f tools/Makefile.inc
	rm -f compilation.ml

	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/$(PACKAGE).
	dh_install


	# Doc files go to the appropriate directory
	install -m 644 `pwd`/CHANGES \
	        `pwd`/debian/geneweb/usr/share/doc/geneweb/changelog
	# The CGI script
	chmod 755 `pwd`/debian/gwtp/usr/lib/cgi-bin/gwtp/gwtp.cgi
	# The wrappers
	chmod 755 `pwd`/debian/geneweb/usr/lib/geneweb/gwd.wrapper
	chmod 755 `pwd`/debian/gwsetup/usr/lib/geneweb/gwsetup.wrapper

# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: DH_OPTIONS=-i
binary-indep: build install

# Build architecture-dependent files here.
# Pass -a to all debhelper commands in this target to reduce clutter.
binary-arch: DH_OPTIONS=-a
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_link
	dh_installdocs
	# License files should not be duplicated
	rm `pwd`/debian/geneweb/usr/share/doc/geneweb/LICENSE.htm || true

	dh_installmenu
	# At least until dh_installinit has a safe option
	# to avoid installing links for runlevels 0 and 6
	dh_installinit -- start 20 2 3 4 5 . stop 20 1 .
	dh_installman
	dh_installcron
	dh_installexamples
	dh_installlogrotate
	# gwtp does not have any manpage
	dh_installman -pgeneweb

	# Grab ISO 639 language code translations
	chmod u+x debian/get-iso-codes
	debian/get-iso-codes
	# Build templates
	chmod u+x debian/mktemplates
	debian/mktemplates

	dh_installdebconf
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	# Use of the dh-buildinfo package: see http://people.debian.org/~dirson/buildinfo/
	dh_buildinfo
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol

	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install patch unpatch