File debian.rules of Package linphone-desktop

#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# Get some information about the machine we are building on:
export numberOfProcessorsOnMachine=$(shell nproc)
export wantedJobs=$(shell echo "1.25*$(numberOfProcessorsOnMachine)" | bc -l)
export jobsIget=$(shell echo $(wantedJobs) | awk '{print int($$1+0.5)}')
#export numberOfProcessorsOnMachine=4
#export wantedJobs=4
#export jobsIget=$(shell nproc)
export TOTAL_DISK=$(shell df -h --total | awk 'END{print $$2}')
export FREEMEM=$(shell free --mega)
export TOTAL_MEM=$(shell free --total --mega | xargs | awk '{print $$19"MB"}')
export TOTAL_RAM=$(shell free --total --mega | xargs | awk '{print $$8"MB"}')
export TOTAL_SWAP=$(shell free --total --mega | xargs | awk '{print $$15"MB"}')
export DISTRO=$(shell awk -F= '/^NAME/{print $2}' /etc/os-release | cut -d'=' -f2)
export DISTROVERSION=$(shell awk -F= '/^VERSION_ID/{print $2}' /etc/os-release)
export THISMONTH=$(shell LC_TIME='en_US.UTF-8' date +%B)
export THISYEAR=$(shell date +%Y)
# 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 uname -m)"
# Variables
export executable=linphone
export pkgname=$(executable)-desktop
#export pkgver=$(shell head -n 1 /usr/src/packages/BUILD/debian/changelog | cut -d' ' -f 2 | sed 's/[(,)]//g' | cut -d'.' -f 1-3)
export pkgver=$(shell head -n 1 /usr/src/packages/BUILD/debian/changelog | cut -d' ' -f 2 | sed 's/[(,)]//g' | cut -d'-' -f 1 | cut -d'.' -f 1-3)
#export sdkver=$(shell head -n 1 /usr/src/packages/BUILD/debian/changelog | cut -d' ' -f 2 | sed 's/[(,)]//g' | cut -d'.' -f 1-3)
export sdkver=$(shell head -n 1 /usr/src/packages/BUILD/debian/changelog | cut -d' ' -f 2 | sed 's/[(,)]//g' | cut -d'-' -f 1 | cut -d'.' -f 1-3)
export install_rel_prefix=opt/$(executable)
export install_prefix=/$(install_rel_prefix)
# format manpage_date=January 2024
export manpage_date="$(THISMONTH) $(THISYEAR)"
export _topdir=/usr/src/packages
export _builddir=$(_topdir)/BUILD
#export _builddir=/usr/src/packages/BUILD
export _sourcedir=$(_topdir)/SOURCES
#export _sourcedir=/usr/src/packages/SOURCES
export _uploaddir=/usr/src/packages/SOURCES
export srcdir=/usr/src/packages/SOURCES
export pkgdir_head=$(_builddir)/debian
#export pkgdir_head=/usr/src/packages/BUILD/debian
#export pkgdir=$(pkgdir_head)/$(pkgname)
export pkgdir=$(pkgdir_head)/tmp
export pkgdir=/usr/src/packages/BUILD/debian/tmp
export buildroot=/usr/src/packages/BUILD/debian/tmp
export buildroot=$(_builddir)/debian/$(pkgname)
#export buildroot=$(pkgdir)
export _installToDir=$(pkgdir)
#export _installToDir=/usr/src/packages/BUILD/debian/tmp
ifeq ($(findstring Raspbian,$(PRETTY_NAME)),Raspbian)
    # Found
    export PLATFORM=Raspbian
    export BUILDDIR=obj-arm-linux-gnueabihf
    export LIBDIR=lib/arm-linux-gnueabihf
else
    # Not found
    export PLATFORM=DebianOrUbuntu
    export BUILDDIR=obj-x86_64-linux-gnu
    ifeq ($(findstring aarch64,$(ARCHITECTURE)),aarch64)
        export LIBDIR=lib/aarch64-linux-gnu
    else
        export LIBDIR=lib/x86_64-linux-gnu
    endif
