* update the debian packaging instructions
[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 ifneq (,$(findstring maemo-launcher,$(DEB_BUILD_OPTIONS)))
30         LAUNCHER = yes
31 endif
32
33 ifeq "$(strip $(LAUNCHER))" "yes"
34         LAUNCHER_DEPENDS = -Vlauncher:Depends="maemo-launcher"
35         LAUNCHER_CFLAGS = -shared
36         LAUNCHER_LDFLAGS = -shared -export-dynamic
37 endif
38
39 config.status: configure
40         dh_testdir
41         # commands to configure the package.
42         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
43
44 configure: configure-stamp
45 configure-stamp:
46         dh_testdir
47         ./autogen.sh
48         touch configure-stamp
49
50 build: build-stamp
51
52 build-stamp:  config.status
53         dh_testdir
54
55         # commands to compile the package.
56         $(MAKE) \
57           MAEMO_LAUNCHER_CFLAGS="$(LAUNCHER_CFLAGS)" \
58           MAEMO_LAUNCHER_LDFLAGS="$(LAUNCHER_LDFLAGS)"
59         #/usr/bin/docbook-to-man debian/osso-sketch.sgml > osso-sketch.1
60
61         touch build-stamp
62
63 clean:
64         dh_testdir
65         dh_testroot
66         rm -f build-stamp 
67
68         # commands to clean up after the build process.
69         -$(MAKE) distclean
70 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
71         cp -f /usr/share/misc/config.sub config.sub
72 endif
73 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
74         cp -f /usr/share/misc/config.guess config.guess
75 endif
76
77
78         dh_clean 
79
80 install: build
81         dh_testdir
82         dh_testroot
83         dh_clean -k 
84         dh_installdirs
85
86         # install the package into debian/tmp/
87         #
88         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
89
90 ifeq "$(strip $(LAUNCHER))" "yes"
91         mv $(CURDIR)/debian/tmp/usr/bin/modest \
92            $(CURDIR)/debian/tmp/usr/bin/modest.launch
93         ln -s /usr/bin/maemo-invoker \
94               $(CURDIR)/debian/tmp/usr/bin/modest
95 endif
96
97 # Build architecture-independent files here.
98 binary-indep: build install
99 # We have nothing to do by default.
100
101 # Build architecture-dependent files here.
102 binary-arch: build install
103         dh_testdir
104         dh_testroot
105         dh_installchangelogs ChangeLog
106         dh_installdocs
107         dh_installexamples
108         dh_install --sourcedir=debian/tmp -v
109 #       dh_installmenu
110 #       dh_installdebconf       
111 #       dh_installlogrotate
112 #       dh_installemacsen
113 #       dh_installpam
114 #       dh_installmime
115 #       dh_installinit
116 #       dh_installcron
117 #       dh_installinfo
118 #       dh_installman
119         dh_link
120         dh_strip --dbg-package=modest
121         dh_compress
122         dh_fixperms
123 #       dh_perl
124 #       dh_python
125         dh_makeshlibs
126         dh_installdeb
127         dh_shlibdeps
128         dh_gencontrol -- $(LAUNCHER_DEPENDS)
129         dh_md5sums
130         dh_builddeb
131
132 binary: binary-indep binary-arch
133 .PHONY: build clean binary-indep binary-arch binary install