-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules
executable file
·288 lines (228 loc) · 10.6 KB
/
rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
QT_PLUGIN_DIR = usr/lib/$(DEB_BUILD_MULTIARCH)/qt4/plugins
DEB_TEST_TARGET ?= Experimental
BUILDDIR ?= debian/build
QGIS_VERSION=$(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p')
ifeq (,$(DISTRIBUTION))
DISTRIBUTION := $(shell dpkg-parsechangelog --format rfc822 | sed -ne "s/^Distribution: //p")
endif
ifneq ($(DISTRIBUTION),$(findstring $(DISTRIBUTION),"wheezy jessie stretch precise trusty utopic vivid sid-oracle"))
DISTRIBUTION := sid
endif
DEB_BUILD_NAME ?= $(DISTRIBUTION)-$(DEB_BUILD_ARCH)
ifeq (,$(DISPLAY))
TESTMAKE=xvfb-run -a -n 1 -s "-screen 0 1280x1024x24 -dpi 96" $(MAKE)
else
TESTMAKE=$(MAKE)
endif
QGIS_MAJOR=$(shell sed -ne 's/SET(CPACK_PACKAGE_VERSION_MAJOR "\([0-9]*\)")/\1/p' CMakeLists.txt)
QGIS_MINOR=$(shell sed -ne 's/SET(CPACK_PACKAGE_VERSION_MINOR "\([0-9]*\)")/\1/p' CMakeLists.txt)
QGIS_PATCH=$(shell sed -ne 's/SET(CPACK_PACKAGE_VERSION_PATCH "\([0-9]*\)")/\1/p' CMakeLists.txt)
QGIS_ABI=$(QGIS_MAJOR).$(QGIS_MINOR).$(QGIS_PATCH)
GRASS=grass$(subst .,,$(shell pkg-config --modversion grass|cut -d. -f1,2))
GRASSVER=$(subst .,,$(shell pkg-config --modversion grass|cut -d. -f1))
CMAKE_OPTS := \
-DBUILDNAME=$(DEB_BUILD_NAME) \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DGRASS_PREFIX=/usr/lib/$(GRASS) \
-DBINDINGS_GLOBAL_INSTALL=TRUE \
-DPEDANTIC=TRUE \
-DWITH_QSPATIALITE=TRUE \
-DWITH_SERVER=TRUE \
-DWITH_SERVER_PLUGINS=TRUE \
-DWITH_GRASS7=FALSE \
-DSERVER_SKIP_ECW=TRUE \
-DQGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \
-DWITH_APIDOC=TRUE \
-DWITH_CUSTOM_WIDGETS=TRUE \
-DWITH_GLOBE=TRUE \
-DWITH_INTERNAL_HTTPLIB2=FALSE \
-DWITH_INTERNAL_JINJA2=FALSE \
-DWITH_INTERNAL_MARKUPSAFE=FALSE \
-DWITH_INTERNAL_PYGMENTS=FALSE \
-DWITH_INTERNAL_DATEUTIL=FALSE \
-DWITH_INTERNAL_PYTZ=FALSE \
-DWITH_INTERNAL_SIX=FALSE \
-DQT_TAG_FILE=/usr/share/qt4/doc/html/qt.tags \
-DQT_DOC_URL=/usr/share/qt4/doc/html/
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
ifneq (,$(findstring $(DISTRIBUTION),"wheezy precise"))
CMAKE_OPTS += -DWITH_PYSPATIALITE=TRUE
endif
ifneq (,$(findstring $(DISTRIBUTION),"sid sid-oracle stretch"))
CMAKE_OPTS += -DPOSTGRES_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libpq.so
endif
ifneq (,$(findstring $(DISTRIBUTION),"jessie stretch trusty utopic vivid sid sid-oracle"))
CMAKE_OPTS += -DPYTHON_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libpython2.7.so
endif
ifneq (,$(findstring -oracle,$(DISTRIBUTION)))
CMAKE_OPTS += -DWITH_ORACLE=TRUE
endif
ifneq (,$(findstring $(DISTRIBUTION),"sid stretch jessie"))
CMAKE_OPTS += -DSPATIALINDEX_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libspatialindex.so
endif
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CMAKE_OPTS += -DCMAKE_BUILD_TYPE=Debug
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
CMAKE_OPTS += -DENABLE_COVERAGE=TRUE
endif
endif
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
CMAKE_OPTS += -DENABLE_TESTS=FALSE
else
CMAKE_OPTS += -DENABLE_TESTS=TRUE
endif
ifneq (,$(findstring $(DISTRIBUTION),"wheezy jessie stretch trusty sid sid-oracle"))
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
CXXFLAGS += -O0
else
CFLAGS += -O2
CXXFLAGS += -O2
endif
ifneq (,$(findstring profile,$(DEB_BUILD_OPTIONS)))
CFLAGS += -pg
CXXFLAGS += -pg
LDFLAGS += -pg
endif
define gentemplate
$(2): $(1)
sed -r \
-e 's/^#(.* |)$(DISTRIBUTION)( .*|)#//' \
-e '/^#($|[^!])/d' \
-e "s/\{DEB_BUILD_GNU_TYPE\}/$(DEB_BUILD_GNU_TYPE)/g" \
-e "s#\{QT_PLUGIN_DIR\}#$(QT_PLUGIN_DIR)#g" \
-e "s/\{QGIS_ABI\}/$(QGIS_ABI)/g" \
-e "s/\{GRASS\}/$(GRASS)/g" \
-e "s/\{GRASSVER\}/$(GRASSVER)/g" \
$$^ >$$@
templates:: $(2)
templateclean::
rm -f $(2)
endef
$(foreach t,$(wildcard debian/*.in),$(eval $(call gentemplate,$(t),$(basename $(t)))))
$(foreach t,$(wildcard debian/*{QGIS_ABI}*),$(eval $(call gentemplate,$(t),$(subst {QGIS_ABI},$(QGIS_ABI),$(t)))))
cleantemplates:
$(MAKE) -f debian/rules templateclean
$(MAKE) -f debian/rules debian/control debian/compat
binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep:
dh $@ --with python2 --parallel --builddirectory=$(BUILDDIR)
override_dh_clean: cleantemplates
dh_clean
# automatically generated files
-$(RM) $(CURDIR)/src/core/qgscontexthelp_texts.cpp
-$(RM) $(CURDIR)/src/core/qgsexpression_texts.cpp
-$(RM) -r $(CURDIR)/$(BUILDDIR)/
override_dh_auto_configure: templates
dh_auto_configure -- $(CMAKE_OPTS)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
# Code to run the package test suite - and ignore the outcome for now
mkdir -p debian/tmp/locale/
localedef -f UTF-8 -i en_US ./debian/tmp/locale/en_US.UTF-8/
-LOCPATH=$(CURDIR)/debian/tmp/locale/ \
LC_ALL=en_US.UTF-8 \
LD_LIBRARY_PATH=$(CURDIR)/$(BUILDDIR)/output/lib:$(LD_LIBRARY_PATH) \
PATH=/usr/sbin:$(PATH) \
$(TESTMAKE) -C $(BUILDDIR) $(DEB_TEST_TARGET)
else
override_dh_auto_test:
@echo Skipping tests.
endif
override_dh_auto_install:
dh_auto_install
# Install menu pixmap
install -o root -g root -d $(CURDIR)/debian/tmp/usr/share/pixmaps
install -o root -g root -m 644 $(CURDIR)/images/icons/qgis_icon.svg $(CURDIR)/debian/tmp/usr/share/pixmaps/qgis.svg
install -o root -g root -m 644 $(CURDIR)/images/icons/qbrowser_icon.svg $(CURDIR)/debian/tmp/usr/share/pixmaps/qbrowser.svg
install -o root -g root -m 644 $(CURDIR)/images/icons/qgis-icon.png $(CURDIR)/debian/tmp/usr/share/pixmaps/qgis.png
install -o root -g root -m 644 $(CURDIR)/images/icons/qbrowser-icon.png $(CURDIR)/debian/tmp/usr/share/pixmaps/qbrowser.png
install -o root -g root -m 644 $(CURDIR)/images/icons/qgis-mime-icon.png $(CURDIR)/debian/tmp/usr/share/pixmaps/qgis-mime.png
install -o root -g root -m 644 $(CURDIR)/debian/qgis-icon.xpm $(CURDIR)/debian/tmp/usr/share/pixmaps/qgis.xpm
install -o root -g root -m 644 $(CURDIR)/debian/qbrowser-icon.xpm $(CURDIR)/debian/tmp/usr/share/pixmaps/qbrowser.xpm
# Install application icon
for size in 8x8 16x16 22x22 24x24 32x32 36x36 42x42 48x48 64x64 72x72 80x80 96x96 128x128 192x192 256x256 512x512; do \
install -o root -g root -d $(CURDIR)/debian/tmp/usr/share/icons/hicolor/$${size}/apps ; \
install -o root -g root -m 644 $(CURDIR)/debian/qgis-icon$${size}.png $(CURDIR)/debian/tmp/usr/share/icons/hicolor/$${size}/apps/qgis.png ; \
install -o root -g root -m 644 $(CURDIR)/debian/qbrowser-icon$${size}.png $(CURDIR)/debian/tmp/usr/share/icons/hicolor/$${size}/apps/qbrowser.png ; \
done
install -o root -g root -d $(CURDIR)/debian/tmp/usr/share/icons/scalable/apps
install -o root -g root -m 644 $(CURDIR)/images/icons/qgis_icon.svg $(CURDIR)/debian/tmp/usr/share/icons/scalable/apps/qgis.svg
install -o root -g root -m 644 $(CURDIR)/images/icons/qbrowser_icon.svg $(CURDIR)/debian/tmp/usr/share/icons/scalable/apps/qbrowser.svg
# Install desktop files
install -o root -g root -d $(CURDIR)/debian/tmp/usr/share/applications
install -o root -g root -m 644 $(CURDIR)/debian/qgis.desktop $(CURDIR)/debian/tmp/usr/share/applications
install -o root -g root -m 644 $(CURDIR)/debian/qbrowser.desktop $(CURDIR)/debian/tmp/usr/share/applications
# Mime info
install -o root -g root -d $(CURDIR)/debian/tmp/usr/share/mime/packages
install -o root -g root -m 644 $(CURDIR)/debian/qgis.xml $(CURDIR)/debian/tmp/usr/share/mime/packages
install -o root -g root -d $(CURDIR)/debian/tmp/usr/share/mimelnk/application
install -o root -g root -m 644 $(CURDIR)/debian/mime/application/* $(CURDIR)/debian/tmp/usr/share/mimelnk/application
# qgis binaries
install -o root -g root -m 755 -d $(CURDIR)/debian/qgis/usr/bin
install -o root -g root -m 755 $(CURDIR)/debian/tmp/usr/bin/qgis $(CURDIR)/debian/qgis/usr/bin
install -o root -g root -m 755 $(CURDIR)/debian/tmp/usr/bin/qbrowser $(CURDIR)/debian/qgis/usr/bin
$(RM) $(CURDIR)/debian/tmp/usr/bin/qgis
$(RM) $(CURDIR)/debian/tmp/usr/bin/qbrowser
# qgis binary wrappers
install -o root -g root -m 755 -d $(CURDIR)/debian/qgis-plugin-grass/usr/bin
install -o root -g root -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis-plugin-grass/usr/bin/qgis
install -o root -g root -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis-plugin-grass/usr/bin/qbrowser
override_dh_install:
# Don't ship srs.db, automatically updated in postinst with crssync
mv $(CURDIR)/debian/tmp/usr/share/qgis/resources/srs.db $(CURDIR)/debian/tmp/usr/share/qgis/resources/srs-template.db
perl -i -pe 's=#!/usr/bin/env python=#!/usr/bin/python2.7=;' $$(find debian/tmp -name "*.py")
# remove unwanted files
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/doc/api/installdox
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/doc/api/html/jquery.js
# Don't include a copy of the world.tif also included in osgearth-data
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/globe/world.tif
# remove extra license files
-find $(CURDIR)/debian/tmp/usr/share/qgis/resources/cpt-city-qgis-min/ -name COPYING.xml -delete
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/doc/LICENSE
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/python/plugins/db_manager/LICENSE
$(RM) $(CURDIR)/debian/tmp/usr/share/qgis/python/plugins/MetaSearch/LICENSE.txt
# Man pages are installed by dh_installman
$(RM) $(CURDIR)/debian/tmp/usr/man/man1/qgis.1
$(RM) $(CURDIR)/debian/tmp/usr/man/man1/qbrowser.1
dh_install --autodest --list-missing
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
override_dh_installman:
dh_installman -pqgis qgis.1 qbrowser.1
override_dh_installmime:
dh_installmime -pqgis
override_dh_python2:
dh_python2 --no-guessing-versions
dh_sip -ppython-qgis
override_dh_compress:
dh_compress --exclude=pdf
override_dh_makeshlibs:
dh_makeshlibs -Xqgis-plugin-grass -Xlibqgis-customwidgets -- -c0 -v$(QGIS_VERSION)
override_dh_shlibdeps:
dh_shlibdeps -l/usr/lib/$(GRASS)/lib
override_dh_strip:
dh_strip --dbg-package=qgis-dbg