Updating debian stuff.
[hildon] / 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 SOURCE_DIR=$(CURDIR)
10
11 # These are used for cross-compiling and for saving the configure script
12 # from having to guess our platform (since we know it already)
13 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15
16
17 CFLAGS = -Wall -g
18
19 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
20         CFLAGS += -O0
21 else
22         CFLAGS += -O2
23 endif
24
25 # Use soft-float and thumb mode if it enabled. 
26 ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
27         CFLAGS += -mthumb
28 endif
29
30 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
31         INSTALL_PROGRAM += -s
32 endif
33
34 # shared library versions, option 1
35 version=2.0.5
36 major=2
37 # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
38 #version=`ls src/.libs/lib*.so.* | \
39 # awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
40 #major=`ls src/.libs/lib*.so.* | \
41 # awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
42
43 config.status: $(SOURCE_DIR)/configure
44         dh_testdir
45 #       Add here commands to configure the package.
46         CFLAGS="$(CFLAGS)" ./configure              \
47                --host=$(DEB_HOST_GNU_TYPE)          \
48                --build=$(DEB_BUILD_GNU_TYPE)        \
49                --prefix=/usr                        \
50                --mandir=\$${prefix}/share/man       \
51                --infodir=\$${prefix}/share/info     \
52                --with-doc-dir=\$${prefix}/share/doc \
53                --disable-dependency-tracking        \
54                --disable-gtk-doc
55
56 $(SOURCE_DIR)/configure:
57         AUTOGEN_SUBDIR_MODE=1 NOCONFIGURE=yes $(SOURCE_DIR)/autogen.sh
58
59
60 build: build-stamp
61 build-stamp:  config.status
62         dh_testdir
63 #       Add here commands to compile the package.
64         $(MAKE)
65         touch build-stamp
66
67 clean:
68         dh_testdir
69         dh_testroot
70         rm -f build-stamp 
71 #       Add here commands to clean up after the build process.
72         -$(MAKE) distclean
73 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
74         cp -f /usr/share/misc/config.sub config.sub
75 endif
76 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
77         cp -f /usr/share/misc/config.guess config.guess
78 endif
79         dh_clean 
80
81
82 install: build
83         dh_testdir
84         dh_testroot
85         dh_clean -k 
86         dh_installdirs
87
88 #       Add here commands to install the package into debian/build
89         $(MAKE) install DESTDIR=$(CURDIR)/debian/build
90
91 #       for the -dbg package
92         rm -rf $(CURDIR)/debian/build/usr/lib/debug
93 #       -mkdir -p $(CURDIR)/debian/build/usr/lib/debug
94 #       -cp -vd $(CURDIR)/debian/build/usr/lib/lib*.so* $(CURDIR)/debian/build/usr/lib/debug
95
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 
106 #       dh_installexamples
107         @if [ "x$(ENABLE_GTK_DOC)" != "x" ]; then \
108             dh_installdocs;                       \
109         else                                      \
110             echo "oh nooooooo, no gtk-doc :(";    \
111         fi
112         dh_install --sourcedir=debian/build -v
113         dh_installman
114         dh_link
115         dh_strip --dbg-package="hildon0"
116         dh_compress
117         dh_fixperms
118         dh_makeshlibs -V
119         dh_installdeb
120         dh_shlibdeps
121         dh_gencontrol
122         dh_md5sums
123         dh_builddeb
124
125 binary: binary-indep binary-arch
126 .PHONY: build clean binary-indep binary-arch binary install