#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all include /usr/share/dpkg/pkg-info.mk DEB_REQUESTED_PACKAGES := $(shell dh_listpackages) when-in-build-profile = $(patsubst 0,$(3),$(patsubst 1,$(2),$(patsubst 01,1,0$(patsubst $(1),1,$(filter $(1),$(DEB_BUILD_PROFILES)))))) when-not-in-build-profile = $(patsubst 0,$(3),$(patsubst 1,$(2),$(patsubst 11,0,1$(patsubst $(1),1,$(filter $(1),$(DEB_BUILD_PROFILES)))))) when-building-package = $(patsubst 0,$(3),$(patsubst 1,$(2),$(patsubst 01,1,0$(patsubst $(1),1,$(filter $(1),$(DEB_REQUESTED_PACKAGES)))))) when-not-building-package = $(patsubst 0,$(3),$(patsubst 1,$(2),$(patsubst 11,0,1$(patsubst $(1),1,$(filter $(1),$(DEB_REQUESTED_PACKAGES)))))) # The macro bc_compute_lib_version (among others) from # /usr/share/bctoolbox/cmake/bctoolboxCMakeUtils.cmake expects the # .git directory to be available. We fool it with a shellscript # that returns the version from debian/changelog options += -DGIT_EXECUTABLE=/usr/share/bctoolbox/upstream-version-from-changelog options += -DDEB_VERSION_UPSTREAM=$(DEB_VERSION_UPSTREAM) # The path resolution logic throughout linphone-stack is very confusing. # Check with: strings debian/liblinphone??/usr/lib/*/liblinphone.so.*|grep share/ options += -DCMAKE_INSTALL_DATADIR="share/linphone" export DEB_CFLAGS_MAINT_APPEND += -DPACKAGE_SOUND_DIR="\"/usr/share/sounds/linphone\"" DEB_CFLAGS_MAINT_APPEND += -DPACKAGE_RING_DIR="\"/usr/share/sounds/linphone/rings\"" export DEB_CXXFLAGS_MAINT_APPEND := $(DEB_CFLAGS_MAINT_APPEND) # Upstream unconditionally sets CMAKE_INSTALL_RPATH. Make it ineffective by # setting CMAKE_SKIP_RPATH options += -DCMAKE_SKIP_RPATH=ON # this enables the unified call+chat database; it requires sqlite3 and # a version of libsoci-dev built with C++11 support features += -DENABLE_DB_STORAGE=$(call when-building-package,liblinphone10,YES,NO) # libsoci-dev features += -DENABLE_ADVANCED_IM=$(call when-building-package,liblinphone10,YES,NO) # libxerces-c-dev xsdcxx # If d/patches/ldap-hostname-override.patch causes problems, comment # out the next 2 lines CPPFLAGS += -DDEBPATCH_LDAP_HOSTNAME_OVERRIDE=1 features += -DENABLE_LDAP=$(call when-building-package,liblinphone10,YES,NO) # libldap2-dev features += -DENABLE_LIME=NO features += -DENABLE_LIME_X3DH=$(call when-building-package,liblinphone10,YES,NO) # liblime-dev features += -DENABLE_UNIT_TESTS=NO features += -DENABLE_STATIC=NO features += -DENABLE_SHARED=$(call when-building-package,liblinphone10,YES,NO) %: dh $@ --buildsystem=cmake override_dh_auto_configure: ifeq (x,$(call when-building-package,liblinphone10,x)) dh_auto_configure -- \ $(options) \ $(features) endif override_dh_auto_test: override_dh_installchangelogs: dh_installchangelogs CHANGELOG.md execute_after_dh_auto_build-arch: # false override_dh_auto_install-arch: dh_auto_install override_dh_auto_build-indep: true override_dh_auto_build-arch: # comment out these path macro definitions because fixing CMakeLists.txt is too much work sed -i '/^#define PACKAGE_SOUND_DIR/s@^@//@' obj-$(DEB_HOST_GNU_TYPE)/config.h sed -i '/^#define PACKAGE_RING_DIR/s@^@//@' obj-$(DEB_HOST_GNU_TYPE)/config.h dh_auto_build override_dh_auto_install-indep: mkdir -p debian/tmp/usr/share/belr/grammars cp -at debian/tmp/usr/share/belr/grammars share/*_grammar mkdir -p debian/tmp/usr/share/linphone cp -at debian/tmp/usr/share/linphone share/rootca.pem mkdir -p debian/tmp/usr/share/sounds/linphone cp -at debian/tmp/usr/share/sounds/linphone share/*.wav share/*.mkv cp -R -at debian/tmp/usr/share/sounds/linphone share/rings execute_before_dh_shlibdeps-arch: ./debian/shlibs-watchdog ./debian # shlibdeps generates a dependency to libsoci-core, but we actually need # the sqlite3 interface implementation execute_after_dh_shlibdeps-arch: sed -i s/libsoci-core/libsoci-sqlite3-/g debian/*.substvars