File debian.rules of Package linphoneqt
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# Set debhelper options
DEB_BUILD_OPTIONS=nocheck
export pkgname=linphone
export _topdir=/usr/src/packages
export _builddir=$(_topdir)/BUILD
export _sourcedir=$(_topdir)/SOURCES
export uploaddir=/usr/src/packages/SOURCES
export srcdir=/usr/src/packages/SOURCES
export pkgdir_head=/usr/src/packages/BUILD/debian
#export pkgdir=$(pkgdir_head)/$(pkgname)
export pkgdir=$(pkgdir_head)/tmp
export buildroot=/usr/src/packages/BUILD/debian/tmp
#export buildroot=/usr/src/packages/BUILD/debian/$(pkgname)
# Add support for different Debian based distributions
export VERSION_CODENAME = $(shell cat /etc/os-release | grep VERSION_CODENAME | awk -F= '{print $$2}')
export VERSION_ID = $(shell cat /etc/os-release | grep VERSION_ID | awk -F= '{print $$2}')
export PRETTY_NAME=$(shell cat /etc/*-release | egrep "PRETTY_NAME" | cut -d = -f 2)
export ARCHITECTURE=$(shell dpkg --print-architecture)
export MY_DEB_BUILD_ARCH=$(shell dpkg-architecture -q DEB_BUILD_ARCH)
ifeq ($(findstring arm64,$(ARCHITECTURE)),arm64)
export ARCHTYPE=aarch64
export BUILDDIR=obj-$(ARCHTYPE)-linux-gnu
export LIBDIR=$(ARCHTYPE)-linux-gnu
endif
ifeq ($(findstring amd64,$(ARCHITECTURE)),amd64)
export ARCHTYPE=x86_64
export BUILDDIR=obj-$(ARCHTYPE)-linux-gnu
export LIBDIR=$(ARCHTYPE)-linux-gnu
endif
ifeq ($(findstring armhf,$(ARCHITECTURE)),armhf)
export ARCHTYPE=arm
export BUILDDIR=obj-$(ARCHTYPE)-linux-gnueabihf
export LIBDIR=$(ARCHTYPE)-linux-gnueabihf
endif
ifeq ($(findstring Raspbian,$(PRETTY_NAME)),Raspbian)
# Found
export PLATFORM=Raspbian
endif
ifeq ($(findstring Debian,$(PRETTY_NAME)),Debian)
# Not found
export PLATFORM=DebianOrUbuntu
endif
ifeq ($(findstring Ubuntu,$(PRETTY_NAME)),Ubuntu)
# Not found
export PLATFORM=DebianOrUbuntu
endif
export SOURCES_ARE_HERE=/usr/src/packages/BUILD/
export BUILD_IT_HERE=/usr/src/packages/BUILD/$(BUILDDIR)/
export _name=linphone
#export PACKAGE=linphoneqt
#export pkgname=$(PACKAGE)
#export VERSION=5.2.4
export pkgname=linphoneqt
export pkgver=$(shell head -6 $(uploaddir)/$(pkgname).dsc | grep Version | tr -d ' ' | cut -d: -f2 | cut -d- -f1)
export VERSION=$(pkgver)
#export PRETTY_NAME=$(shell cat /etc/*-release | egrep "PRETTY_NAME" | cut -d = -f 2)
#export pkgname=linphone-desktop
#export uploaddir=/usr/src/packages/SOURCES
#export pkgdir_head=/usr/src/packages/BUILD/debian
#export pkgdir=$(pkgdir_head)/$(pkgname)
#export pkgdir=$(pkgdir_head)/tmp
#export buildroot=/usr/src/packages/BUILD/debian/tmp
#export buildroot=/usr/src/packages/BUILD/debian/$(pkgname)
export icon=$(buildroot)/usr/share/icons/hicolor/scalable/apps/linphone.svg
export ispell_commit_hash=05574fe160222c3d0b6283c1433c9b087271fad1
%:
dh $@ --buildsystem=cmake
override_dh_auto_configure:
mkdir -pv $(BUILDDIR)
cp /usr/src/packages/SOURCES/$(_name).appdata.xml linphone.appdata.xml
# linphone-desktop wants to be built with liblinphone as a git submodule
# and includes its CMakeLists.txt, even though the submodule is not
# present during the build. Creating this file tricks cmake, while the
# dependencies are included from system packages instead.
touch linphone-sdk/CMakeLists.txt
# These files shadow the Config files installed by the respective devel
# packages and let the build fail since they expect to find the libraries
# in git submodules, which are not part of the archive.
rm linphone-app/cmake/FindMediastreamer2.cmake \
linphone-app/cmake/FindLibLinphone.cmake \
linphone-app/cmake/FindLinphoneCxx.cmake ;
mkdir -p $(BUILDDIR)/linphone-sdk/desktop/{bin,share}
# Fix building out-of-git
echo '#define LINPHONE_QT_GIT_VERSION "${PROJECT_VERSION}"' >> linphone-app/src/config.h.cmake
# Hardcode linphoneqt version
echo "project(linphoneqt VERSION $(VERSION))" > linphone-app/linphoneqt_version.cmake
if [[ $(VERSION) = 5.2.[0-9]* ]]; then \
sed -i '/^add_custom_command/s@${CMAKE_INSTALL_PREFIX}/include/@/usr/src/packages/BUILD/debian/tmp/usr/include/@;/^add_custom_command/s@${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/@/usr/src/packages/BUILD/debian/tmp/usr/lib/$(LIBDIR)/@' linphone-app/CMakeLists.txt; \
sed -i '/\/ui/s@${qml_dir}@${CMAKE_CURRENT_SOURCE_DIR}/../&@' linphone-app/cmake_builder/linphone_package/CMakeLists.txt; \
fi
rm -r external/ispell
#mkdir -pv external/ispell
mkdir -pv external
#tar -xvf $(uploaddir)/ispell-${ispell_commit_hash}.tar.gz -C external/ispell
tar -xf $(uploaddir)/ispell-${ispell_commit_hash}.tar.gz
mv ispell-${ispell_commit_hash} external/ispell
#cp -v $(uploaddir)/ispell-${ispell_commit_hash}.tar.gz external/ispell
patch -d "external/ispell" --forward --strip=1 --input="${uploaddir}/fix_ispell_return_type_error.patch"
#echo mkdir -pv $(BUILDDIR)/linphone-sdk/desktop/bin
#echo mkdir -pv $(BUILDDIR)/linphone-sdk/desktop/share/linphone
#echo mkdir -pv $(BUILDDIR)/linphone-sdk/desktop/share/sounds/linphone
mkdir -pv $(BUILDDIR)/bin
mkdir -pv $(BUILDDIR)/share/linphone
mkdir -pv $(BUILDDIR)/share/sounds/linphone
cmake -S /usr/src/packages/BUILD/ -B /usr/src/packages/BUILD/$(BUILDDIR)/ \
-DCMAKE_C_FLAGS="$${CMAKE_C_FLAGS} $${optflags} -O0 -g -fpic -ffat-lto-objects -fpermissive" \
-DCMAKE_CXX_FLAGS="$${CMAKE_CXX_FLAGS} $${optflags} -O0 -g -fpic -ffat-lto-objects -fpermissive" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--start-group -ljsoncpp" \
-DCMAKE_INSTALL_LIBDIR=lib/$(LIBDIR) \
-DCMAKE_BUILD_TYPE=Release \
-DLINPHONE_OUTPUT_DIR="/usr/src/packages/BUILD/$(BUILDDIR)/" \
-DMSPLUGINS_DIR="/usr/lib/$(LIBDIR)" \
-DLINPHONEAPP_VERSION=${pkgver} \
-DENABLE_UPDATE_CHECK=OFF \
-DENABLE_QT_KEYCHAIN=OFF \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_STRICT=OFF \
-DENABLE_BUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=YES \
-DENABLE_STATIC=OFF
override_dh_auto_install:
echo
echo "--- Start override_dh_auto_install: ---"
echo
cd $(BUILDDIR); \
cmake --install . --prefix /usr/src/packages/BUILD/debian/tmp/usr --strip
if [ -f $(pkgdir)/usr/lib/libapp-plugin.so ]; then \
mkdir -p -v $(pkgdir)/usr/lib/$(LIBDIR); \
mv -v $(pkgdir)/usr/lib/libapp-plugin.so $(pkgdir)/usr/lib/$(LIBDIR)/libapp-plugin.so; \
fi
if [ -f $(pkgdir)/usr/lib/libISpell.so ]; then \
mkdir -p -v $(pkgdir)/usr/lib/$(LIBDIR); \
mv -v $(pkgdir)/usr/lib/libISpell.so $(pkgdir)/usr/lib/$(LIBDIR)/libISpell.so; \
fi
echo "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"64\" version=\"1\">" > $(icon)
echo " <path style=\"opacity:0.2\" d=\"m 32,5 c -0.78188,0 -1.551046,0.039322 -2.316406,0.101562 -6.9222,0.4922802 -12.484081,3.0549814 -17.488282,8.050781 -4.1227994,4.116 -6.6776994,9.194719 -7.6874996,14.511719 -0.09302,0.48592 -0.166654,0.977996 -0.2343748,1.472656 -0.04094,0.30366 -0.086308,0.605516 -0.117188,0.910158 -0.06788,0.65334 -0.106346,1.314268 -0.128906,1.980468 -0.005,0.16788 -0.01362,0.335946 -0.01562,0.503906 C 4.0077188,32.68525 4,32.844 4,33 c 0,15.2532 12.076563,27.570562 27.226562,27.976562 0.11766,0.0034 0.23777,0.01 0.35547,0.0118 C 31.724032,60.991282 31.86,61 32,61 c 0.67422,0 1.341846,-0.03564 2.003906,-0.08204 0.08308,-0.0062 0.16308,-0.0086 0.246094,-0.0156 10.0028,-0.7894 18.473306,-6.796194 22.753906,-15.308594 0,0 0.004,-0.004 0.004,-0.004 0.2769,-0.55108 0.559902,-1.100496 0.800782,-1.671876 1.31076,-2.96 2.022944,-6.102024 2.152344,-9.390624 0.0056,-0.10624 0.0072,-0.213752 0.0118,-0.320312 0.0086,-0.31416 0.02554,-0.624588 0.02344,-0.941408 C 59.995894,33.175624 60,33.09 60,33 V 9.199219 C 60,6.872419 58.127582,5 55.800782,5 H 32.210938 Z\"/>" >> $(icon)
echo " <path style=\"fill:#f57f38\" d=\"m 32,4 c -0.78188,0 -1.551046,0.039322 -2.316406,0.101562 -6.9222,0.4922802 -12.484081,3.0549814 -17.488282,8.050781 -4.1227994,4.116 -6.6776994,9.194719 -7.6874996,14.511719 -0.09302,0.48592 -0.166654,0.977996 -0.2343748,1.472656 -0.04094,0.30366 -0.086308,0.605516 -0.117188,0.910158 -0.06788,0.65334 -0.106346,1.314268 -0.128906,1.980468 -0.005,0.16788 -0.01362,0.335946 -0.01562,0.503906 C 4.0077188,31.68525 4,31.844 4,32 c 0,15.2532 12.076563,27.570562 27.226562,27.976562 0.11766,0.0034 0.23777,0.01 0.35547,0.0118 C 31.724032,59.991282 31.86,60 32,60 c 0.67422,0 1.341846,-0.03564 2.003906,-0.08204 0.08308,-0.0062 0.16308,-0.0086 0.246094,-0.0156 10.0028,-0.7894 18.473306,-6.796194 22.753906,-15.308594 0,0 0.004,-0.004 0.004,-0.004 0.2769,-0.55108 0.559902,-1.100496 0.800782,-1.671876 1.31076,-2.96 2.022944,-6.102024 2.152344,-9.390624 0.0056,-0.10624 0.0072,-0.213752 0.0118,-0.320312 0.0086,-0.31416 0.02554,-0.624588 0.02344,-0.941408 C 59.995894,32.175624 60,32.09 60,32 V 8.1992188 C 60,5.872419 58.127582,4 55.800782,4 H 32.210938 Z\"/>" >> $(icon)
echo " <path style=\"opacity:0.2\" d=\"m 34.747,17.002876 c -0.70276,0 -1.28592,0.561239 -1.29262,1.241349 -0.0042,0.683208 0.5792,1.257729 1.28694,1.261247 3.0544,0.02294 5.5658,0.988176 7.5908,2.891696 2.0012,1.885862 3.0444,4.498728 3.071,7.90837 v 0.003 c 0.0072,0.678268 0.59086,1.23845 1.29546,1.23845 7.4e-5,0 0.0134,-0.0028 0.0142,-0.003 0.70618,-0.0064 1.29264,-0.5758 1.28692,-1.258408 v -0.003 c -0.016,-1.98979 -0.34,-3.817598 -0.972,-5.42543 -0.64,-1.624828 -1.612,-3.062278 -2.88,-4.258152 -2.506,-2.355953 -5.706,-3.573025 -9.39,-3.599022 h -0.0114 z m -13.1192,2.94009 c -0.4928,-0.08374 -1.02662,0.0078 -1.55966,0.264172 h -0.04262 l -0.05968,0.0341 c -0.9876,0.56154 -1.913601,1.314262 -2.781001,2.258362 l -0.06818,0.07386 v 0.06818 c -0.6,0.74812 -0.9968,1.501242 -1.088,2.255562 -0.02912,0.12784 -0.0284,0.243094 -0.0284,0.366442 0,0.343184 0.05044,0.691948 0.15626,1.033992 l 0.0284,0.09658 0.05966,0.0341 c 0.34258,1.175276 1.12,3.004284 2.821001,6.101758 1.13298,2.052984 2.2906,3.767804 3.4404,5.212652 0.60566,0.75936 1.29176,1.549978 2.088,2.346354 0.0094,0.0096 0.04304,0.04376 0.07956,0.0767 0.0126,0.0126 0.03036,0.03888 0.07386,0.0824 l 0.07954,0.07954 h 0.0058 c 0.02802,0.02804 0.04694,0.04838 0.05114,0.05398 l 0.0142,0.017 0.0142,0.0144 c 0.79628,0.787518 1.58166,1.477684 2.3494,2.079382 1.44274,1.149718 3.1574,2.316356 5.2102,3.451438 3.1012,1.7107 4.9474,2.483938 6.1164,2.820702 l 0.04262,0.05114 0.07104,0.02558 c 0.3312,0.1104 0.67584,0.16138 1.01704,0.15624 0.1384,0.0074 0.26094,-0.002 0.37784,-0.0284 0.8007,-0.09362 1.59352,-0.472692 2.3778,-1.130562 l 0.0086,-0.0114 0.0086,-0.0056 c 0.0122,-0.012 0.005,-0.0062 0.0114,-0.0144 0.007,-0.0062 0.01,-0.0136 0.0172,-0.02 0.92836,-0.847212 1.67766,-1.768634 2.2414,-2.755312 l 0.03692,-0.0625 v -0.05966 c 0.5178,-1.078148 0.3127,-2.178772 -0.5284,-2.880498 -0.0206,-0.0176 -0.42474,-0.355462 -0.92614,-0.76412 -0.51276,-0.417796 -1.12088,-0.908904 -1.53146,-1.210152 -0.77684,-0.57462 -1.97752,-1.317902 -2.662,-1.698702 h -0.0028 c -1.31456,-0.736122 -2.6882,-0.308328 -3.2926,0.47439 l -1.05966,1.326582 c -0.42736,0.538422 -1.2813,0.487068 -1.30398,0.485748 -7.1874,-1.848946 -9.1198,-9.075446 -9.1336,-9.126842 -0.0013,-0.02262 -0.05294,-0.877986 0.4858,-1.312382 l 1.32102,-1.056708 c 0.78466,-0.600898 1.2258,-1.974212 0.4858,-3.292254 -0.38604,-0.681428 -1.1326,-1.891062 -1.69886,-2.66172 h -0.0028 c -0.306,-0.412158 -0.796,-1.023694 -1.214,-1.53704 -0.208,-0.256572 -0.398,-0.491348 -0.536,-0.65893 -0.07,-0.0838 -0.126,-0.15138 -0.166,-0.19878 -0.02,-0.0237 -0.03662,-0.04036 -0.0483,-0.05398 -0.0058,-0.0068 -0.009,-0.0114 -0.0142,-0.017 -0.366,-0.434754 -0.832,-0.699526 -1.346,-0.786918 z m 13.196,2.880498 c -0.69314,-0.04888 -1.31594,0.47045 -1.36648,1.1391 -0.05058,0.66939 0.48946,1.266408 1.18182,1.315202 1.71216,0.12098 2.8676,0.624314 3.7358,1.542458 v 0.003 c 0.88622,0.935182 1.28946,2.00319 1.25568,3.462636 v 0.0056 c -0.015,0.671608 0.54838,1.24079 1.24432,1.255508 h 0.0312 c 0.68578,0 1.25746,-0.541304 1.27272,-1.204434 0.0469,-2.00619 -0.60658,-3.796202 -1.9233,-5.184056 -1.326,-1.394652 -3.2,-2.17597 -5.434,-2.334754 z\"/>" >> $(icon)
echo " <path style=\"fill:#ffffff\" d=\"m 34.747,16.002876 c -0.70276,0 -1.28592,0.561239 -1.29262,1.241349 -0.0042,0.683208 0.5792,1.257728 1.28694,1.261246 3.0544,0.02294 5.5658,0.988176 7.5908,2.891697 2.0012,1.885862 3.0444,4.498728 3.071,7.90837 v 0.003 c 0.0072,0.678268 0.59086,1.23845 1.29546,1.23845 7.4e-5,0 0.0134,-0.0028 0.0142,-0.003 0.70618,-0.0064 1.29264,-0.5758 1.28692,-1.258408 v -0.003 c -0.016,-1.98979 -0.34,-3.817598 -0.972,-5.42543 -0.64,-1.624828 -1.612,-3.062278 -2.88,-4.258153 -2.506,-2.355952 -5.706,-3.573024 -9.39,-3.599021 h -0.0114 z m -13.1192,2.940089 c -0.4928,-0.08374 -1.02662,0.0078 -1.55966,0.264172 h -0.04262 l -0.05968,0.0341 c -0.9876,0.56154 -1.913601,1.314263 -2.781001,2.258363 l -0.06818,0.07386 v 0.06818 c -0.6,0.74812 -0.9968,1.501242 -1.088,2.255562 -0.02912,0.12784 -0.0284,0.243094 -0.0284,0.366442 0,0.343184 0.05044,0.691948 0.15626,1.033992 l 0.0284,0.09658 0.05966,0.0341 c 0.34258,1.175276 1.12,3.004284 2.821001,6.101758 1.13298,2.052984 2.2906,3.767804 3.4404,5.212652 0.60566,0.75936 1.29176,1.549978 2.088,2.346354 0.0094,0.0096 0.04304,0.04376 0.07956,0.0767 0.0126,0.0126 0.03036,0.03888 0.07386,0.0824 l 0.07954,0.07954 h 0.0058 c 0.02802,0.02804 0.04694,0.04838 0.05114,0.05398 l 0.0142,0.017 0.0142,0.0144 c 0.79628,0.787518 1.58166,1.477684 2.3494,2.079382 1.44274,1.149718 3.1574,2.316356 5.2102,3.451438 3.1012,1.7107 4.9474,2.483938 6.1164,2.820702 l 0.04262,0.05114 0.07104,0.02558 c 0.3312,0.1104 0.67584,0.16138 1.01704,0.15624 0.1384,0.0074 0.26094,-0.002 0.37784,-0.0284 0.8007,-0.09362 1.59352,-0.472692 2.3778,-1.130562 l 0.0086,-0.0114 0.0086,-0.0056 c 0.0122,-0.012 0.005,-0.0062 0.0114,-0.0144 0.007,-0.0062 0.01,-0.0136 0.0172,-0.02 0.92836,-0.847212 1.67766,-1.768634 2.2414,-2.755312 l 0.03692,-0.0625 v -0.05966 c 0.5178,-1.078148 0.3127,-2.178772 -0.5284,-2.880498 -0.0206,-0.0176 -0.42474,-0.355462 -0.92614,-0.76412 -0.51276,-0.417796 -1.12088,-0.908904 -1.53146,-1.210152 -0.77684,-0.57462 -1.97752,-1.317902 -2.662,-1.698702 h -0.0028 c -1.31456,-0.736122 -2.6882,-0.308328 -3.2926,0.47439 l -1.05966,1.326582 c -0.42736,0.538422 -1.2813,0.487068 -1.30398,0.485748 -7.1874,-1.848946 -9.1198,-9.075446 -9.1336,-9.126842 -0.0013,-0.02262 -0.05294,-0.877986 0.4858,-1.312382 l 1.32102,-1.056708 c 0.78466,-0.600898 1.2258,-1.974212 0.4858,-3.292254 -0.38604,-0.681428 -1.1326,-1.891062 -1.69886,-2.66172 h -0.0028 c -0.306,-0.412158 -0.796,-1.023694 -1.214,-1.53704 -0.208,-0.256572 -0.398,-0.491348 -0.536,-0.658931 -0.07,-0.0838 -0.126,-0.15138 -0.166,-0.19878 -0.02,-0.0237 -0.03662,-0.04036 -0.0483,-0.05398 -0.0058,-0.0068 -0.009,-0.0114 -0.0142,-0.017 -0.366,-0.434754 -0.832,-0.699526 -1.346,-0.786918 z m 13.196,2.880499 c -0.69314,-0.04888 -1.31594,0.47045 -1.36648,1.1391 -0.05058,0.66939 0.48946,1.266408 1.18182,1.315202 1.71216,0.12098 2.8676,0.624314 3.7358,1.542458 v 0.003 c 0.88622,0.935182 1.28946,2.00319 1.25568,3.462636 v 0.0056 c -0.015,0.671608 0.54838,1.24079 1.24432,1.255508 h 0.0312 c 0.68578,0 1.25746,-0.541304 1.27272,-1.204434 0.0469,-2.00619 -0.60658,-3.796202 -1.9233,-5.184056 -1.326,-1.394652 -3.2,-2.17597 -5.434,-2.334754 z\"/>" >> $(icon)
echo " <path style=\"opacity:0.2;fill:#ffffff\" d=\"M 32 4 C 31.21812 4 30.448954 4.0393225 29.683594 4.1015625 C 22.761394 4.5938429 17.199514 7.1565441 12.195312 12.152344 C 8.0725131 16.268344 5.5176127 21.347062 4.5078125 26.664062 C 4.4147925 27.149983 4.3411563 27.642059 4.2734375 28.136719 C 4.2324975 28.440379 4.18713 28.742231 4.15625 29.046875 C 4.08837 29.700215 4.0499037 30.361144 4.0273438 31.027344 C 4.0223438 31.195224 4.0137188 31.36329 4.0117188 31.53125 C 4.007714 31.68525 4 31.844 4 32 C 4 32.121303 4.0101924 32.240032 4.0175781 32.359375 C 4.0210866 32.248684 4.0240493 32.137957 4.0273438 32.027344 C 4.0499037 31.361144 4.08837 30.700215 4.15625 30.046875 C 4.18713 29.742231 4.2324975 29.440379 4.2734375 29.136719 C 4.3411563 28.642059 4.4147925 28.149983 4.5078125 27.664062 C 5.5176127 22.347062 8.0725131 17.268344 12.195312 13.152344 C 17.199514 8.1565441 22.761394 5.5938429 29.683594 5.1015625 C 30.448954 5.0393225 31.21812 5 32 5 L 32.210938 5 L 55.800781 5 C 58.127581 5 60 6.872419 60 9.1992188 L 60 8.1992188 C 60 5.8724189 58.127581 4 55.800781 4 L 32.210938 4 L 32 4 z\"/>" >> $(icon)
echo "</svg>" >> $(icon)
execute_before_dh_auto_install:
echo "--- Start execute_before_dh_auto_install ---"
echo "--- End execute_before_dh_auto_install ---"
execute_after_dh_auto_install:
echo "--- Start execute_after_dh_auto_install ---"
find $(buildroot)/usr/bin
chrpath -d $(buildroot)/usr/bin/linphone
find $(buildroot)/usr/lib/$(LIBDIR)
chrpath -d $(buildroot)/usr/lib/$(LIBDIR)/libapp-plugin.so
echo "--- Files that will be packaged ---"
find $(buildroot)
echo "--- End files that will be packaged ---"
echo "--- End execute_after_dh_auto_install ---"