~ubuntu-branches/ubuntu/trusty/citadel-client/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Michael Meskes
  • Date: 2013-08-27 14:43:49 UTC
  • Revision ID: package-import@ubuntu.com-20130827144349-c3uin0jywfvjopyb
Tags: 8.20-1
Initial release as separate package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
 
 
3
# Uncomment this to turn on verbose mode.
 
4
#export DH_VERBOSE=1
 
5
 
 
6
# This has to be exported to make some magic below work.
 
7
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
8
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
9
 
 
10
export DH_OPTIONS
 
11
 
 
12
DEB_DESTDIR = $(CURDIR)/debian/tmp
 
13
 
 
14
CFLAGS = `dpkg-buildflags --get CFLAGS`
 
15
CFLAGS += -Wall
 
16
 
 
17
LDFLAGS_DEF = `dpkg-buildflags --get LDFLAGS`
 
18
CPPFLAGS_DEF = `dpkg-buildflags --get CPPFLAGS`
 
19
 
 
20
EXTRA_ARGS=
 
21
PROFILE_ARGS=
 
22
#to enable debugging: export DEB_BUILD_OPTIONS="debug profiling threadoff"
 
23
ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
 
24
        PROFILE_ARGS= --with-gprof
 
25
endif
 
26
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
 
27
        CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP -D TECH_PREVIEW
 
28
        LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
 
29
        EXTRA_ARGS = --with-backtrace
 
30
        ifneq (,$(findstring event,$(DEB_BUILD_OPTIONS)))
 
31
                EXTRA_ARGS = --with-backtrace
 
32
        endif
 
33
else
 
34
        LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
 
35
        CFLAGS += -O2
 
36
endif
 
37
 
 
38
ifneq (,$(findstring backtrace,$(DEB_BUILD_OPTIONS)))
 
39
        CFLAGS+= -rdynamic -D_GNU_SOURCE -MD -MP
 
40
        LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed
 
41
        EXTRA_ARGS += --with-backtrace
 
42
endif
 
43
 
 
44
ifneq (,$(findstring threadoff,$(DEB_BUILD_OPTIONS)))
 
45
        THREAD_ARGS=--without-threaded-client
 
46
        CFLAGS += -D WITH_THREADLOG
 
47
else
 
48
        THREAD_ARGS=
 
49
endif
 
50
 
 
51
ifneq (,$(findstring iodbg,$(DEB_BUILD_OPTIONS)))
 
52
        CFLAGS += -D BIGBAD_IODBG
 
53
endif
 
54
 
 
55
ifneq (,$(findstring gcov,$(DEB_BUILD_OPTIONS)))
 
56
        CFLAGS += -fprofile-arcs -ftest-coverage
 
57
        LDFLAGS += -fprofile-arcs -ftest-coverage
 
58
endif
 
59
 
 
60
override_dh_auto_configure:
 
61
        dh_testdir
 
62
 
 
63
        CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS_DEF)" LDFLAGS="$(LDFLAGS_DEF)" ./configure \
 
64
                --prefix=/var/lib/citadel \
 
65
                --with-datadir=/var/lib/citadel \
 
66
                --with-helpdir=/usr/share/citadel-server \
 
67
                --with-staticdatadir=/etc/citadel \
 
68
                --with-spooldir=/var/spool/citadel \
 
69
                --with-sysconfdir=/etc/citadel \
 
70
                --with-rundir=/var/run/citadel \
 
71
                --with-docdir=/usr/share/doc/citadel-doc/ \
 
72
                --with-ssldir=/etc/ssl/citadel/ \
 
73
                --with-utility-bindir=/usr/lib/citadel-server/ \
 
74
                --with-autosysconfdir=/var/lib/citadel/data/ \
 
75
                --with-pam \
 
76
                $(EXTRA_ARGS) $(PROFILE_ARGS) $(THREAD_ARGS)
 
77
 
 
78
override_dh_auto_clean: 
 
79
        dh_auto_clean
 
80
 
 
81
        -rm -f build-arch-stamp build-indep-stamp configure-stamp
 
82
        -rm -f config.status config.log src/*.o
 
83
 
 
84
override_dh_auto_install:
 
85
        dh_testdir
 
86
        dh_testroot
 
87
        dh_prep -i 
 
88
        dh_installdirs -i
 
89
 
 
90
        $(MAKE) DESTDIR=$(DEB_DESTDIR) install-doc-new install-exec-new install-data-new
 
91
 
 
92
override_dh_installinit:
 
93
        dh_installinit --name=citadel --restart-after-upgrade
 
94
 
 
95
%:
 
96
        dh $@ 
 
97