1
0
telegram-desktop/telegram-desktop.spec
Xu Zhao 53a244aea4 Accepting request 513769 from home:badshah400:branches:server:messaging
- Update to version 1.1.19:
  * Search by messages of specific group members.
  * Bug fixes and other minor improvements.
- Update name of patch-1.1.18.diff to patch-1.1.19.diff (no
  rebase was needed).

OBS-URL: https://build.opensuse.org/request/show/513769
OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=25
2017-08-02 22:20:30 +00:00

234 lines
6.9 KiB
RPMSpec

#
# spec file for package telegram-desktop
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: telegram-desktop
Version: 1.1.19
Release: 0
Summary: A new era of messaging
License: GPL-3.0
Url: https://github.com/telegramdesktop/tdesktop
Source: https://github.com/telegramdesktop/tdesktop/archive/v%{version}.tar.gz
Source1: breakpad-master.tar.gz
Source2: linux-syscall-support-refs-heads-master.tar.gz
Source3: gyp-master.tar.gz
Source4: patch-%{version}.diff
Source5: GSL-master.zip
Source6: variant-master.zip
# curl https://codeload.github.com/grishka/libtgvoip/zip/public -o libtgvoip.zip
Source7: libtgvoip.zip
BuildRequires: chrpath
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: ffmpeg-devel
BuildRequires: fontconfig-devel
BuildRequires: freetype-devel
%if 0%{?suse_version} <= 1320
BuildRequires: gcc6-c++ >= 6.2
BuildRequires: libgcc_s1 >= 6.2
%else
BuildRequires: gcc-c++ >= 5.0
%endif
BuildRequires: libXfixes-devel
BuildRequires: libexpat-devel
BuildRequires: libjpeg-devel
BuildRequires: libmng-devel
BuildRequires: libopus-devel
BuildRequires: libproxy-devel
BuildRequires: libtelegram-qt5-devel-static = 5.6.2
BuildRequires: libtiff-devel
BuildRequires: openal-soft-devel
BuildRequires: opusfile-devel
BuildRequires: pcre-devel
BuildRequires: pkgconfig
BuildRequires: portaudio-devel
BuildRequires: unzip
BuildRequires: xcb-util-image-devel
BuildRequires: xcb-util-keysyms-devel
BuildRequires: xcb-util-renderutil-devel
BuildRequires: xcb-util-wm-devel
BuildRequires: xorg-x11-devel
BuildRequires: xz
BuildRequires: zlib-devel
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(appindicator-0.1)
BuildRequires: pkgconfig(dee-1.0)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(harfbuzz)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavdevice)
BuildRequires: pkgconfig(libavfilter)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libva)
BuildRequires: pkgconfig(libva-glx)
BuildRequires: pkgconfig(libva-x11)
BuildRequires: pkgconfig(libwebp)
BuildRequires: pkgconfig(mtdev)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(tslib)
BuildRequires: pkgconfig(xcb-util)
BuildRequires: pkgconfig(xkbcommon)
BuildRequires: pkgconfig(xkbcommon-x11)
# Runtime requirements
Requires: ffmpeg
Requires: hicolor-icon-theme
Requires: icu
Requires: jasper
Requires: openssl
ExclusiveArch: x86_64
%description
Telegram Desktop app. A new era of messaging.
%prep
%setup -q -n tdesktop-%{version}
cp %{_sourcedir}/patch-%{version}.diff .
rm -rf %{_builddir}/tdesktop-%{version}/ThirdParty/*
cp %{_sourcedir}/GSL-master.zip . && unzip GSL-master.zip
mv GSL-master GSL
mv GSL %{_builddir}/tdesktop-%{version}/Telegram/ThirdParty/
cp %{_sourcedir}/variant-master.zip . && unzip variant-master.zip
mv variant-master variant
mv variant %{_builddir}/tdesktop-%{version}/Telegram/ThirdParty/
cp %{_sourcedir}/libtgvoip.zip . && unzip libtgvoip.zip
mv libtgvoip-public libtgvoip
mv libtgvoip %{_builddir}/tdesktop-%{version}/Telegram/ThirdParty/
%setup -q -T -c -n breakpad -b 1
%setup -q -T -c -n breakpad-lss -b 2
%setup -q -T -c -n gyp -b 3
%build
# generate patch
# git diff --relative-directory=./a a b
# Setup compiler variables
mv %{_builddir}/tdesktop-%{version} %{_builddir}/tdesktop
mkdir -p %{_builddir}/Libraries
# patch gyp
cd %{_builddir}/Libraries
ln -s %{_builddir}/gyp ./gyp
cp %{_builddir}/tdesktop/Telegram/Patches/gyp.diff ./gyp/
cd gyp
patch -p1 < ./gyp.diff
# Link with patched Qt Static Library
cd %{_builddir}/Libraries
ln -s %{_libdir}/libtelegram-qt5 ./QtStatic
# Build breakpad
cd %{_builddir}/Libraries
ln -s %{_builddir}/breakpad ./breakpad
cd breakpad
ln -s %{_builddir}/breakpad-lss ./src/third_party/lss
%if 0%{?suse_version} <= 1320
export CXX='g++-6'
export GCC='gcc-6'
%endif
# FIXME: you should use the %%configure macro
./configure
make %{?_smp_mflags}
# patch with patch.diff
cd %{_builddir}/tdesktop
patch -p1 < patch-%{version}.diff
# FIXME: you should use %%cmake macros
# use gyp to generate cmake files
cd %{_builddir}/tdesktop/Telegram/gyp
# patch qt.gypi to change libxkbcommon path
../../../Libraries/gyp/gyp \
-DCMAKE_CXX_COMPILER='g++-6' \
-Dlinux_path_qt="%{_builddir}/Libraries/QtStatic" \
-Dqt_version="5.6.2" \
-Dlinux_lib_ssl=-lssl \
-Dlinux_lib_crypto=-lcrypto \
-Dlinux_lib_icu="-licuuc -licutu -licui18n" \
--depth=. --generator-output="../../" -Goutput_dir=out Telegram.gyp --format=cmake
# build Telegram
cd %{_builddir}/tdesktop/out/Release
# FIXME: you should use %%cmake macros
%if 0%{?suse_version} <= 1320
export CXX='g++-6'
export GCC='gcc-6'
CC=gcc-6 CXX=g++-6 cmake .
%else
cmake .
%endif
make %{?_smp_mflags}
chrpath --delete Telegram
%install
# Install binary
install -dm755 %{buildroot}%{_prefix}/bin
install -m755 %{_builddir}/tdesktop/out/Release/Telegram \
%{buildroot}%{_bindir}/telegram-desktop
# Install desktop file
install -d %{buildroot}%{_datadir}/applications
desktop-file-install \
--dir %{buildroot}%{_datadir}/applications \
--add-category InstantMessaging \
%{_builddir}/tdesktop/lib/xdg/telegramdesktop.desktop
# Install protocol
install -d %{buildroot}%{_datadir}/kde4/services
install -m644 %{_builddir}/tdesktop/lib/xdg/tg.protocol \
%{buildroot}%{_datadir}/kde4/services/tg.protocol
# Install icons
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 "${icon_dir}"
install -m644 "%{_builddir}/tdesktop/Telegram/Resources/art/icon${icon_size}.png" \
"${icon_dir}/telegram.png"
done
%post
%icon_theme_cache_post
%desktop_database_post
%postun
%icon_theme_cache_postun
%desktop_database_postun
%files
%defattr (-, root, root, -)
%{_bindir}/telegram-desktop
%{_datadir}/applications/telegramdesktop.desktop
%dir %{_datadir}/kde4
%dir %{_datadir}/kde4/services
%{_datadir}/kde4/services/tg.protocol
%{_datadir}/icons/hicolor/*/apps/telegram.png
%changelog