File: rules

package info (click to toggle)
citadel 7.83-2squeeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,572 kB
  • ctags: 3,756
  • sloc: ansic: 54,870; sh: 4,298; yacc: 660; makefile: 450; xml: 40
file content (137 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
126
127
128
129
130
131
132
133
134
135
136
137
#!/usr/bin/make -f

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

# This has to be exported to make some magic below work.
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

export DH_OPTIONS

DEB_DESTDIR = $(CURDIR)/debian/tmp

CFLAGS = -Wall -g


EXTRA_ARGS=
PROFILE_ARGS=
#to enable debugging: export DEB_BUILD_OPTIONS="debug profiling threadoff"
ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
	PROFILE_ARGS= --with-gprof
endif
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP -D TECH_PREVIEW
	LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
	EXTRA_ARGS = --with-backtrace
else
	CFLAGS += -O2
endif

ifneq (,$(findstring threadoff,$(DEB_BUILD_OPTIONS)))
	THREAD_ARGS=--without-threaded-client
else
	THREAD_ARGS=
endif

configure: configure-stamp
configure-stamp: 
	dh_testdir

	CFLAGS="$(CFLAGS)" ./configure \
		--prefix=/var/lib/citadel \
		--with-datadir=/var/lib/citadel \
		--with-helpdir=/usr/share/citadel-server \
		--with-staticdatadir=/etc/citadel \
		--with-spooldir=/var/spool/citadel \
		--with-sysconfdir=/etc/citadel \
		--with-rundir=/var/run/citadel \
		--with-docdir=/usr/share/doc/citadel-doc/ \
		--with-ssldir=/etc/ssl/citadel/ \
		--with-utility-bindir=/usr/lib/citadel-server/ \
		--with-autosysconfdir=/var/lib/citadel/data/ \
		--with-pam \
		--with-db \
		--with-zlib \
		--with-ldap \
		--with-libical \
		--with-libsieve \
		--enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS) $(THREAD_ARGS)

	touch configure-stamp

#Architecture 
build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp: configure

	$(MAKE)
	touch $@

build-indep: build-indep-stamp
build-indep-stamp: configure

	touch $@

clean: 
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp configure-stamp

	[ ! -f Makefile ] || $(MAKE) distclean
	debconf-updatepo

	dh_clean 
	rm -f config.status config.log

install: install-indep install-arch
install-indep: build-indep
	dh_testdir
	dh_testroot
	dh_prep -i 
	dh_installdirs -i

	$(MAKE) DESTDIR=$(DEB_DESTDIR) install-doc-new

	dh_install -i 

install-arch: build-arch
	dh_testdir
	dh_testroot
	dh_prep -s 
	dh_installdirs -s

	$(MAKE) DESTDIR=$(DEB_DESTDIR) install-exec-new install-data-new

	dh_install -s 

binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_installdebconf	
	dh_installinit --name=citadel
	dh_installman
	dh_strip --dbg-package=citadel-dbg
	dh_link
	dh_compress 
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common

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