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
|
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -I/usr/include/jsoncpp
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
libpkgname := liblinphone12
# 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,$(libpkgname),YES,NO) # libsoci-dev
features += -DENABLE_ADVANCED_IM=$(call when-building-package,$(libpkgname),YES,NO) # libxerces-c-dev xsdcxx
features += -DENABLE_LDAP=$(call when-building-package,$(libpkgname),YES,NO) # libldap2-dev
features += -DENABLE_JPEG=$(call when-building-package,$(libpkgname),YES,NO) # libturbojpeg0-dev, libzxingcore-dev (>= 1.4.0~),
features += -DENABLE_CONSOLE_UI=ON
features += -DENABLE_FLEXIAPI=NO
features += -DENABLE_LIME=NO
features += -DENABLE_LIME_X3DH=$(call when-building-package,$(libpkgname),YES,NO) # liblime-dev
features += -DENABLE_UNIT_TESTS=NO
features += -DBUILD_SHARED_LIBS=ON
%:
dh $@ --buildsystem=cmake
override_dh_auto_configure:
if ! [ -f debian/$(libpkgname).shlibs ]; then \
echo "HINT: You must update d/rules to have the new soname!" | grep --color '^.*$$' >&2 ; \
false ; \
fi
ifeq (x,$(call when-building-package,$(libpkgname),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
|