Remove DM-Upload-Allowed and update Maintainer
[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 # Disable python binding
32 CONFFLAGS += --disable-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 # Enable garmin
43 CONFFLAGS += --enable-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 configure ] || sh autogen.sh
63         LDFLAGS="$(LINKER_FLAGS)" \
64         CFLAGS="$(CFLAGS)" \
65         ./configure $(CONFFLAGS)
66         touch $@
67
68
69 build: build-stamp
70 build-stamp: config-stamp
71         dh_testdir
72
73         $(MAKE)
74
75         touch $@
76
77 clean: clean-patched unpatch
78 clean-patched:
79         dh_testdir
80         dh_testroot
81         rm -f build-stamp config-stamp
82
83         # Add here commands to clean up after the build process.
84         [ ! -f Makefile ] || $(MAKE) distclean
85         find $(CURDIR) -name Makefile.in -print0 | xargs -0 rm -f
86         find $(CURDIR)/intl -mindepth 1 -name VERSION -o -type f -print0 | xargs -0 rm -f
87         find $(CURDIR)/po -mindepth 1 -name '*.po.in' -o -name Makefile.am -o -print0 | xargs -0 rm -f
88         find $(CURDIR) -name .libs -type d -print0 | xargs -0 rm -rf
89         find $(CURDIR) -name .deps -type d -print0 | xargs -0 rm -rf
90         rm -f ABOUT-NLS INSTALL aclocal.m4 compile config.guess \
91               config.h.in config.rpath config.sub configure depcomp \
92               install-sh missing mkinstalldirs ltmain.sh
93         rm -rf autom4te.cache m4
94
95         dh_clean
96
97 install:
98 install: build
99         dh_testdir
100         dh_testroot
101         dh_prep
102         dh_installdirs
103
104         # Add here commands to install the package into debian/tmp.
105         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
106
107         # Remove unused .la files
108         find $(CURDIR)/debian/tmp/usr/lib/navit -name \*.la -print0 | xargs -0 rm -f
109
110         # Default navit configuration file moved into /etc
111         mv $(CURDIR)/debian/tmp/usr/share/navit/navit.xml \
112            $(CURDIR)/debian/navit/etc/navit
113
114         # Handled by debian/navit.docs
115         rm $(CURDIR)/debian/tmp/usr/share/navit/README
116
117         # Generate icon for Debian menu
118         convert $(CURDIR)/navit/xpm/desktop_icons/128x128/navit.png -resize 32x32 $(CURDIR)/debian/navit-data/usr/share/pixmaps/navit.xpm
119
120         dh_install
121
122 # Build architecture-independent files here.
123 binary-indep: build install
124         dh_testdir -i
125         dh_testroot -i
126         dh_installchangelogs -i
127         dh_installdocs -i
128         dh_installexamples -i
129 #       dh_installmenu -i
130 #       dh_installdebconf -i
131 #       dh_installlogrotate -i
132 #       dh_installemacsen -i
133 #       dh_installcatalogs -i
134 #       dh_installpam -i
135 #       dh_installmime -i
136 #       dh_installinit -i
137 #       dh_installcron -i
138 #       dh_installinfo -i
139 #       dh_installwm -i
140 #       dh_installudev -i
141 #       dh_lintian -i
142 #       dh_undocumented -i
143         dh_installman -i
144         dh_link -i
145         dh_compress -i
146         dh_fixperms -i
147 #       dh_perl -i
148 #       dh_python -i
149         dh_installdeb -i
150         dh_gencontrol -i
151         dh_md5sums -i
152         dh_builddeb -i
153
154 # Build architecture-dependent files here.
155 binary-arch: build install
156         dh_testdir -a
157         dh_testroot -a
158         dh_installchangelogs -a
159         dh_installdocs -a
160         dh_installexamples -a
161         dh_installmenu -a
162 #       dh_installdebconf -a
163 #       dh_installlogrotate -a
164 #       dh_installemacsen -a
165 #       dh_installcatalogs -a
166 #       dh_installpam -a
167 #       dh_installmime -a
168 #       dh_installinit -a
169 #       dh_installcron -a
170 #       dh_installinfo -a
171 #       dh_installwm -a
172 #       dh_installudev -a
173 #       dh_lintian -a
174 #       dh_undocumented -a
175         dh_installman -a
176         dh_strip -a
177         dh_link -a
178         dh_compress -a
179         dh_fixperms -a
180 #       dh_perl -a
181 #       dh_python -a
182 #       dh_makeshlibs -a
183         dh_installdeb -a
184         dh_shlibdeps -a
185         dh_gencontrol -a
186         dh_md5sums -a
187         dh_builddeb -a
188
189 binary: binary-indep binary-arch
190 .PHONY: build clean binary-indep binary-arch binary install