endif
#export PLATFORM=DebianOrUbuntu
#export BUILDDIR=obj-x86_64-linux-gnu
#export LIBDIR=lib/x86_64-linux-gnu
# Set debhelper options
DEB_BUILD_OPTIONS=nocheck
# Ubuntu 24.04 has to compile with at least Qt 6.9.0
# VERSION_CODENAME=noble
# VERSION_ID=24.04
# PRETTY_NAME=Ubuntu 24.04 LTS
# export PATH="$(Qt6_ROOT_DIR)/bin:$(shell echo $PATH)"
# $(eval export PATH=$(Qt6_ROOT_DIR)/bin:$(PATH))
# export PATH=$(Qt6_ROOT_DIR)/bin:$(shell echo $$PATH)
export ORIGPATH=$(shell echo $$PATH)
#ifeq ($(findstring "Ubuntu 24.04 LTS",$(PRETTY_NAME)),"Ubuntu 24.04 LTS")
# Default:
export Qt6_LINK_LIB_DIRS=/opt/Qt6.9.0/lib:/opt/Qt6.9.1/lib:/opt/Qt6.9.2/lib
#export Qt6_ROOT_DIR=/opt/Qt6.9.0
export Qt6_DIR=/usr/$(LIBDIR)/cmake/Qt6
#export Qt6_DIR=$(Qt6_LIB_DIR)/cmake/Qt6
export TOOLCHAIN=/usr/$(LIBDIR)/cmake/Qt6/qt.toolchain.cmake
ifeq ($(findstring bookworm,$(VERSION_CODENAME)),bookworm)
    # Found
    export Qt6_ROOT_DIR=/opt/Qt6.9.2
    export Qt6_LIB_DIR=$(Qt6_ROOT_DIR)/lib
    export Qt6_DIR=$(Qt6_LIB_DIR)/cmake/Qt6
    export PATH=$(Qt6_ROOT_DIR)/bin:$(ORIGPATH)
    export TOOLCHAIN=$(Qt6_DIR)/qt.toolchain.cmake
endif
ifeq ($(findstring jammy,$(VERSION_CODENAME)),jammy)
    # Found
    export Qt6_ROOT_DIR=/opt/Qt6.9.2
    export Qt6_LIB_DIR=$(Qt6_ROOT_DIR)/lib
    export Qt6_DIR=$(Qt6_LIB_DIR)/cmake/Qt6
    export PATH=$(Qt6_ROOT_DIR)/bin:$(ORIGPATH)
    export TOOLCHAIN=$(Qt6_DIR)/qt.toolchain.cmake
endif
ifeq ($(findstring noble,$(VERSION_CODENAME)),noble)
    # Found
    export Qt6_ROOT_DIR=/opt/Qt6.9.2
    export Qt6_LIB_DIR=$(Qt6_ROOT_DIR)/lib
    export Qt6_DIR=$(Qt6_LIB_DIR)/cmake/Qt6
    export PATH=$(Qt6_ROOT_DIR)/bin:$(ORIGPATH)
    export TOOLCHAIN=$(Qt6_DIR)/qt.toolchain.cmake
endif
export script_four=$(pkgdir)/usr/local/bin/firejail-$(executable)-allow-opengl
export script_five=$(pkgdir)/usr/local/bin/firejail-$(executable)-allow-camera
export script_six=$(pkgdir)/usr/local/bin/firejail-$(executable)-reset
export proFile=\$$HOME/.config/firejail/$(executable).local
export icon=$(pkgdir)/usr/share/icons/hicolor/scalable/apps/$(pkgname).svg

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:

