Added a small hack to make the modest packages depend on a particular version of...
[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 # maemo-launcher support is not working properly yet, so leave it disabled
29 #DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS),nolauncher
30 #ifeq (,$(findstring nolauncher,$(DEB_BUILD_OPTIONS)))
31 #       conf_opt := --enable-maemo-launcher
32 #endif
33
34 config.status: configure
35         dh_testdir
36         # commands to configure the package.
37         if [ ! -x configure ]; then ./autogen.sh; fi
38         CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --disable-maemo-launcher --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info $(conf_opt)
39
40 configure: configure-stamp
41 configure-stamp:
42         dh_testdir
43         ./autogen.sh
44         touch configure-stamp
45
46 build: build-stamp
47
48 build-stamp:  config.status
49         dh_testdir
50
51         # commands to compile the package.
52         $(MAKE)
53         touch build-stamp
54
55
56 clean:
57         dh_testdir
58         dh_testroot
59         rm -f build-stamp 
60
61 # commands to clean up after the build process.
62         -$(MAKE) distclean
63 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
64         cp -f /usr/share/misc/config.sub config.sub
65 endif
66 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
67         cp -f /usr/share/misc/config.guess config.guess
68 endif
69         dh_clean 
70
71 install: build
72         dh_testdir
73         dh_testroot
74         dh_clean -k 
75         dh_installdirs
76
77 # install the package into debian/tmp/
78         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
79
80 # ACHTUNG: hack
81 # we remove the modest.mo english localization, if the current control file contains a reference
82 # to modest-l10n-mr0; thus, the modest package will not conflict with that one.
83 # if modest-l10n-mr0 is not there, we'll install our own (en_GB) .mo file.
84         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
85
86
87 # Build architecture-independent files here.
88 binary-indep: build install
89 # We have nothing to do by default.
90
91 # Build architecture-dependent files here.
92 binary-arch: build install
93         dh_testdir
94         dh_testroot
95         dh_installchangelogs 
96         dh_installdocs
97         dh_installexamples
98         dh_install --sourcedir=debian/tmp -v
99         dh_installmenu
100 #       dh_installdebconf       
101 #       dh_installlogrotate
102 #       dh_installemacsen
103 #       dh_installpam
104 #       dh_installmime
105 #       dh_installinit
106 #       dh_installcron
107 #       dh_installinfo
108         dh_installman
109         dh_link
110         dh_strip --keep-debug --dbg-package=modest --dbg-package=libmodest-dbus-client
111         dh_compress
112         dh_fixperms
113 #       dh_perl
114 #       dh_python
115         dh_makeshlibs
116         dh_installdeb
117         dh_shlibdeps
118         # Not a requirement by now, so don't fail if it's not installed
119 #       which dh_maemolauncher && dh_maemolauncher usr/bin/modest || true
120         dh_gencontrol
121         sh debian/scripts/renew_control_file.sh
122         dh_md5sums
123         dh_builddeb
124
125 binary: binary-indep binary-arch
126 .PHONY: build clean binary-indep binary-arch binary install