Close the edit mode after running move to dialog, not before.
[modest] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 # Uncomment this to turn on verbose mode.
5 #export DH_VERBOSE=1
6
7 # These are used for cross-compiling and for saving the configure script
8 # from having to guess our platform (since we know it already)
9 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11
12 CFLAGS = -Wall -g
13 PACKAGENAME = modest
14
15 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
16         CFLAGS += -O0
17 else
18         CFLAGS += -O2
19 endif
20 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
21         INSTALL_PROGRAM += -s
22 endif
23
24 ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
25         CFLAGS += -mthumb
26 endif
27
28 ifeq (,$(findstring nolauncher,$(DEB_BUILD_OPTIONS)))
29         conf_opt = --enable-maemo-launcher
30 endif
31
32 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
33         conf_opt += --enable-debug
34 endif
35
36 config.status: configure
37         dh_testdir
38         # commands to configure the package.
39         if [ ! -x configure ]; then ./autogen.sh; fi
40         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 $(conf_opt)
41
42 configure: configure-stamp
43 configure-stamp:
44         dh_testdir
45         ./autogen.sh
46         touch configure-stamp
47
48 build: build-stamp
49
50 build-stamp:  config.status
51         dh_testdir
52
53         # commands to compile the package.
54         $(MAKE)
55         touch build-stamp
56
57
58 clean:
59         dh_testdir
60         dh_testroot
61         rm -f build-stamp 
62
63 # commands to clean up after the build process.
64 #       -$(MAKE) distclean
65         [ ! -f Makefile ] || $(MAKE) distclean
66
67 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
68         cp -f /usr/share/misc/config.sub config.sub
69 endif
70 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
71         cp -f /usr/share/misc/config.guess config.guess
72 endif
73         dh_clean 
74
75 install: build
76         dh_testdir
77         dh_testroot
78         dh_clean -k 
79         dh_installdirs
80
81 # install the package into debian/tmp/
82         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
83
84 # ACHTUNG: hack
85 # we remove the modest.mo english localization, if the current control file contains a reference
86 # to modest-l10n-mr0; thus, the modest package will not conflict with that one.
87 # if modest-l10n-mr0 is not there, we'll install our own (en_GB) .mo file.
88         if grep -q modest-l10n-mr0 $(CURDIR)/debian/control ; then rm $(CURDIR)/debian/tmp/usr/share/locale/en_GB/LC_MESSAGES/modest.mo ; else echo "modest.mo not removed."; fi
89
90
91 # Build architecture-independent files here.
92 binary-indep: build install
93 # We have nothing to do by default.
94
95 # Build architecture-dependent files here.
96 binary-arch: build install
97         dh_testdir
98         dh_testroot
99         dh_installchangelogs 
100         dh_installdocs
101         dh_installexamples
102         dh_install --sourcedir=debian/tmp -v
103         dh_installmenu
104 #       dh_installdebconf       
105 #       dh_installlogrotate
106 #       dh_installemacsen
107 #       dh_installpam
108 #       dh_installmime
109 #       dh_installinit
110 #       dh_installcron
111 #       dh_installinfo
112         dh_installman
113         dh_link
114         dh_strip --keep-debug --dbg-package=modest --dbg-package=libmodest-dbus-client
115         dh_compress
116         dh_fixperms
117 #       dh_perl
118 #       dh_python
119         dh_makeshlibs
120         dh_installdeb
121         dh_shlibdeps
122         # Not a requirement by now, so don't fail if it's not installed
123         which dh_maemolauncher && dh_maemolauncher usr/bin/modest || true
124         dh_gencontrol
125 #       sh debian/scripts/renew_control_file.sh
126         dh_md5sums
127         dh_builddeb
128
129 binary: binary-indep binary-arch
130 .PHONY: build clean binary-indep binary-arch binary install