override_dh_auto_build:
	echo "--- Machine data we are building on ---"
	echo "Total disk: $$TOTAL_DISK"
	echo "Output of free -h:"
	echo "$$FREEMEM"
	echo "Total memory: $$TOTAL_MEM"
	echo "Total RAM: $$TOTAL_RAM"
	echo "Total SWAP: $$TOTAL_SWAP"
	echo "numberOfProcessorsOnMachine=$$numberOfProcessorsOnMachine"
	echo "wantedJobs=$$wantedJobs"
	echo "jobsIget=$$jobsIget"
	echo "--- End machine data we are building on ---"
	echo Qt6_DIR=$(Qt6_DIR)
	echo PATH=$(PATH)
	echo DISTRO=$(DISTRO)
	if [ "$(DISTRO)" = "Ubuntu" ] ; then echo "Distro is Ubuntu" ; fi
	if [ "$(DISTRO)" = "Debian" ] ; then echo "Distro is Debian" ; fi
	if [ "$(DISTRO)" = "Fedora" ] ; then echo "Distro is Fedora" ; fi
	# Not working
	#ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes)
	#echo "This is Ubuntu"
	#endif
	#ifeq ($(shell dpkg-vendor --is Debian && echo yes),yes)
	#echo "This is Debian"
	#endif
	echo "--- List variables ---"
	echo "DH_VERBOSE=$(DH_VERBOSE)"
	echo "DISTRO_VERSION=$(DISTRO_VERSION)"
	echo "DISTRO=$(DISTRO)"
	echo "DISTROVERSION=$(DISTROVERSION)"
	echo "TOTAL_SWAP=$(TOTAL_SWAP)"
	echo "VERSION_CODENAME=$(VERSION_CODENAME)"
	echo "VERSION_ID=$(VERSION_ID)"
	echo "PRETTY_NAME=$(PRETTY_NAME)"
	echo "PLATFORM=$(PLATFORM)"
	echo "ARCHITECTURE=$(ARCHITECTURE)"
	echo "BUILDDIR=$(BUILDDIR)"
	echo "LIBDIR=$(LIBDIR)"
	echo "THISMONTH=$(THISMONTH)"
	echo "THISYEAR=$(THISYEAR)"
	echo "executable=$(executable)"
	echo "pkgname=$(pkgname)"
	echo "install_prefix=$(install_prefix)"
	echo "manpage_date=$(manpage_date)"
	echo "_topdir=$(_topdir)"
	echo "_builddir=$(_builddir)"
	echo "_sourcedir=$(_sourcedir)"
	echo "_uploaddir=$(_uploaddir)"
	echo "srcdir=$(srcdir)"
	echo "pkgdir_head=$(pkgdir_head)"
	echo "pkgdir=$(pkgdir)"
	echo "buildroot=$(buildroot)"
	echo "_installToDir=$(_installToDir)"
	echo "pkgver=$(pkgver)"
	echo "sdkver=$(sdkver)"
	echo "icon=$(icon)"
	echo "--- End list variables ---"
	if [ "$(VERSION_CODENAME)" = "noble" ] || [ "$(VERSION_CODENAME)" = "bookworm" ]; then \
	    echo "Change file rules for Ubuntu 24.04:"; \
	    echo "------------------------------"; \
	    cp -v $(_uploaddir)/control /usr/src/packages/BUILD/debian/control; \
	    cat /usr/src/packages/BUILD/debian/control; \
	    echo "------------------------------"; fi
	ls -al /opt
	#find $(Qt6_DIR) -name qt.toolchain.cmake
	mkdir -p $(_builddir)
	#
	# For troubleshooting:
	# ls $(_uploaddir)
	# echo "changelog:"
	# echo "----------"
	# cat /usr/src/packages/BUILD/debian/changelog
	# echo "----------"
	# find /usr/src/packages -maxdepth 3
	# End for troubleshooting:
	#
	cp $(_uploaddir)/linphone-desktop.appdata.xml $(pkgname).appdata.xml
	#
	# Fix bugs
	#
	sed -i 's/LINPHONESDK_VERSION/LINPHONEAPP_SHORT_VERSION/g' Linphone/model/core/CoreModel.cpp
	#
	# Old no-git related code:
	# touch external/linphone-sdk/CMakeLists.txt
	# mkdir -p external/linphone-sdk/desktop/bin
	# mkdir -p external/linphone-sdk/desktop/share
	# Old: Fix building out-of-git
	# echo '#define LINPHONE_QT_GIT_VERSION "${PROJECT_VERSION}"' >> Linphone/config.h.cmake
	# Hardcode linphoneqt version
	# echo "project(Linphone VERSION $(pkgver) LANGUAGES CXX)" > Linphone/linphoneqt_version.cmake
	# Hardcode liblinphone version
	# echo "set(LINPHONESDK_VERSION $(pkgver))" >> Linphone/linphoneqt_version.cmake
	# End old no-git related code:
	#
	# export CFLAGS=$(echo "$CFLAGS -Wno-error=maybe-uninitialized -Wno-error=unused-parameter -Wno-error=return-type -Wno-error=implicit-function-declaration"); \
	# export CXXFLAGS=$(echo "$CXXFLAGS -Wno-error=maybe-uninitialized -Wno-error=unused-parameter -Wno-error=return-type -Wno-error=implicit-function-declaration"); \
	#
	# Fix out-of-git compilation by specifying LINPHONEAPP_VERSION=x.y.z and LINPHONESDK_VERSION=x.y.z
	# There is no way to find out which version liblinphone has (LINPHONESDK_VERSION).
	# LINPHONESDK_VERSION could be set to same value as package version just to avoid compilation error.
	# LINPHONESDK_STATE can be: snapshots releases or empty.
	# LINPHONESDK_BRANCH can be: alpha beta or empty. '-alpha.14' '-beta.12'
	#   -DBUILD_SHARED_LIBS=YES \
	#   -DENABLE_STATIC=OFF     \
	#   -DCMAKE_TOOLCHAIN_FILE=/usr/$(LIBDIR)/cmake/Qt6/qt.toolchain.cmake
	#   2025-02-01: LDAP has issues compiling
	#    May be needed for cmake:    
	#    -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN)
	cmake . \
	    -B build -S $(_builddir) \
	    -DCMAKE_C_COMPILER=/usr/bin/gcc \
	    -DCMAKE_CXX_COMPILER=/usr/bin/g++ \
	    -DCMAKE_C_FLAGS="-fpic -ffat-lto-objects -Wno-error=maybe-uninitialized -Wno-error=unused-parameter -Wno-error=return-type -Wno-error=implicit-function-declaration -Wno-error=deprecated-declarations" \
	    -DCMAKE_CXX_FLAGS="-fpic -ffat-lto-objects -fpermissive -Wno-error=maybe-uninitialized -Wno-error=unused-parameter -Wno-error=return-type -Wno-error=implicit-function-declaration -Wno-error=deprecated-declarations" \
	    -DCMAKE_BUILD_PARALLEL_LEVEL=$(jobsIget) \
	    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
	    -DENABLE_PQCRYPTO=YES \
	    -DCMAKE_SKIP_INSTALL_RPATH=YES \
	    -DENABLE_UPDATE_CHECK=OFF \
	    -DENABLE_APP_PACKAGE_ROOTCA=OFF \
	    -DLINPHONEAPP_VERSION=$(pkgver) \
	    -DLINPHONESDK_VERSION=$(sdkver) \
	    -DLINPHONESDK_STATE="snapshots" \
	    -DLINPHONESDK_BRANCH="-alpha.384" \
	    -DENABLE_LDAP=OFF \
	    -DENABLE_STRICT=OFF \
	    -DCMAKE_VERBOSE_MAKEFILE=ON \
	    -DENABLE_BUILD_VERBOSE=ON
	echo "Configuration should have completed here."
	cmake --build build --target install --parallel $(jobsIget) --config RelWithDebInfo
	echo "Build should have completed here."

