Fix Debian directory for harmattan
[neverball] / debian / rules
1 #!/usr/bin/make -f
2 # Based on the sample rules file written by Joey Hess.
3
4 # Uncomment this to turn on verbose mode.
5 export DH_VERBOSE=1
6
7 CFLAGS = -Wall -g
8
9 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
10         CFLAGS += -O0
11 else
12         CFLAGS += -O2
13 endif
14
15 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
16         INSTALL_PROGRAM += -s
17 endif
18
19 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
20         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
21         MAKEFLAGS += -j$(NUMJOBS)
22 endif
23
24
25 build: build-stamp
26 build-stamp:
27         dh_testdir
28         # Set HOME to an existent directory as a workaround for #544835. Note that
29         # HOME isn't actually used, but some buildds set it to a non-existent
30         # directory, and PhysicsFS currently fails if the directory doesn't exist
31         # (see #553174).
32         $(MAKE) $(MAKEFLAGS) \
33                 DATADIR=/opt/maemo/usr/share/games/neverball \
34                 LOCALEDIR=/usr/share/locale \
35                 HOME=$(CURDIR)
36         # Rename icons for .desktop files.
37         cp dist/neverball_128.png dist/neverball.png
38         cp dist/neverputt_128.png dist/neverputt.png
39         touch $@
40
41 clean:
42         dh_testdir
43         dh_testroot
44         rm -f build-stamp
45         [ ! -f Makefile ] || $(MAKE) clean
46         rm -f dist/neverball.png dist/neverputt.png
47         dh_clean
48
49 install: build
50         dh_testdir
51         dh_testroot
52         dh_clean -k
53         dh_installdirs
54         dh_install
55
56 # Build architecture-independent files here.
57 binary-indep: build install
58         dh_testdir -i
59         dh_testroot -i
60         dh_installchangelogs -i CHANGES
61         dh_installdocs -i
62         dh_link -i
63         dh_compress -i
64         dh_fixperms -i
65         dh_installdeb -i
66         dh_gencontrol -i
67         dh_md5sums -i
68         dh_builddeb -i
69
70 # Build architecture-dependent files here.
71 binary-arch: build install
72         dh_testdir -a
73         dh_testroot -a
74         dh_installchangelogs -a CHANGES
75 #       dh_installman -a
76 #       dh_installmenu -a
77         dh_strip -a --dbg-package=neverball-dbg
78         dh_compress -a
79         dh_fixperms -a
80         dh_installdeb -a
81         dh_shlibdeps -a
82         dh_gencontrol -a
83         dh_md5sums -a
84         dh_builddeb -a
85
86 binary: binary-indep binary-arch
87 .PHONY: build clean binary-indep binary-arch binary install