33c70938195fb8c2df2da0f7e1dc9df96e130e42
[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 -Wno-format -g
17
18 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19         CFLAGS += -O0
20 else
21         CFLAGS += -O2
22 endif
23 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
24         INSTALL_PROGRAM += -s
25 endif
26 ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
27         CFLAGS += -mthumb
28 endif
29
30
31 # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
32 version=`ls libmodest-dbus-client/.libs/lib*.so.* | \
33  awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
34 major=`ls libmodest-dbus-client/.libs/lib*.so.* | \
35  awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
36    
37
38 config.status:
39         if [ ! -x configure ]; then ./autogen.sh; fi
40         dh_testdir
41         # Add here 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
45 build: build-stamp
46
47 build-stamp:  config.status
48         dh_testdir
49
50         # Add here commands to compile the package.
51         $(MAKE)
52
53         touch build-stamp
54
55 clean:
56         dh_testdir
57         dh_testroot
58         rm -f build-stamp 
59
60         # Add here commands to clean up after the build process.
61         -$(MAKE) distclean
62 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
63         cp -f /usr/share/misc/config.sub config.sub
64 endif
65 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
66         cp -f /usr/share/misc/config.guess config.guess
67 endif
68
69
70         dh_clean 
71
72 install: build
73         dh_testdir
74         dh_testroot
75         dh_clean -k 
76         dh_installdirs
77
78         # Add here commands to install the package into debian/modest
79         $(MAKE) install DESTDIR=$(CURDIR)/debian/modest
80
81
82 # Build architecture-independent files here.
83 binary-indep: build install
84 # We have nothing to do by default.
85
86 # Build architecture-dependent files here.
87 binary-arch: build install
88         dh_testdir -a
89         dh_testroot -a 
90         dh_installchangelogs ChangeLog
91         dh_installdocs
92 #       dh_installexamples
93         dh_install --sourcedir=debian/modest 
94         dh_installmenu
95 #       dh_installdebconf       
96 #       dh_installlogrotate
97 #       dh_installemacsen
98 #       dh_installpam
99 #       dh_installmime
100 #       dh_installinit
101 #       dh_installcron
102 #       dh_installinfo
103         dh_installman
104         dh_link -a
105         dh_strip -a --dbg-package="modest" 
106         dh_compress -a
107         dh_fixperms -a
108 #       dh_perl
109 #       dh_python
110         dh_makeshlibs -a -V 
111         dh_installdeb
112         dh_shlibdeps -V
113         dh_gencontrol
114         dh_md5sums
115         dh_builddeb
116
117 binary: binary-indep binary-arch
118 .PHONY: build clean binary-indep binary-arch binary install