File: rules

package info (click to toggle)
spamoracle 1.4-12
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 256 kB
  • ctags: 245
  • sloc: ml: 1,198; makefile: 145; sh: 74
file content (125 lines) | stat: -rwxr-xr-x 3,100 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# We want to use dpatch.
include /usr/share/dpatch/dpatch.make
PACKAGE = spamoracle

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

OCAMLABI := $(shell ocamlc -version)
OCAML_STDLIB_DIR := $(shell /usr/bin/ocamlc -where)
OCAML_NATIVE_ARCHS := $(shell cat $(OCAML_STDLIB_DIR)/native-archs)

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

configure: configure-stamp
configure-stamp:
	dh_testdir
	touch configure-stamp

debian/control: debian/control.in
	sed \
		-e 's,@OCamlNativeArchs@,$(OCAML_NATIVE_ARCHS),g' \
		$< > $@

build: build-stamp
build-stamp: patch-stamp configure-stamp
	dh_testdir

	$(MAKE) spamoracle.byte
	if [ -x /usr/bin/ocamlopt ]; then \
		$(MAKE) spamoracle; \
	fi

	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	$(MAKE) clean

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/advi.
	if [ -x /usr/bin/ocamlopt ]; then \
		$(MAKE) install DESTDIR=$(CURDIR)/debian/spamoracle; \
	fi
	$(MAKE) install.byte DESTDIR=$(CURDIR)/debian/spamoracle-byte
	install -m 644 debian/spamoracle-byte.override \
		$(CURDIR)/debian/spamoracle-byte/usr/share/lintian/overrides/spamoracle-byte

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installexamples -i
	dh_installmenu -i
	dh_installcron -i
	dh_installman -i spamoracle.1
	dh_installinfo -i
	dh_installchangelogs -i
	dh_link -i
	dh_strip -i -Xspamoracle
	dh_compress -i
	dh_fixperms -i
#	dh_makeshlibs -i
	mv $(CURDIR)/debian/spamoracle-byte/usr/share/doc/spamoracle-byte \
		$(CURDIR)/debian/spamoracle-byte/usr/share/doc/spamoracle
	ln -sf spamoracle \
		$(CURDIR)/debian/spamoracle-byte/usr/share/doc/spamoracle-byte
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i -- -VF:OCamlABI="$(OCAMLABI)"
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	# fails if ocamlopt is missing, in such cases binary-arch shouldn't have been invoked
	test -x /usr/bin/ocamlopt
	dh_testdir -s
	dh_testroot -s
	dh_installdocs -s
	dh_installexamples -s
	dh_installmenu -s
	dh_installcron -s
#	dh_installman -s spamoracle.1
	dh_installman -s
	dh_installinfo -s
	dh_installchangelogs -s
	dh_link -s
	dh_strip -s
	dh_compress -s
	dh_fixperms -s
#	dh_makeshlibs -s
	dh_installdeb -s
	dh_shlibdeps -s
	dh_gencontrol -s -- -VF:OCamlABI="$(OCAMLABI)"
	dh_md5sums -s
	dh_builddeb -s

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