* debian/changelog update for packaging
[modest] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
9
10 # These are used for cross-compiling and for saving the configure script
11 # from having to guess our platform (since we know it already)
12 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
13 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14
15
16 CFLAGS = -Wall -g
17 PACKAGENAME = modest
18
19 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
20         CFLAGS += -O0
21 else
22 #       CFLAGS += -O2
23         CFLAGS += -O2
24 endif
25 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
26         INSTALL_PROGRAM += -s
27 endif
28
29
30 LAUNCHER = no 
31 ifneq (,$(findstring maemo-launcher,$(DEB_BUILD_OPTIONS)))
32         LAUNCHER = yes
33 endif
34
35 ifeq "$(strip $(LAUNCHER))" "yes"
36         LAUNCHER_DEPENDS = -Vlauncher:Depends="maemo-launcher"
37         LAUNCHER_CFLAGS = -shared
38         LAUNCHER_LDFLAGS = -pie -shared -export-dynamic
39 endif
40
41
42
43 config.status: configure
44         dh_testdir
45         # commands to configure the package.
46         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
47
48 configure: configure-stamp
49 configure-stamp:
50         dh_testdir
51         ./autogen.sh
52         touch configure-stamp
53
54 build: build-stamp
55
56 build-stamp:  config.status
57         dh_testdir
58
59         # commands to compile the package.
60         $(MAKE) \
61          MAEMO_LAUNCHER_CFLAGS="$(LAUNCHER_CFLAGS)" \
62          MAEMO_LAUNCHER_LDFLAGS="$(LAUNCHER_LDFLAGS)"
63         touch build-stamp
64
65 clean:
66         dh_testdir
67         dh_testroot
68         rm -f build-stamp 
69
70         # commands to clean up after the build process.
71         -$(MAKE) distclean
72 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
73         cp -f /usr/share/misc/config.sub config.sub
74 endif
75 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
76         cp -f /usr/share/misc/config.guess config.guess
77 endif
78
79
80         dh_clean 
81
82 install: build
83         dh_testdir
84         dh_testroot
85         dh_clean -k 
86         dh_installdirs
87
88         # install the package into debian/tmp/
89         #
90         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
91
92         ifeq "$(strip $(LAUNCHER))" "yes"
93         mv $(CURDIR)/debian/modest/usr/bin/modest \
94            $(CURDIR)/debian/modest/usr/bin/modest.launch
95         ln -s /usr/bin/maemo-invoker \
96               $(CURDIR)/debian/modest/usr/bin/modest
97         endif
98
99
100 # Build architecture-independent files here.
101 binary-indep: build install
102 # We have nothing to do by default.
103
104 # Build architecture-dependent files here.
105 binary-arch: build install
106         dh_testdir
107         dh_testroot
108         dh_installchangelogs 
109         dh_installdocs
110         dh_installexamples
111         dh_install --sourcedir=debian/tmp -v
112         dh_installmenu
113 #       dh_installdebconf       
114 #       dh_installlogrotate
115 #       dh_installemacsen
116 #       dh_installpam
117 #       dh_installmime
118 #       dh_installinit
119 #       dh_installcron
120 #       dh_installinfo
121         dh_installman
122         dh_link
123         dh_strip --keep-debug --dbg-package=modest --dbg-package=libmodest-dbus-client
124         dh_compress
125         dh_fixperms
126 #       dh_perl
127 #       dh_python
128         dh_makeshlibs
129         dh_installdeb
130         dh_shlibdeps
131         dh_gencontrol -- $(LAUNCHER_DEPENDS)
132         dh_md5sums
133         dh_builddeb
134
135 binary: binary-indep binary-arch
136 .PHONY: build clean binary-indep binary-arch binary install