1
0

Accepting request 589791 from home:13ilya:branches:server:messaging

- Refresh spec-file via spec-cleaner and manual optimizations.
  * Add %license and %doc macros.
  * Remove Leap/SLE support for version < 15.
  * Change Description and Summary.

OBS-URL: https://build.opensuse.org/request/show/589791
OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=35
This commit is contained in:
Xu Zhao 2018-03-21 17:20:35 +00:00 committed by Git OBS Bridge
parent c6b51daab0
commit 1e18f3d0d8
3 changed files with 56 additions and 67 deletions

View File

@ -1,7 +1,7 @@
<constraints> <constraints>
<hardware> <hardware>
<physicalmemory> <physicalmemory>
<size unit="M">2048</size> <size unit="G">4</size>
</physicalmemory> </physicalmemory>
</hardware> </hardware>
</constraints> </constraints>

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Mar 20 21:31:30 UTC 2018 - ilya@ilya.pp.ua
- Refresh spec-file via spec-cleaner and manual optimizations.
* Add %license and %doc macros.
* Remove Leap/SLE support for version < 15.
* Change Description and Summary.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Feb 26 22:17:19 UTC 2018 - badshah400@gmail.com Mon Feb 26 22:17:19 UTC 2018 - badshah400@gmail.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package telegram-desktop # spec file for package telegram-desktop
# #
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -12,18 +12,17 @@
# license that conforms to the Open Source Definition (Version 1.9) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via https://bugs.opensuse.org
# #
Name: telegram-desktop Name: telegram-desktop
Version: 1.2.6 Version: 1.2.6
Release: 0 Release: 0
Summary: A new era of messaging Summary: Telegram is a messaging app with a focus on speed and security
License: GPL-3.0 License: GPL-3.0-only
Group: Productivity/Networking/Instant Messenger Group: Productivity/Networking/Instant Messenger
Url: https://github.com/telegramdesktop/tdesktop URL: https://github.com/telegramdesktop/tdesktop
Source: https://github.com/telegramdesktop/tdesktop/archive/v%{version}.tar.gz Source0: https://github.com/telegramdesktop/tdesktop/archive/v%{version}.tar.gz
# curl https://chromium.googlesource.com/breakpad/breakpad/+archive/refs/heads/master.tar.gz -o breakpad-master.tar.gz # curl https://chromium.googlesource.com/breakpad/breakpad/+archive/refs/heads/master.tar.gz -o breakpad-master.tar.gz
Source1: breakpad-master.tar.gz Source1: breakpad-master.tar.gz
# curl https://chromium.googlesource.com/linux-syscall-support/+archive/master.tar.gz -o linux-syscall-support-refs-heads-master.tar.gz # curl https://chromium.googlesource.com/linux-syscall-support/+archive/master.tar.gz -o linux-syscall-support-refs-heads-master.tar.gz
@ -39,36 +38,44 @@ Source6: variant-master.zip
Source7: libtgvoip.zip Source7: libtgvoip.zip
# curl https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp -o catch.hpp # curl https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp -o catch.hpp
Source8: catch.hpp Source8: catch.hpp
# curl https://codeload.github.com/ericniebler/range-v3/zip/master -o range-v3-master.zip # curl https://codeload.github.com/ericniebler/range-v3/zip/master -o range-v3-master.zip
Source9: range-v3-master.zip Source9: range-v3-master.zip
# curl https://codeload.github.com/telegramdesktop/crl/zip/master -o crl-master.zip # curl https://codeload.github.com/telegramdesktop/crl/zip/master -o crl-master.zip
Source10: crl-master.zip Source10: crl-master.zip
# PATCH-FIX-UPSTREAM breakpad-ucontext_t-glibc2_26.patch badshah400@gmail.com -- Replace `struct ucontext` by `ucontext_t` to make compatible with glib-2.26; merged upstream # PATCH-FIX-UPSTREAM breakpad-ucontext_t-glibc2_26.patch badshah400@gmail.com -- Replace `struct ucontext` by `ucontext_t` to make compatible with glib-2.26; merged upstream
Patch0: breakpad-ucontext_t-glibc2_26.patch Patch0: breakpad-ucontext_t-glibc2_26.patch
Patch1: tdesktop.patch Patch1: tdesktop.patch
BuildRequires: chrpath BuildRequires: chrpath
BuildRequires: cmake >= 3.2 BuildRequires: cmake
BuildRequires: glibc-devel
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
BuildRequires: ffmpeg-devel BuildRequires: ffmpeg-devel
BuildRequires: fontconfig-devel BuildRequires: fontconfig-devel
BuildRequires: freetype-devel BuildRequires: freetype-devel
BuildRequires: gcc-c++ >= 7 BuildRequires: gcc-c++
BuildRequires: python3 BuildRequires: glibc-devel
# python2-base is required for gyp [automatically pulled in for Factory, but added here for Leap:15.0, where it isn't] BuildRequires: libQt5Core-private-headers-devel
BuildRequires: python2-base BuildRequires: libQt5DBus-devel
BuildRequires: libQt5Gui-private-headers-devel
BuildRequires: libQt5Network-devel
BuildRequires: libQt5Widgets-devel
BuildRequires: libXfixes-devel BuildRequires: libXfixes-devel
BuildRequires: libexpat-devel BuildRequires: libexpat-devel
BuildRequires: libjpeg-devel BuildRequires: libjpeg-devel
BuildRequires: libmng-devel BuildRequires: libmng-devel
BuildRequires: libopus-devel BuildRequires: libopus-devel
BuildRequires: libproxy-devel BuildRequires: libproxy-devel
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: libqt5-qtimageformats-devel
BuildRequires: libtiff-devel BuildRequires: libtiff-devel
BuildRequires: minizip-devel
BuildRequires: openal-soft-devel BuildRequires: openal-soft-devel
BuildRequires: opusfile-devel BuildRequires: opusfile-devel
BuildRequires: pcre-devel BuildRequires: pcre-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: portaudio-devel BuildRequires: portaudio-devel
# python2-base is required for gyp, Auto pulled in for Tumbleweed, but need for Leap 15.
BuildRequires: python2-base
BuildRequires: python3
BuildRequires: unzip BuildRequires: unzip
BuildRequires: xcb-util-image-devel BuildRequires: xcb-util-image-devel
BuildRequires: xcb-util-keysyms-devel BuildRequires: xcb-util-keysyms-devel
@ -77,14 +84,6 @@ BuildRequires: xcb-util-wm-devel
BuildRequires: xorg-x11-devel BuildRequires: xorg-x11-devel
BuildRequires: xz BuildRequires: xz
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: libqt5-qtimageformats-devel
BuildRequires: libQt5Gui-private-headers-devel
BuildRequires: libQt5Core-private-headers-devel
BuildRequires: libQt5Network-devel
BuildRequires: libQt5Widgets-devel
BuildRequires: libQt5DBus-devel
BuildRequires: minizip-devel
BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(appindicator-0.1) BuildRequires: pkgconfig(appindicator-0.1)
BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(fontconfig)
@ -116,23 +115,24 @@ Requires: ffmpeg
Requires: hicolor-icon-theme Requires: hicolor-icon-theme
Requires: icu Requires: icu
Requires: jasper Requires: jasper
Requires: openssl
Requires: libqt5-qtimageformats Requires: libqt5-qtimageformats
Requires: openssl
ExclusiveArch: x86_64 ExclusiveArch: x86_64
%description %description
Telegram Desktop app. A new era of messaging. Telegram is a non-profit cloud-based instant messaging service.
Users can send messages and exchange photos, videos, stickers, audio and files of any type.
Its client-side code is open-source software but the source code for recent versions is not
always immediately published, whereas its server-side code is closed-source and proprietary.
The service also provides APIs to independent developers.
%prep %prep
%setup -q -n tdesktop-%{version} %setup -q -n tdesktop-%{version}
cp %{S:8} Telegram/SourceFiles/base/ cp %{SOURCE8} Telegram/SourceFiles/base
# Already included in %{S:8} # Already included in %{S:8}
sed -i "/catch_reporter_compact.hpp/d" Telegram/SourceFiles/base/tests_main.cpp sed -i "/catch_reporter_compact.hpp/d" Telegram/SourceFiles/base/tests_main.cpp
rm -rf %{_builddir}/tdesktop-%{version}/ThirdParty/*
cp %{_sourcedir}/GSL-master.zip . && unzip GSL-master.zip cp %{_sourcedir}/GSL-master.zip . && unzip GSL-master.zip
mv GSL-master GSL mv GSL-master GSL
mv GSL %{_builddir}/tdesktop-%{version}/Telegram/ThirdParty/ mv GSL %{_builddir}/tdesktop-%{version}/Telegram/ThirdParty/
@ -165,36 +165,25 @@ cp %{_sourcedir}/catch.hpp ./Telegram/SourceFiles/
%setup -q -T -c -n breakpad-lss -a 2 %setup -q -T -c -n breakpad-lss -a 2
%setup -q -T -c -n gyp -a 3 %setup -q -T -c -n gyp -a 3
%if 0%{?suse_version} > 1320
pushd %{_builddir}/breakpad/src pushd %{_builddir}/breakpad/src
%patch0 -p1 %patch0 -p1
popd popd
%endif
%build %build
# generate patch
# git diff --relative-directory=./a a b
# Setup compiler variables
mv %{_builddir}/tdesktop-%{version} %{_builddir}/tdesktop mv %{_builddir}/tdesktop-%{version} %{_builddir}/tdesktop
# patch gyp # patch gyp
cd %{_builddir}/Libraries cd %{_builddir}/Libraries
ln -s %{_builddir}/gyp ./gyp ln -s %{_builddir}/gyp
cp %{_builddir}/tdesktop/Telegram/Patches/gyp.diff ./gyp/ cp %{_builddir}/tdesktop/Telegram/Patches/gyp.diff gyp
cd gyp cd gyp
patch -p1 < ./gyp.diff patch -p1 < gyp.diff
# Build breakpad # Build breakpad
cd %{_builddir}/breakpad cd %{_builddir}/breakpad
ln -s %{_builddir}/breakpad-lss ./src/third_party/lss ln -s %{_builddir}/breakpad-lss src/third_party/lss
%if 0%{?suse_version} <= 1320
export CXX='g++-7'
export GCC='gcc-7'
%endif
# FIXME: you should use the %%configure macro # FIXME: you should use the %%configure macro
./configure --prefix=`pwd`/../Libraries/breakpad ./configure --prefix=%{_builddir}/Libraries/breakpad
make %{?_smp_mflags} make %{?_smp_mflags}
make install make install
@ -202,36 +191,26 @@ make install
# use gyp to generate cmake files # use gyp to generate cmake files
cd %{_builddir}/tdesktop/Telegram/gyp cd %{_builddir}/tdesktop/Telegram/gyp
# patch qt.gypi to change libxkbcommon path # patch qt.gypi to change libxkbcommon path
../../../Libraries/gyp/gyp \ %{_builddir}/Libraries/gyp/gyp \
%if 0%{?suse_version} <= 1320
-DCMAKE_CXX_COMPILER='g++-7' \
%endif
-Dlinux_lib_ssl=-lssl \ -Dlinux_lib_ssl=-lssl \
-Dlinux_lib_crypto=-lcrypto \ -Dlinux_lib_crypto=-lcrypto \
-Dlinux_lib_icu="-licuuc -licutu -licui18n" \ -Dlinux_lib_icu="-licuuc -licutu -licui18n" \
-Dlinux_path_opus_include="/usr/include/opus" \ -Dlinux_path_opus_include="%{_includedir}/opus" \
-Dlinux_path_breakpad="../../../Libraries/breakpad" \ -Dlinux_path_breakpad="%{_builddir}/Libraries/breakpad" \
-Gconfig=Release \ -Gconfig=Release \
--depth=. --generator-output="../../" -Goutput_dir=out Telegram.gyp --format=cmake --depth=. --generator-output="%{_builddir}/tdesktop" -Goutput_dir=out Telegram.gyp --format=cmake
# build Telegram # build Telegram
cd %{_builddir}/tdesktop/out/Release cd %{_builddir}/tdesktop/out/Release
# FIXME: you should use %%cmake macros # FIXME: you should use %%cmake macros
%if 0%{?suse_version} <= 1320 cmake -LA .
export CXX='g++-7' make %{?_smp_mflags}
export GCC='gcc-7'
CC=gcc-7 CXX=g++-7 cmake .
%else
cmake .
%endif
make #%%{?_smp_mflags}
chrpath --delete Telegram chrpath --delete Telegram
%install %install
# Install binary # Install binary
install -dm755 %{buildroot}%{_prefix}/bin install -dm755 %{buildroot}%{_bindir}
install -m755 %{_builddir}/tdesktop/out/Release/Telegram \ install -m755 %{_builddir}/tdesktop/out/Release/Telegram %{buildroot}%{_bindir}/%{name}
%{buildroot}%{_bindir}/telegram-desktop
# Install desktop file # Install desktop file
install -d %{buildroot}%{_datadir}/applications install -d %{buildroot}%{_datadir}/applications
@ -262,8 +241,10 @@ done
%desktop_database_postun %desktop_database_postun
%files %files
%defattr (-, root, root, -) %defattr(0664,root,root,-)
%{_bindir}/telegram-desktop %license LICENSE
%doc README.md
%attr(0755,root,root) %{_bindir}/%{name}
%{_datadir}/applications/telegramdesktop.desktop %{_datadir}/applications/telegramdesktop.desktop
%dir %{_datadir}/kde4 %dir %{_datadir}/kde4
%dir %{_datadir}/kde4/services %dir %{_datadir}/kde4/services