File: rules

package info (click to toggle)
webcit 917-dfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 9,308 kB
  • sloc: ansic: 34,207; sh: 4,455; makefile: 345; xml: 91; sed: 9
file content (71 lines) | stat: -rwxr-xr-x 2,080 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
#!/usr/bin/make -f

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

PKGNAME=citadel-webcit
DESTDIR=$(CURDIR)/debian/$(PKGNAME)

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
CFLAGS = `dpkg-buildflags --get CFLAGS`
CFLAGS += `dpkg-buildflags --get CPPFLAGS`
LDFLAGS = `dpkg-buildflags --get LDFLAGS`

EXTRA_ARGS=
PROFILE_ARGS=
#to enable debugging: export DEB_BUILD_OPTIONS="debug profiling"
ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
	PROFILE_ARGS= --with-gprof
endif
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D TECH_PREVIEW
	LDFLAGS += -pg
	EXTRA_ARGS =  --with-backtrace
else
	CFLAGS += -O2
endif
ifneq (,$(findstring urldebug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -D DEBUG_URLSTRINGS
endif

%:
	dh ${@}

override_dh_auto_configure:
	dh_testdir
	CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \
		--host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=/usr/sbin/ \
		--with-wwwdir=/usr/share/citadel-webcit \
		--with-localedir=/usr/share/ \
		--with-editordir=/usr/share/tinymce/www \
		--with-rundir=/var/run/citadel \
                --with-ssldir=/etc/ssl/webcit/ \
		--with-ssl \
		--with-datadir=/var/run/citadel \
		$(EXTRA_ARGS) $(PROFILE_ARGS)

override_dh_auto_clean:
	dh_auto_clean

	-rm -f Makefile config.log po/Makefile sysdep.h po/webcit/Makefile tests/Makefile

override_dh_auto_install:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) install-bin install-locale install-wwwdata DESTDIR=$(DESTDIR)
	find $(DESTDIR)/usr/share/citadel-webcit/static -type f -exec chmod a-x {} \;
	test ! -d $(DESTDIR)/var/lib/citadel-webcit || mv $(DESTDIR)/usr/share/citadel-webcit/static.local $(DESTDIR)/var/lib/citadel-webcit
	find $(DESTDIR)/usr/share/locale/ -name webcit.mo -exec chmod a-x {} \;
	rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js
	rm $(DESTDIR)/usr/share/citadel-webcit/static/scriptaculous.js
	rm $(DESTDIR)/usr/share/citadel-webcit/static/.gitignore

override_dh_installinit:
	dh_installinit --name=webcit

override_dh_strip:
	dh_strip -a