2007-08-29 03:51:57 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# -*- makefile -*-
|
|
|
|
|
|
|
|
# Uncomment this to turn on verbose mode.
|
|
|
|
#export DH_VERBOSE=1
|
|
|
|
|
|
|
|
# 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)
|
|
|
|
|
2009-09-20 16:23:48 +00:00
|
|
|
DISTRIBUTION := $(shell dpkg-parsechangelog --format rfc822 | sed -ne "s/^Distribution: //p")
|
|
|
|
ifneq ($(DISTRIBUTION),$(findstring $(DISTRIBUTION),"lenny hardy intrepid jaunty karmic"))
|
|
|
|
DISTRIBUTION := sid
|
|
|
|
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_ABI=$(subst .,,$(shell pkg-config --modversion grass|cut -d. -f1,2))
|
|
|
|
|
2008-08-28 22:22:48 +00:00
|
|
|
CMAKE_OPTS = \
|
|
|
|
-Wno-dev \
|
2009-03-02 20:30:13 +00:00
|
|
|
-D GRASS_PREFIX=/usr/lib/grass64 \
|
2008-08-28 22:22:48 +00:00
|
|
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-D CMAKE_SKIP_RPATH=TRUE \
|
|
|
|
-D BINDINGS_GLOBAL_INSTALL=TRUE \
|
2009-04-05 10:39:51 +00:00
|
|
|
-D PEDANTIC=TRUE \
|
|
|
|
-D WITH_SPATIALITE=TRUE \
|
|
|
|
-D WITH_INTERNAL_SPATIALITE=TRUE
|
2007-08-29 03:51:57 +00:00
|
|
|
|
2009-09-20 16:23:48 +00:00
|
|
|
ifneq (,$(findstring $(DISTRIBUTION),"hardy intrepid"))
|
2009-08-02 15:29:02 +00:00
|
|
|
LDFLAGS += -Wl,--as-needed -Wl,--no-undefined
|
2009-09-20 16:23:48 +00:00
|
|
|
endif
|
2009-08-02 15:29:02 +00:00
|
|
|
|
2007-08-29 03:51:57 +00:00
|
|
|
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
|
|
|
CFLAGS += -O0
|
|
|
|
else
|
|
|
|
CFLAGS += -O2
|
|
|
|
endif
|
|
|
|
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
|
|
|
INSTALL_PROGRAM += -s
|
|
|
|
endif
|
|
|
|
|
2008-08-23 13:22:02 +00:00
|
|
|
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
|
|
|
|
CMAKE_OPTS += -D CMAKE_BUILD_TYPE=Debug -D ENABLE_TESTS=TRUE
|
2008-11-08 19:06:55 +00:00
|
|
|
CFLAGS += -DQGISDEBUG=1
|
|
|
|
MAKEFLAGS += VERBOSE=YES
|
2008-08-23 13:22:02 +00:00
|
|
|
endif
|
|
|
|
|
2009-01-31 19:52:52 +00:00
|
|
|
ifneq (,$(findstring profile,$(DEB_BUILD_OPTIONS)))
|
|
|
|
CFLAGS += -pg
|
|
|
|
CXXFLAGS += -pg
|
|
|
|
LDFLAGS += -pg
|
|
|
|
endif
|
|
|
|
|
2009-09-20 16:23:48 +00:00
|
|
|
define gentemplate
|
|
|
|
$(2): $(1)
|
|
|
|
sed \
|
2009-09-27 01:19:07 +00:00
|
|
|
-e "s/{QGIS_ABI}/$(QGIS_ABI)/g" \
|
|
|
|
-e "s/{GRASS_ABI}/$(GRASS_ABI)/g" $$^ >$$@
|
2009-09-20 16:23:48 +00:00
|
|
|
endef
|
|
|
|
|
2009-09-27 01:19:07 +00:00
|
|
|
TEMPLATES := $(foreach t,$(wildcard debian/*.in debian/*.$(DISTRIBUTION)),$(basename $(t)))
|
2009-09-20 16:23:48 +00:00
|
|
|
TEMPLATES += $(foreach t,$(wildcard debian/*{QGIS_ABI}*),$(subst {QGIS_ABI},$(QGIS_ABI),$(t)))
|
|
|
|
|
2009-09-27 01:19:07 +00:00
|
|
|
$(foreach t,$(wildcard debian/*.in debian/*.$(DISTRIBUTION)),$(eval $(call gentemplate,$(t),$(basename $(t)))))
|
2009-09-20 16:23:48 +00:00
|
|
|
$(foreach t,$(wildcard debian/*{QGIS_ABI}*),$(eval $(call gentemplate,$(t),$(subst {QGIS_ABI},$(QGIS_ABI),$(t)))))
|
|
|
|
|
2008-04-14 21:30:22 +00:00
|
|
|
debian/build/CMakeCache.txt: CMakeLists.txt
|
2007-08-29 03:51:57 +00:00
|
|
|
dh_testdir
|
|
|
|
# Add here commands to configure the package.
|
2008-04-14 21:30:22 +00:00
|
|
|
[ -d debian/build ] || mkdir debian/build
|
|
|
|
[ ! -e CMakeCache.txt ] || rm CMakeCache.txt
|
2008-08-23 13:22:02 +00:00
|
|
|
cd debian/build; cmake $(CMAKE_OPTS) ../..
|
2007-08-29 03:51:57 +00:00
|
|
|
|
2009-02-14 00:26:03 +00:00
|
|
|
build: build-stamp
|
2007-08-29 03:51:57 +00:00
|
|
|
|
2008-04-14 21:30:22 +00:00
|
|
|
build-stamp: debian/build/CMakeCache.txt
|
2007-08-29 03:51:57 +00:00
|
|
|
dh_testdir
|
|
|
|
|
|
|
|
# Add here commands to compile the package.
|
2008-04-14 21:30:22 +00:00
|
|
|
$(MAKE) -C debian/build
|
2007-08-29 03:51:57 +00:00
|
|
|
|
2009-02-25 20:59:59 +00:00
|
|
|
touch $@
|
2007-08-29 03:51:57 +00:00
|
|
|
|
2009-09-27 01:19:07 +00:00
|
|
|
clean: $(TEMPLATES)
|
2007-08-29 03:51:57 +00:00
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
rm -f build-stamp
|
|
|
|
rm -f i18n/*.qm
|
|
|
|
rm -rf debian/tmp
|
|
|
|
|
|
|
|
# Add here commands to clean up after the build process.
|
2008-04-14 21:30:22 +00:00
|
|
|
rm -rf debian/build
|
2007-08-29 03:51:57 +00:00
|
|
|
|
|
|
|
dh_clean
|
|
|
|
|
|
|
|
install: build
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
dh_clean -k
|
|
|
|
dh_installdirs
|
|
|
|
|
|
|
|
# Add here commands to install the package into debian/tmp.
|
2008-04-14 21:30:22 +00:00
|
|
|
$(MAKE) -C debian/build install DESTDIR=$(CURDIR)/debian/tmp
|
2007-08-29 03:51:57 +00:00
|
|
|
|
|
|
|
# Install menu pixmap
|
|
|
|
install -o root -g root -d $(CURDIR)/debian/tmp/usr/share/pixmaps
|
2009-01-31 19:52:52 +00:00
|
|
|
install -o root -g root -m 644 $(CURDIR)/images/icons/qgis-icon.png $(CURDIR)/debian/tmp/usr/share/pixmaps
|
|
|
|
install -o root -g root -m 644 $(CURDIR)/images/icons/qgis-mime-icon.png $(CURDIR)/debian/tmp/usr/share/pixmaps
|
2009-02-14 00:26:03 +00:00
|
|
|
install -o root -g root -m 644 $(CURDIR)/debian/qgis-icon.xpm $(CURDIR)/debian/tmp/usr/share/pixmaps
|
2007-08-29 03:51:57 +00:00
|
|
|
|
|
|
|
# Build architecture-independent files here.
|
|
|
|
binary-indep: build install
|
|
|
|
# We have nothing to do by default.
|
|
|
|
|
|
|
|
# Build architecture-dependent files here.
|
|
|
|
binary-arch: build install
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
dh_installchangelogs ChangeLog
|
|
|
|
dh_installdocs
|
|
|
|
dh_installexamples
|
|
|
|
dh_install --sourcedir=debian/tmp
|
2008-08-28 22:22:48 +00:00
|
|
|
|
|
|
|
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 -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
|
|
|
|
|
2008-04-14 21:30:22 +00:00
|
|
|
dh_pycentral
|
2007-08-29 03:51:57 +00:00
|
|
|
dh_installmenu
|
2008-02-13 00:33:16 +00:00
|
|
|
dh_icons
|
2009-09-20 16:23:48 +00:00
|
|
|
ifneq (,$(findstring $(DISTRIBUTION),"lenny hardy"))
|
2008-02-13 00:33:16 +00:00
|
|
|
dh_desktop
|
2009-09-20 16:23:48 +00:00
|
|
|
endif
|
2009-04-21 20:19:33 +00:00
|
|
|
dh_installman -pqgis qgis.1
|
|
|
|
dh_installman -pqgis qgis_help.1
|
2008-02-13 03:41:10 +00:00
|
|
|
dh_installmime -pqgis
|
2007-08-29 03:51:57 +00:00
|
|
|
dh_link
|
2009-02-25 20:59:59 +00:00
|
|
|
if which dh_lintian >/dev/null; then dh_lintian; fi
|
2007-08-29 03:51:57 +00:00
|
|
|
dh_strip
|
|
|
|
dh_compress --exclude=pdf
|
|
|
|
dh_fixperms
|
|
|
|
dh_makeshlibs
|
|
|
|
dh_installdeb
|
2009-03-02 20:30:13 +00:00
|
|
|
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):/usr/lib/grass/lib:/usr/lib/grass64/lib dh_shlibdeps
|
2007-08-29 03:51:57 +00:00
|
|
|
dh_gencontrol
|
|
|
|
dh_md5sums
|
|
|
|
dh_builddeb
|
|
|
|
|
|
|
|
binary: binary-indep binary-arch
|
2009-09-27 01:19:07 +00:00
|
|
|
.PHONY: build clean binary-indep binary-arch binary install debian/control
|