Some debian stuff and small fix
[wai] / 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 export DH_COMPAT=4
9 export DH_OPTIONS
10
11 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13 DEB_BUILD_ARCH   ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
14
15 CFLAGS = -Wall -g
16
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21 endif
22 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
23         INSTALL_PROGRAM += -s
24 endif
25
26 config.status: configure
27         dh_testdir
28         # Add here commands to configure the package.
29         CFLAGS="$(CFLAGS)" ./configure --with-midgard --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
30
31
32 build: build-stamp
33
34 build-stamp:  config.status
35         dh_testdir
36
37         # Add here commands to compile the package.
38         $(MAKE)
39         touch build-stamp
40
41 clean:
42         dh_testdir
43         dh_testroot
44         rm -f build-stamp 
45
46         # Add here commands to clean up after the build process.
47         mv debian/rules debian/rules.save
48         -$(MAKE) distclean
49         mv debian/rules.save debian/rules
50
51         dh_clean
52
53 install: build
54         dh_testdir
55         dh_testroot
56         dh_clean -k
57         dh_installdirs
58
59         # Add here commands to install the package into debian/tmp
60         #$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp/var/lib/install
61         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
62
63         # See postinst for why we do this.
64 #       ( cd $(CURDIR)/debian/tmp/usr/share/applications/hildon \
65 #      && mv conboy.desktop conboy.inactive                  \
66 #    )
67         dh_install --sourcedir=debian/tmp
68
69
70 # Build architecture-independent files here.
71 binary-indep: DH_OPTIONS=-i
72 binary-indep:
73 # We have nothing to do by default.
74
75 # Build architecture-dependent files here.
76 binary-indep: DH_OPTIONS=-a
77 binary-arch: install
78         dh_testdir
79         dh_testroot
80         dh_link
81         dh_strip
82         dh_compress
83         dh_fixperms
84         dh_installdeb
85         dh_shlibdeps
86         dh_gencontrol
87         dh_md5sums
88         dh_builddeb
89
90 binary: binary-indep binary-arch
91 .PHONY: binary binary-arch binary-indep install clean configure build clean