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