Ship upstream ChangeLog and NEWS files.
[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 nodocs,$(DEB_BUILD_OPTIONS)))
31 ENABLE_GTK_DOC = --enable-gtk-doc
32 else
33 ENABLE_GTK_DOC = --disable-gtk-doc
34 endif
35
36 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
37         INSTALL_PROGRAM += -s
38 endif
39
40 # shared library versions, option 1
41 # version=0.0.0 
42 # major=0
43 # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
44 version=`ls src/.libs/lib*.so.* | \
45 awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
46
47 major=`ls src/.libs/lib*.so.* | \
48 awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
49
50 config.status: $(SOURCE_DIR)/configure
51         dh_testdir
52 #       Add here commands to configure the package.
53         CFLAGS="$(CFLAGS)" ./configure              \
54                --host=$(DEB_HOST_GNU_TYPE)          \
55                --build=$(DEB_BUILD_GNU_TYPE)        \
56                --prefix=/usr                        \
57                --mandir=\$${prefix}/share/man       \
58                --infodir=\$${prefix}/share/info     \
59                --with-doc-dir=\$${prefix}/share/doc \
60                --disable-dependency-tracking        \
61                $(ENABLE_GTK_DOC)
62
63 $(SOURCE_DIR)/configure:
64         AUTOGEN_SUBDIR_MODE=1 NOCONFIGURE=yes $(SOURCE_DIR)/autogen.sh
65
66
67 build: build-stamp
68 build-stamp:  config.status
69         dh_testdir
70 #       Add here commands to compile the package.
71         $(MAKE)
72         touch build-stamp
73
74 clean:
75         dh_testdir
76         dh_testroot
77         rm -f build-stamp 
78         rm -rf debian/build
79 #       Add here commands to clean up after the build process.
80         -$(MAKE) distclean
81 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
82         cp -f /usr/share/misc/config.sub config.sub
83 endif
84 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
85         cp -f /usr/share/misc/config.guess config.guess
86 endif
87         dh_clean 
88
89
90 install: build
91         dh_testdir
92         dh_testroot
93         dh_clean -k 
94         dh_installdirs
95
96 #       Add here commands to install the package into debian/build
97         $(MAKE) install DESTDIR=$(CURDIR)/debian/build
98
99         ln -s -f libhildon-1.so $(CURDIR)/debian/build/usr/lib/libhildon_1.so 
100         ln -s -f libhildon-1.so.0 $(CURDIR)/debian/build/usr/lib/libhildon_1.so.0
101         ln -s -f libhildon-1.so.0.0.0 $(CURDIR)/debian/build/usr/lib/libhildon_1.so.0.0.0 
102
103 #       for the -dbg package
104         rm -rf $(CURDIR)/debian/build/usr/lib/debug
105         -mkdir -p $(CURDIR)/debian/build/usr/lib/debug
106         -cp -vd $(CURDIR)/debian/build/usr/lib/lib*.so* $(CURDIR)/debian/build/usr/lib/debug
107
108
109 # Build architecture-independent files here.
110 binary-indep: build install
111 # We have nothing to do by default.
112
113 # Build architecture-dependent files here.
114 binary-arch: build install
115         dh_testdir
116         dh_testroot
117         dh_installdocs NEWS
118         dh_installchangelogs ChangeLog
119 #       dh_installexamples
120         @if [ -d debian/build/usr/share/gtk-doc ]; then         \
121           echo "Installing gtk-doc" ;                           \
122           dh_install --sourcedir=debian/build -v ;              \
123         else                                                    \
124           echo "Skipping gtk-doc" ;                             \
125           dh_install --sourcedir=debian/build -v -Xgtk-doc ;    \
126         fi
127         dh_installman
128         dh_link
129         dh_strip --dbg-package="libhildon1"
130         dh_compress
131         dh_fixperms
132         dh_makeshlibs -V "libhildon1 (>= 1.0.11)" 
133         dh_installdeb
134         dh_shlibdeps
135         dh_gencontrol
136         dh_md5sums
137         dh_builddeb
138
139 binary: binary-indep binary-arch
140 .PHONY: build clean binary-indep binary-arch binary install