override_dh_usrlocal:

override_dh_gencontrol:
ifeq ($(findstring bookworm,$(VERSION_CODENAME)),bookworm)
	dh_gencontrol -- '-Vmy:Depends='
endif
ifeq ($(findstring oracular,$(VERSION_CODENAME)),oracular)
	dh_gencontrol -- '-Vmy:Depends=qml6-module-qt-labs-platform, qml6-module-qtquick, qml6-module-qt-labs-platform, qml6-module-qtquick-controls, qml6-module-qtquick-dialogs, qml6-module-qtquick-layouts, qml6-module-qtquick-window, qml6-module-qtquick-shapes, qml6-module-qtqml-models, qml6-module-qtwebview, qml6-module-qtqml-workerscript, qml6-module-qtquick-effects, qml6-module-qtquick-templates, qml6-module-qtcore, libqt6core6t64, libqt6dbus6, libqt6gui6 | libqt6gui6-gles, libqt6network6, libqt6qml6, libqt6quick6 | libqt6quick6-gles, libqt6quickcontrols2-6, libqt6svg6, libqt6widgets6'
endif
ifeq ($(findstring noble,$(VERSION_CODENAME)),noble)
	dh_gencontrol -- '-Vmy:Depends='
endif
ifeq ($(findstring jammy,$(VERSION_CODENAME)),jammy)
	dh_gencontrol -- '-Vmy:Depends='
endif

#override_dh_shlibdeps:
#	LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):debian/packagename/opt/packagename dh_shlibdeps --dpkg-shlibdeps-params="--ignore-missing-info"

override_dh_shlibdeps:
	#dh_shlibdeps -O--buildsystem=cmake -v -l$(pkgdir)$(install_prefix)/lib:/opt/Qt6.5.3/lib:/opt/Qt6.6.2/lib:/opt/Qt6.6.3/lib:/opt/Qt6.7.3/lib:/opt/Qt6.8.3/lib:/opt/Qt6.9.0/lib:$(Qt6_LIB_DIR):$(_builddir)/build/OUTPUT/lib --dpkg-shlibdeps-params=--ignore-missing-info
	dh_shlibdeps -O--buildsystem=cmake -v -l$(pkgdir)$(install_prefix)/lib:$(Qt6_LIB_DIR):$(Qt6_LINK_LIB_DIRS):$(_builddir)/build/OUTPUT/lib --dpkg-shlibdeps-params=--ignore-missing-info

