#!/usr/bin/make -f # # Copyright (C) 2010-2014 CNES - Centre National d'Etudes Spatiales # Author: Sebastien DINOT # # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Enable hardening build flags export DEB_BUILD_MAINT_OPTIONS=hardening=+all export DEB_LDFLAGS_MAINT_APPEND = "-Wl,--as-needed" include /usr/share/dpkg/pkg-info.mk DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) ifndef PKGVERSION PKGVERSION=1 endif TEMPLATES=$(wildcard debian/*lintian-overrides.in) OTB_VERSION_MAJOR = $(shell sed -ne 's/set(OTB_VERSION_MAJOR "\([0-9]*\)")/\1/p' CMakeLists.txt) OTB_VERSION_MINOR = $(shell sed -ne 's/set(OTB_VERSION_MINOR "\([0-9]*\)")/\1/p' CMakeLists.txt) OTB_VERSION_PATCH = $(shell sed -ne 's/set(OTB_VERSION_PATCH "\([0-9]*\)")/\1/p' CMakeLists.txt) OTB_VERSION_SONAME = $(OTB_VERSION_MAJOR).$(OTB_VERSION_MINOR) OTB_VERSION_FULL = $(OTB_VERSION_MAJOR).$(OTB_VERSION_MINOR).$(OTB_VERSION_PATCH) UPSTREAM_VERSION = $(shell echo $(DEB_VERSION_UPSTREAM) | sed -e 's/\+.*//') OTB_USE_SSE_FLAGS=ON ifneq (,$(filter $(DEB_BUILD_ARCH),i386)) OTB_USE_SSE_FLAGS=OFF endif CMAKE_FLAGS = \ -DBUILD_EXAMPLES:BOOL=OFF \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DBUILD_TESTING:BOOL=OFF \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_SKIP_RPATH:BOOL=ON \ -DOTB_INSTALL_ARCHIVE_DIR:STRING=lib/$(DEB_HOST_MULTIARCH) \ -DOTB_INSTALL_LIBRARY_DIR:STRING=lib/$(DEB_HOST_MULTIARCH) \ -DOTB_USE_6S:BOOL=OFF \ -DOTB_USE_CURL:BOOL=ON \ -DOTB_USE_GLEW:BOOL=ON \ -DOTB_USE_GLFW:BOOL=ON \ -DOTB_USE_LIBKML:BOOL=ON \ -DOTB_USE_LIBSVM:BOOL=ON \ -DOTB_USE_MAPNIK:BOOL=OFF \ -DOTB_USE_MUPARSER:BOOL=ON \ -DOTB_USE_MUPARSERX:BOOL=OFF \ -DOTB_USE_OPENCV:BOOL=ON \ -DOTB_USE_OPENGL:BOOL=ON \ -DOTB_USE_QT:BOOL=ON \ -DOTB_USE_QWT:BOOL=ON \ -DOTB_USE_SSE_FLAGS:BOOL=$(OTB_USE_SSE_FLAGS) \ -DOTB_WRAP_PYTHON:BOOL=ON \ -DOTB_WRAP_PYTHON3:BOOL=ON DEBPKGNAME := $(DEB_SOURCE) pkgcli:=$(DEBPKGNAME)-bin pkggui:=$(DEBPKGNAME)-bin-qt pkglib:=lib$(DEBPKGNAME) pkgdev:=$(pkglib)-dev templates: for TEMPLATE in $(TEMPLATES) ; do \ sed -e 's/@SOVERSION@/$(OTB_VERSION_SONAME)-1/g' $$TEMPLATE > `echo $$TEMPLATE | sed 's/.lintian-overrides.in$$/-$(OTB_VERSION_SONAME)-1.lintian-overrides/'` ; \ done sed -e 's/@SOVERSION@/$(OTB_VERSION_SONAME)-1/g' debian/control.in > debian/control sed -e 's/@SOVERSION@/$(OTB_VERSION_SONAME)/g' debian/libotb-dev.install.in > debian/libotb-dev.install # rather use all libs since the installed libs are spread over several packages OTB_LIB_DIRS = $(CURDIR)/debian/tmp/usr/lib %: dh $@ --with pkgkde_symbolshelper --parallel override_dh_auto_configure: templates dh_auto_configure -- $(CMAKE_FLAGS) override_dh_makeshlibs: dh_makeshlibs -- -c0 -v$(UPSTREAM_VERSION) override_dh_shlibdeps: dh_shlibdeps -l$(OTB_LIB_DIRS) override_dh_install: rm -f $(CURDIR)/debian/tmp/usr/share/doc/otb/LICENSE rm -f $(CURDIR)/debian/tmp/usr/share/doc/otb/VERSION rm -f $(CURDIR)/debian/tmp/usr/lib/*/otb/python*/otbApplication.pyc dh_install --list-missing rm -f $(CURDIR)/debian/$(pkglib)/usr/lib/$(DEB_HOST_MULTIARCH)/libOTBWrapper* rm -f $(CURDIR)/debian/$(pkgdev)/usr/lib/$(DEB_HOST_MULTIARCH)/libOTBWrapper* override_dh_installchangelogs: dh_installchangelogs RELEASE_NOTES.txt override_dh_installdocs: dh_installdocs -A NOTICE override_dh_python2: dh_python2 dh_numpy override_dh_python3: dh_python3 dh_numpy3 .PHONY: templates