telegram/telegram.spec

179 lines
5.8 KiB
RPMSpec
Raw Normal View History

%define qt_ver 5.6.2
%define qt_patchver %(echo %qt_ver | tr . _)
%define qt_majver %(echo %qt_ver | cut -d. -f1-2)
Name: telegram
Version: 1.5.15
Release: 1mamba
Summary: The official desktop client for the Telegram messenger
Group: Graphical Desktop/Applications/Internet
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://telegram.org/
## GITSOURCE https://github.com/telegramdesktop/tdesktop.git v0.9.32
Source: https://github.com/telegramdesktop/tdesktop.git/v%{version}/tdesktop-%{version}.tar.bz2
Source1: telegramdesktop.desktop
Source2: tg.protocol
Source3: https://github.com/telegramdesktop/libtgvoip.git/tdesktop/libtgvoip-%{version}.tar.bz2
Source4: https://github.com/mapbox/variant.git/master/variant-%{version}.tar.bz2
Source5: https://github.com/philsquared/Catch.git/master/Catch-%{version}.tar.bz2
Source6: https://github.com/Microsoft/GSL.git/master/GSL-%{version}.tar.bz2
Source7: https://github.com/telegramdesktop/crl.git/master/crl-%{version}.tar.bz2
Source8: https://github.com/Cyan4973/xxHash.git/master/xxHash-%{version}.tar.bz2
Patch0: telegram-1.5.15-tdesktop.patch
Patch1: telegram-1.5.15-no-gtk2.patch
Patch2: telegram-1.5.15-libtgvoip.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libX11-devel
BuildRequires: libavcodec-ffmpeg-devel
BuildRequires: libavformat-ffmpeg-devel
BuildRequires: libavutil-ffmpeg-devel
BuildRequires: libgcc
BuildRequires: libglib-devel
BuildRequires: liblzma-devel
BuildRequires: libminizip-devel
BuildRequires: libopenal-devel
BuildRequires: libopenssl-devel
BuildRequires: libopus-devel
BuildRequires: libqt5-devel
BuildRequires: libstdc++6-devel
BuildRequires: libswresample-ffmpeg-devel
BuildRequires: libswscale-ffmpeg-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
BuildRequires: libbreakpad-devel
BuildRequires: libunity-devel
BuildRequires: range-v3-devel
Requires: kconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The official desktop client for the Telegram messenger.
%debug_package
%prep
#% setup -q -c -a0 -a3 -a4 -a5 -a6 -a7 -a8
%setup -q -c -D -T
:<< _EOF
mv tdesktop-%{version} tdesktop
cd tdesktop/Telegram/ThirdParty
#for f in "libtgvoip" "variant" "GSL" "Catch" "crl" "xxHash"; do
# rm -rf $f
# ln -s ../../../$f-%{version} $f
#done
cd ../..
%patch0 -p1
%patch1 -p1
cd Telegram/ThirdParty/libtgvoip
%patch2 -p1
cd ../../..
sed -i "s|include/qt/Qt|include/qt5/Qt|g" Telegram/gyp/qt.gypi
sed -i "s|appindicator3|appindicator|" Telegram/gyp/telegram_linux.gypi
cd ..
git clone https://chromium.googlesource.com/external/gyp gyp
cd gyp
git apply ../tdesktop/Telegram/Patches/gyp.diff
cd ..
#ln -s ../gyp Libraries/gyp
#
#mkdir -p Libraries/cmake-3.6.2/bin
#ln -s %{_bindir}/cmake Libraries/cmake-3.6.2/bin/cmake
%build
cd tdesktop
export LANG=en_US.UTF-8
export GYP_DEFINES="TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE,TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME,TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION"
export EXTRA_FLAGS="-Winvalid-pch"
export CPPFLAGS="%{optflags}"
export CXXFLAGS="%{optflags} -I%{_includedir}/qt5"
../gyp/gyp \
-Dapi_id=17349 \
-Dapi_hash=344583e45741c457fe1862106095a5eb \
-Dbuild_defines=${GYP_DEFINES} \
-Gconfig=Release \
--depth=Telegram/gyp \
--generator-output=../.. \
-Goutput_dir=out Telegram/gyp/Telegram.gyp \
--format=cmake
## Build Telegram Desktop
#cd gyp
#../../../Libraries/gyp/gyp \
# -Dlinux_path_qt="%{_builddir}/%{name}-%{version}/qt" \
# -Dlinux_lib_icu="-licuuc -licutu -licui18n" \
# -Dlinux_lib_ssl='-L%{_libdir}/openssl-1.0.1 -lssl' \
# -Dlinux_lib_crypto='-L%{_libdir}/openssl-1.0.1 -lcrypto' \
# -Dlinux_path_opus_include="%{_includedir}/opus" \
# --depth=. --generator-output=../.. -Goutput_dir=out Telegram.gyp --format=cmake
cd out/Release
sed -i "s|/usr/bin/moc |/usr/bin/moc-qt5 |" CMakeLists.txt
sed -i "s|/usr/lib/qt/|%{_libdir}/qt5/|g" CMakeLists.txt
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="%{optflags} -I%{_includedir}/qt5 -I%{_includedir}/qt5/mkspecs/linux-g++"
%make
#chrpath --delete Telegram
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
cd tdesktop
install -D -m755 out/Release/Telegram %{buildroot}%{_bindir}/telegram-desktop
install -D -m644 %{SOURCE1} %{buildroot}%{_datadir}/applications/telegram-desktop.desktop
install -D -m644 %{SOURCE2} %{buildroot}%{_kde5_servicesdir}/tg.protocol
for icon_size in 16 32 48 64 128 256 512; do
icon_dir="%{buildroot}%{_datadir}/icons/hicolor/${icon_size}x${icon_size}/apps"
install -D -m644 Telegram/Resources/art/icon${icon_size}.png $icon_dir/telegram-desktop.png
done
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_bindir}/telegram-desktop
%{_kde5_servicesdir}/tg.protocol
%{_datadir}/applications/telegram-desktop.desktop
%{_datadir}/icons/hicolor/*/apps/telegram-desktop.png
%doc tdesktop/LICENSE
%changelog
* Mon Mar 18 2019 Automatic Build System <autodist@mambasoft.it> 1.5.15-1mamba
- automatic version update by autodist
* Fri Oct 27 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.23-1mamba
- update to 1.1.23
* Tue Sep 13 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.10.6-1mamba
- update to 0.10.6
* Tue Mar 29 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.33-3mamba
- rebuilt (for latest ffmpeg deps on x86_64)
* Wed Mar 16 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.33-2mamba
- fix build tree organization
* Wed Mar 16 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.33-1mamba
- update to 0.9.33
* Tue Mar 15 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 0.9.32-1mamba
- package created using the webbuild interface