override_dh_auto_install:
	mkdir -pv "$(pkgdir)$(install_prefix)"
	echo "---Exchange nowebcamCIF.jpg ---"
	ls -al $(_builddir)/build/OUTPUT/share/images
	cp -v $(_uploaddir)/static.jpg $(_builddir)/build/OUTPUT/share/images/nowebcamCIF.jpg
	echo "--- Exchange nowebcamCIF.jpg ---"
	cp -v "${_uploaddir}/static.jpg" "$(_builddir)/build/OUTPUT/share/images/nowebcamCIF.jpg"
	# Alternative 2
	# Other programs such as emacs crash if libxml2.so* exists
	# in $(install_prefix)/lib so we remove it and
	# use system libxml2 instead
	# rm -vf "$(_builddir)/build/OUTPUT/lib/libxml2.so.2"
	# rm -vf "$(_builddir)/build/OUTPUT/lib/libxml2.so"
	# End Alternative 2
	echo "Copy all that has been successfully built ..."
	cp -rpv $(_builddir)/build/OUTPUT/* $(pkgdir)$(install_prefix)
	#cp -r "$(_builddir)/build/OUTPUT/." "$(pkgdir)$(install_prefix)"
	mkdir -p "$(pkgdir)/usr/share/applications/"
	#install -Dm644 "$(_builddir)/build/OUTPUT/share/applications/linphone.desktop" "$(pkgdir)/usr/share/applications/$(pkgname).desktop"
	install -Dm644 "$(_uploaddir)/desktop" "$(pkgdir)/usr/share/applications/$(pkgname).desktop"
	# Fix $(install_prefix)/bin/$(executable) not finding its libraries in ../lib/
	# Alternative 1
	# Add linphone's own lib folder to LD_LIBRARY_PATH
	echo "#!/bin/bash" > "$(pkgdir)$(install_prefix)/$(executable)-launcher"
	if [ "$(VERSION_CODENAME)" = "noble" ] || [ "$(VERSION_CODENAME)" = "bookworm" ]; then \
	    echo 'LD_LIBRARY_PATH="$(Qt6_LIB_DIR):$(install_prefix)/lib:$$LD_LIBRARY_PATH" "$(install_prefix)/bin/$(executable)" "$$@"' >> "$(pkgdir)$(install_prefix)/$(executable)-launcher"; \
	else \
	    echo 'LD_LIBRARY_PATH="$(install_prefix)/lib:$$LD_LIBRARY_PATH" "$(install_prefix)/bin/$(executable)" "$$@"' >> "$(pkgdir)$(install_prefix)/$(executable)-launcher"; fi
	chmod +x "$(pkgdir)$(install_prefix)/$(executable)-launcher"
	# End Alternative 1
	# cat "$(pkgdir)$(install_prefix)/share/applications/$(pkgname).desktop"
	# Edit .desktop file
	# [Desktop Entry]
	# Name=Linphone
	# GenericName=SIP Phone
	# Comment=A libre SIP client
	# Type=Application
	# Exec=linphone %u
	# Icon=linphone
	# Terminal=false
	# Categories=Network;Telephony;
	# MimeType=x-scheme-handler/sip-linphone;x-scheme-handler/sip;x-scheme-handler/sips-linphone;x-scheme-handler/sips;x-scheme-handler/tel;x-scheme-handler/callto;x-scheme-handler/linphone-config;
	# X-PulseAudio-Properties=media.role=phone
	echo "Edit .desktop :"
	# Alternative 1
	# sed -i "s|Exec=linphone|Exec=\/opt\/linphone\/linphone-launcher|g" "$(pkgdir)$(install_prefix)/share/applications/linphone.desktop"
	#sed -i "s|Exec=$(executable)|Exec=$(install_prefix)/$(executable)-launcher|g" "$(pkgdir)$(install_prefix)/share/applications/linphone.desktop"
	#sed -i "s|Exec=$(executable)|Exec=$(install_prefix)/$(executable)-launcher|g" "$(pkgdir)/usr/share/applications/$(pkgname).desktop"
	sed -i "s|Exec=.*|Exec=$(install_prefix)/$(executable)-launcher|g" "$(pkgdir)/usr/share/applications/$(pkgname).desktop"
	#sed -i "s|Icon=$(executable)|Icon=$(pkgname)|g" "$(pkgdir)/usr/share/applications/$(pkgname).desktop"
	sed -i "s|Icon=.*|Icon=$(pkgname)|g" "$(pkgdir)/usr/share/applications/$(pkgname).desktop"
	# Alternative 2
	# sed -i 's/Exec=linphone/Exec=\/opt\/linphone\/bin\/linphone/g' "$(pkgdir)$(install_prefix)/share/applications/linphone.desktop"
	# sed -i "s|Icon=.*|Icon=$(pkgname)|g" "$(pkgdir)$(install_prefix)/share/applications/linphone.desktop"
	# "/usr/src/packages/BUILD/debian/tmp/usr/share/applications/$(pkgname).desktop"
	# cat "$(pkgdir)$(install_prefix)/share/applications/$(pkgname).desktop"
	mkdir -pv "$(pkgdir)/usr/share/applications"
	#install -Dm644 "$(pkgdir)$(install_prefix)/share/applications/$(pkgname).desktop" "$(pkgdir)/usr/share/applications/$(pkgname).desktop"
	#mkdir -p "$(pkgdir)/usr/share/pixmaps/"
	#install -Dm644 "$(_uploaddir)/linphone.png" "$(pkgdir)/usr/share/pixmaps/$(pkgname).png"
	mkdir -pv "$(pkgdir)/usr/share/icons/hicolor/scalable/apps"
	#install -Dm644 "$(pkgdir)$(install_prefix)/share/icons/hicolor/scalable/apps/linphone.svg" "$(pkgdir)/usr/share/icons/hicolor/scalable/apps/$(pkgname).svg"
	echo "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"512\" height=\"512\"><defs><linearGradient id=\"d\"><stop offset=\"0\" stop-color=\"#eba936\"/><stop offset=\"1\" stop-color=\"#c95328\"/></linearGradient><linearGradient xlink:href=\"#a\" id=\"e\" x1=\"1012.513\" x2=\"1006.808\" y1=\"484.417\" y2=\"20.626\" gradientTransform=\"translate(-830.864 592.678) scale(1.03178)\" gradientUnits=\"userSpaceOnUse\"/><linearGradient id=\"a\" x1=\"45.448\" x2=\"45.448\" y1=\"92.54\" y2=\"7.017\" gradientTransform=\"matrix(1.00587 0 0 .99417 100 0)\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\"/><stop offset=\"1\" stop-opacity=\".588\"/></linearGradient><linearGradient xlink:href=\"#a\" id=\"f\" x1=\"1012.513\" x2=\"1006.808\" y1=\"484.417\" y2=\"20.626\" gradientTransform=\"translate(-837.951 592.518) scale(1.04025)\" gradientUnits=\"userSpaceOnUse\"/><linearGradient xlink:href=\"#a\" id=\"g\" x1=\"1012.513\" x2=\"1006.808\" y1=\"484.417\" y2=\"20.626\" gradientTransform=\"translate(-823.777 592.838) scale(1.0233)\" gradientUnits=\"userSpaceOnUse\"/><linearGradient xlink:href=\"#a\" id=\"h\" x1=\"1012.513\" x2=\"1006.808\" y1=\"484.417\" y2=\"20.626\" gradientTransform=\"translate(-816.69 592.997) scale(1.01483)\" gradientUnits=\"userSpaceOnUse\"/><linearGradient xlink:href=\"#a\" id=\"i\" x1=\"1012.513\" x2=\"1006.808\" y1=\"484.417\" y2=\"20.626\" gradientTransform=\"translate(-810.489 593.137) scale(1.00742)\" gradientUnits=\"userSpaceOnUse\"/><linearGradient xlink:href=\"#b\" id=\"k\" x1=\"993.439\" x2=\"988.786\" y1=\"51.512\" y2=\"363.738\" gradientTransform=\"translate(778.6 -360.56)\" gradientUnits=\"userSpaceOnUse\"/><linearGradient id=\"b\"><stop offset=\"0\" stop-color=\"#fff\"/><stop offset=\"1\" stop-color=\"#fff\" stop-opacity=\"0\"/></linearGradient><linearGradient xlink:href=\"#c\" id=\"l\" x1=\"1764.649\" x2=\"1763.69\" y1=\"155.597\" y2=\"-55.941\" gradientUnits=\"userSpaceOnUse\"/><linearGradient id=\"c\"><stop offset=\"0\"/><stop offset=\"1\" stop-color=\"#fff\" stop-opacity=\".2\"/></linearGradient><linearGradient xlink:href=\"#d\" id=\"j\" x1=\"390.75\" x2=\"390.75\" y1=\"482\" y2=\"30\" gradientUnits=\"userSpaceOnUse\"/></defs><g color=\"#000\" transform=\"translate(-11.985 -592.117)\"><rect width=\"487\" height=\"487\" x=\"31.985\" y=\"612.117\" fill=\"url(#e)\" opacity=\".1\" overflow=\"visible\" ry=\"101.458\" style=\"marker:none\"/><rect width=\"491\" height=\"491\" x=\"31.985\" y=\"612.117\" fill=\"url(#f)\" opacity=\".08\" overflow=\"visible\" ry=\"102.292\" style=\"marker:none\"/><rect width=\"483\" height=\"483\" x=\"31.985\" y=\"612.117\" fill=\"url(#g)\" opacity=\".2\" overflow=\"visible\" ry=\"100.625\" style=\"marker:none\"/><rect width=\"479\" height=\"479\" x=\"31.985\" y=\"612.117\" fill=\"url(#h)\" opacity=\".25\" overflow=\"visible\" ry=\"99.792\" style=\"marker:none\"/><rect width=\"475.5\" height=\"475.5\" x=\"31.985\" y=\"612.117\" fill=\"url(#i)\" opacity=\".25\" overflow=\"visible\" ry=\"99.063\" style=\"marker:none\"/></g><path fill=\"url(#j)\" d=\"M118.344 20C63.867 20 20 63.867 20 118.344v275.312C20 448.133 63.867 492 118.344 492h275.312C448.133 492 492 448.133 492 393.656V118.344C492 63.867 448.133 20 393.656 20H118.344z\"/><path fill=\"#fff\" d=\"M298.425 118.613c-4.792-.057-9.428.308-13.817 1.146-15.26 2.911-12.892 4.167 9.489 5.028 34.709 1.336 82.47 31.06 94.38 58.738 6.539 15.198 8.874 16.327 11.1 5.364 6.084-29.952-54.83-69.73-101.152-70.276z\"/><path fill=\"#fff\" d=\"M281.16 143.162a54.367 54.367 0 0 0-2.132.01c-8.116.21-25.936 5.466-39.599 11.679-24.619 11.194-24.514 11.254 11.53 6.778 43.548-5.408 85.14 13.978 99.678 46.461 7.023 15.692 12.134 19.037 18.767 12.284 20.882-21.258-43.186-76.597-88.245-77.212z\"/><path fill=\"#fff\" d=\"M252.097 186.196c-14.099-.032-27.38 2.807-36.187 9.363-12.147 9.041-9 10.21 21.188 7.874 22.75-1.761 41.388 1.89 52.014 10.187 19.145 14.948 28.98 16.82 28.98 5.516 0-18.894-34.976-32.868-65.994-32.94z\"/><path fill-opacity=\".196\" d=\"M267.658 254.096zm4.373 3.039c.01 4.153-3.261 12.485-8.73 25.81-12.143 29.586-11.856 31.3 9.011 53.473 29.26 31.09 41.148 77.259 29.301 113.8-8.529 26.31-18.598 39.685-31.006 41.782h123.05c27.773 0 52.785-11.406 70.636-29.803-91.796-92.201-176.782-187.324-192.262-205.062zm-47.578 16.375zm-8.57 2.148c-8.135 1.687-17.508 2.734-28.85 3.238 11.342-.504 20.715-1.551 28.85-3.238zm-83.69 2.987zm14.17.226c9.61.294 18.245.426 26.067.375-7.822.05-16.458-.081-26.067-.375zm-27.644-.023zm-41.249 3.933zm-9.972 2.004c-4.773 1.096-9.222 2.332-13.332 3.701 4.11-1.37 8.56-2.605 13.332-3.7zM50.17 289.9zm-7.297 3.092c-2.844 1.36-5.439 2.81-7.777 4.346 2.338-1.536 4.933-2.985 7.777-4.346zm-9.15 5.278zm-2.557 1.923zm-11.141 23.803c.006.296.02.57.028.852-.009-.285-.022-.552-.028-.852zm.118 2.709zm.147 1.613c.004.036.01.069.015.104l-.016-.104zm.163.977zm.953 2.406.032.04-.032-.04zm.454.475zm3.056.623c-.05.007-.1.012-.15.017.05-.006.1-.01.15-.017zm-1.018.064h.106-.106z\"/><path fill=\"#fff\" d=\"M268.725 253.946c-4.317.307-13.084 4.874-27.636 12.721-19.907 10.734-43.477 13.77-94.726 12.205C68.988 276.508 20 292.837 20 320.99c0 15.546.948 15.601 26.91 1.562 16.47-8.907 44.58-14.407 72.454-14.176 102.583.853 181.05 83.583 145.555 153.46-9.785 19.263-10.4 26.132-2.595 28.989 15.172 5.553 28.936-8.674 39.288-40.606 11.847-36.541-.04-82.71-29.299-113.8-20.867-22.173-21.155-23.888-9.012-53.474 8.537-20.799 11.734-29.448 5.424-28.999z\"/><path fill=\"#fff\" d=\"M59.676 371.008c-3.114.08-6.327.724-9.57 1.991-19.027 7.433-16.93 44.524 3.703 65.53 9.488 9.658 29.052 22.785 43.474 29.172 33.022 14.623 105.574 15.64 123.845 1.736 7.615-5.796 14.847-20.022 16.072-31.612 1.998-18.897-.764-21.072-26.751-21.072-23.461 0-28.983 3.21-28.983 16.857 0 12.625-6.236 17.41-24.84 19.051-38.128 3.364-66.245-15.15-66.245-43.624 0-22.514-13.894-38.465-30.705-38.03z\"/><g color=\"#000\"><path fill=\"url(#k)\" d=\"M1650.5-310.416c-54.477 0-98.313 43.836-98.313 98.312V63.24c0 54.477 43.836 98.344 98.312 98.344h2.938c-53.323 0-96.25-42.928-96.25-96.25v-269.5c0-53.323 42.927-96.25 96.25-96.25h269.5c53.322 0 96.25 42.927 96.25 96.25v269.5c0 53.322-42.928 96.25-96.25 96.25h2.906c54.477 0 98.344-43.867 98.344-98.344v-275.344c0-54.476-43.867-98.312-98.344-98.312H1650.5z\" opacity=\".5\" overflow=\"visible\" style=\"marker:none\" transform=\"translate(-1532.187 330.416)\"/><path fill=\"url(#l)\" d=\"M1650.5 161.584c-54.477 0-98.313-43.836-98.313-98.313v-275.343c0-54.477 43.836-98.344 98.312-98.344h2.938c-53.323 0-96.25 42.927-96.25 96.25v269.5c0 53.322 42.927 96.25 96.25 96.25h269.5c53.322 0 96.25-42.928 96.25-96.25v-269.5c0-53.323-42.928-96.25-96.25-96.25h2.906c54.477 0 98.344 43.867 98.344 98.344V63.27c0 54.477-43.867 98.313-98.344 98.313H1650.5z\" opacity=\".2\" overflow=\"visible\" style=\"marker:none\" transform=\"translate(-1532.187 330.416)\"/></g></svg>" > "$(icon)"
	#echo "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:space=\"preserve\" width=\"512\" height=\"512\" viewBox=\"0 0 135.467 135.467\"><defs><linearGradient id=\"a\"><stop offset=\"0\" style=\"stop-color:#000;stop-opacity:1\"/><stop offset=\"1\" style=\"stop-color:#275e18;stop-opacity:1\"/></linearGradient><linearGradient xlink:href=\"#a\" id=\"b\" x1=\"46.497\" x2=\"103.506\" y1=\"66.821\" y2=\"66.821\" gradientUnits=\"userSpaceOnUse\"/></defs><path d=\"M11.32 135.467C5.233 135.44.027 130.44 0 125.469V9.958C-.009 4.588 4.966-.034 9.96 0H125.507c5.433.06 9.934 5.37 9.961 9.958v115.511c-.05 5.285-5.284 9.946-9.96 9.957l-56.113.038c-30.862.02-58.073.003-58.073.003z\" style=\"fill:#eb6608;stroke:none;stroke-width:.287295;-inkscape-stroke:none;stop-color:#000;fill-opacity:1\"/><path d=\"M90.655 26.395c11.131 4.975 19.654 10.91 25.642 17.857 12.664 14.692 16.2 33.49 9.396 49.947-4.025 9.736-9.216 15.582-18.01 20.284-12.216 6.53-26.978 7.371-44.028 2.506-7.823-2.233-14.784-5.324-20.87-9.269l-2.297-1.488-16.33 1.741c-8.98.958-16.343 1.536-16.36 1.283-.017-.252 3.081-4.668 6.886-9.814 3.804-5.145 6.98-9.578 7.059-9.85.078-.273-1.427-3.29-3.343-6.704-6.284-11.196-7.906-19.586-6.043-31.263 1.776-11.14 7.894-19.649 18.605-25.875 9.134-5.31 17.626-7.4 28.922-7.113 4.728.12 6.84.503 15.653 2.846 6.944 1.846 11.757 3.41 15.118 4.912zm-19.455.367c-6.987-1.096-10.64-1.046-18.047.244-5.89 1.026-7.48 1.568-11.836 4.032-5.869 3.32-9.45 6.906-12.274 12.29-2.932 5.588-3.454 12.086-1.677 20.894 2.893 14.34 12.246 25.63 29.421 35.517 3.642 2.097 5.772 2.91 13.178 5.029 7.992 2.286 9.417 2.543 14.949 2.694 7.31.2 11.006-.256 16.655-2.053 10.195-3.242 16.958-10.214 19.91-20.528 1.133-3.958 1.784-10.525 1.383-13.953-.455-3.885-2.804-10.689-5.061-14.654-2.225-3.909-6.84-9.758-10.062-12.752-8.312-7.724-23.585-14.73-36.54-16.76Z\" style=\"fill:url(#b);stroke-width:1.4097;stroke:#fff;stroke-opacity:1;stroke-dasharray:none;font-variation-settings:normal;opacity:1;vector-effect:none;fill-opacity:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;-inkscape-stroke:none;stop-color:#000;stop-opacity:1\"/><path d=\"M83.634 99.177c-1.865-2.429-4.071-8.828-4.128-11.972-.021-1.194.218-3.014.531-4.045.562-1.85.625-1.893 4.664-3.196 4.426-1.428 5.408-2.414 5.337-5.362-.043-1.788-1.94-7.12-3.86-10.849-2.452-4.762-9.11-12.735-11.681-13.989-.954-.465-5.191-1.517-5.29-1.314-.354.726-3.613 4.884-4.381 5.59-3.774 3.468-15.035-3.432-17.297-10.596-.55-1.747-.494-2.029.836-4.167.895-1.44 2.527-3.143 4.384-4.579 4.602-3.557 8.586-3.942 15.485-1.494 11.496 4.078 21.998 14.52 29.363 29.195 5.056 10.074 6.625 22.774 3.777 30.585-.838 2.3-1.251 2.848-3.505 4.654-4.1 3.285-9.553 5.132-11.848 4.013-.428-.209-1.502-1.322-2.387-2.474z\" style=\"fill:url(#b);stroke:#fff;stroke-width:1.40970347;stop-color:#000;fill-opacity:1;stroke-opacity:1;stroke-dasharray:none\"/></svg>" > "$(icon)"
	# done already: sed -i "s|Icon=.*|Icon=$(pkgname)|g" "$(pkgdir)/usr/share/applications/$(pkgname).desktop"
	# Alternative 2
	# Fix $(install_prefix)/bin/linphone not finding its libraries in ../lib/
	# Create linphone-desktop.conf and let ldconfig find those libraries
	# mkdir -p "$(pkgdir)/etc/ld.so.conf.d"
	# echo "$(install_prefix)/lib" > "$(pkgdir)/etc/ld.so.conf.d/$(pkgname).conf"
	# chmod 644 "$(pkgdir)/etc/ld.so.conf.d/$(pkgname).conf"
	# End Alternative 2
	mv -v $(pkgdir)$(install_prefix)/bin/linphone6 $(pkgdir)$(install_prefix)/bin/$(executable)
	echo "--- Show files that will be packaged ---"
	echo "find debian"jammy
	find $(pkgdir) | sed "s|$(pkgdir)||g"
	echo "--- End show files that will be packaged ---"
openSUSE Build Service is sponsored by