d45303a92eaf041aa9a5cfecd29b563b242b1a13
[navit-package] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode. 
4 #export DH_VERBOSE=1
5
6 include /usr/share/quilt/quilt.make
7
8
9 #let's help configure to figure out our host/build system
10 DEB_HOST_ARCH   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
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 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
14   CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
15 else
16   CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
17 endif
18
19 CONFFLAGS += --prefix=/usr
20 # svg2png is required to display country flags
21 CONFFLAGS += --enable-svg2png-scaling-flag="8 16 32 48 96"
22
23 # Force svg2png conversion using rsvg-convert since it is the most reliable
24 # ATM
25 CONFFLAGS += --with-svg2png-use-rsvg-convert
26
27 # Enable GUIs we want
28 CONFFLAGS += --enable-gui-gtk --enable-gui-internal \
29         --enable-hildon
30
31 # Enable python binding
32 CONFFLAGS += --enable-binding-python
33
34 # Broken switches
35 # gd (run fails)
36 CONFFLAGS += --disable-graphics-gd --disable-graphics-sdl
37
38 # don't build the samplemap - we don't want to download
39 # stuff while building...
40 CONFFLAGS += --disable-samplemap
41
42 # Disable garmin until libgarmin enters Debian
43 CONFFLAGS += --disable-garmin
44
45 # disable gypsy support as there's no gypsy in Debian
46 CONFFLAGS += --disable-vehicle-gypsy
47
48 # Avoid floating point calculation for armel
49 ifeq ($(DEB_HOST_ARCH), armel)
50   CONFFLAGS += --enable-avoid-float
51 endif
52
53 #let's take care of optimization + debug builds
54 CFLAGS += -Wall -g
55 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
56         CFLAGS += -O0
57 else
58         CFLAGS += -O2
59 endif
60
61 config-stamp: debian/stamp-patched
62         [ -f ltmain.sh ] || cp /usr/share/libtool/ltmain.sh .
63         [ -f configure ] || sh autogen.sh
64         LDFLAGS="$(LINKER_FLAGS)" \
65         CFLAGS="$(CFLAGS)" \
66         ./configure $(CONFFLAGS)
67         touch $@
68
69
70 build: build-stamp
71 build-stamp: config-stamp
72         dh_testdir
73
74         $(MAKE)
75
76         touch $@
77
78 clean: clean-patched unpatch
79 clean-patched:
80         dh_testdir
81         dh_testroot
82         rm -f build-stamp config-stamp
83
84         # Add here commands to clean up after the build process.
85         [ ! -f Makefile ] || $(MAKE) distclean
86         find $(CURDIR) -name Makefile.in -print0 | xargs -0 rm -f
87         find $(CURDIR)/intl -mindepth 1 -name VERSION -o -type f -print0 | xargs -0 rm -f
88         find $(CURDIR)/po -mindepth 1 -name '*.po.in' -o -name Makefile.am -o -print0 | xargs -0 rm -f
89         find $(CURDIR) -name .libs -type d -print0 | xargs -0 rm -rf
90         find $(CURDIR) -name .deps -type d -print0 | xargs -0 rm -rf
91         rm -f ABOUT-NLS INSTALL aclocal.m4 compile config.guess \
92               config.h.in config.rpath config.sub configure depcomp \
93               install-sh missing mkinstalldirs ltmain.sh
94         rm -rf autom4te.cache m4
95         rm -f navit/graphics/cogl/graphics_cogl.loT
96
97         dh_clean
98
99 install:
100 install: build
101         dh_testdir
102         dh_testroot
103         dh_prep
104         dh_installdirs
105
106         # Add here commands to install the package into debian/tmp.
107         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
108
109         # Default navit configuration file moved into /etc
110         mv $(CURDIR)/debian/tmp/usr/share/navit/navit.xml \
111            $(CURDIR)/debian/navit/etc/navit
112
113         # Handled by debian/navit.docs
114         rm $(CURDIR)/debian/tmp/usr/share/navit/README
115
116         dh_install
117
118 # Build architecture-independent files here.
119 binary-indep: build install
120         dh_testdir -i
121         dh_testroot -i
122         dh_installchangelogs -i
123         dh_installdocs -i
124         dh_installexamples -i
125 #       dh_installmenu -i
126 #       dh_installdebconf -i
127 #       dh_installlogrotate -i
128 #       dh_installemacsen -i
129 #       dh_installcatalogs -i
130 #       dh_installpam -i
131 #       dh_installmime -i
132 #       dh_installinit -i
133 #       dh_installcron -i
134 #       dh_installinfo -i
135 #       dh_installwm -i
136 #       dh_installudev -i
137 #       dh_lintian -i
138 #       dh_undocumented -i
139         dh_installman -i
140         dh_link -i
141         dh_compress -i
142         dh_fixperms -i
143 #       dh_perl -i
144 #       dh_python -i
145         dh_installdeb -i
146         dh_gencontrol -i
147         dh_md5sums -i
148         dh_builddeb -i
149
150 # Build architecture-dependent files here.
151 binary-arch: build install
152         dh_testdir -a
153         dh_testroot -a
154         dh_installchangelogs -a
155         dh_installdocs -a
156         dh_installexamples -a
157         dh_installmenu -a
158 #       dh_installdebconf -a
159 #       dh_installlogrotate -a
160 #       dh_installemacsen -a
161 #       dh_installcatalogs -a
162 #       dh_installpam -a
163 #       dh_installmime -a
164 #       dh_installinit -a
165 #       dh_installcron -a
166 #       dh_installinfo -a
167 #       dh_installwm -a
168 #       dh_installudev -a
169 #       dh_lintian -a
170 #       dh_undocumented -a
171         dh_installman -a
172         dh_strip -a
173         dh_link -a
174         dh_compress -a
175         dh_fixperms -a
176 #       dh_perl -a
177 #       dh_python -a
178 #       dh_makeshlibs -a
179         dh_installdeb -a
180         dh_shlibdeps -a
181         dh_gencontrol -a
182         dh_md5sums -a
183         dh_builddeb -a
184
185 binary: binary-indep binary-arch
186 .PHONY: build clean binary-indep binary-arch binary install