1
0
telegram-desktop/telegram-desktop.spec

255 lines
9.0 KiB
RPMSpec
Raw Normal View History

#
# spec file for package telegram-desktop
#
# Copyright (c) 2018 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 https://bugs.opensuse.org
#
Name: telegram-desktop
Accepting request 597205 from home:13ilya - Update to 1.2.17 * Bug fixes and other minor improvements. - Update to 1.2.15 * Discover new stickers. Type one emoji to see suggestions from popular sticker sets. Suggestions from your installed sticker sets will come first. * Search for Stickers. Click on the new search icon to access your sticker sets or find new ones. * Use fast reply button in group chats. * Select a message you want to reply to by pressing Ctrl+Up and Ctrl+Down. - Refresh spec-file via spec-cleaner and manual optimizations. * Add %license and %doc macros. * Remove Leap/SLE support for version < 15. * Increment to 4 GB of RAM for a more stable build. * Change Description and Summary. - Use -a instead of -b to \%setup to fix buing on openSUSE >= 1500; this behaviour changed with rpm 4.14. - Add BuildRequires: python2-base as python2 executable is needed for gyp scripts. It was being automatically pulled in for Factory, but not for Leap:15.0. - Add Requires: libqt5-qtimageformats; required to show images of any kind (emoji, stickers, etc.) in the interface since the switch to system Qt5. - Update to version 1.2.6: * Grouped Photos: Group media into an album when sharing multiple photos and videos. Choose the exact order of media you send. * Bug fixes and other minor improvements. - Add crl-master.zip from https://github.com/telegramdesktop/crl and copy it to build dir appropriately; this is now required for building. - Rebase tdesktop.patch. - Update to version 1.2.1: * Bug fixes and other minor improvements. - update patch.py to remove dee-1.0 dependency, which is not in use any more, and not available from factory, thus resolving unresolvable status. - Update minimal versions of gcc and cmake in BuildRequires in keeping with upstream: gcc >= 7 (7.2) is now needed. Also update the gcc command exported before building on openSUSE <= 1320 to gcc-7. - Update to version 1.2.0: * Radically improved navigation. New side panel on the right with quick access to shared media and group members. * Saved Messages. Bookmark messages by forwarding them to "Saved Messages". Access them from the Chats list or from the side menu. * Pinned Messages. If you are a channel admin, pin messages to focus your subscribers' attention on important announcements. * Easily recognize messages from group admins by the new 'admin' badge. * Also supported clearing history in supergroups and added a host of minor improvements. - Disable parallel make for main app because the build job becomes terribly slow, and eventually runs out of memory otherwise. - Update to version 1.1.23: * See the message author photo and name while searching specific chat messages. * Fix "Send To" menu action on Windows. - Rebase and rename patch-1.1.19.diff to patch-1.1.23.diff. - Add catch.hpp as source and copy to required dir; remove includes referring to subdirs of catch as we are using the one header version. - Refresh all third-party sources to their current versions. - Add breakpad-ucontext_t-glibc2_26.patch: Replace `struct ucontext` by `ucontext_t` to make breakpad compatible with glib-2.26; merged upstream as commit e3035bc; only apply for openSUSE > 1320. - 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). - Update to version 1.1.18: * Minor bug fixes. - Update name of patch-1.1.17.diff to patch-1.1.18.diff (no rebase was needed). - Update to version 1.1.17: * Minor bug fixes. - Update to version 1.1.16: * Autocompletion for emoji. Start typing :e to get suggestions. * Fixed a bug with forwarding messages. - Update patch-1.1.15.diff to patch-1.1.17.diff (minor rebase). - Update to version 1.1.15: * Send bold and italic text in your messages. * Get a share link for posts in public supergroups. * Quickly share posts from channels and media messages from bots. * Search large supergroup members by name. * Search channel members by name for admins. * Use search in the service actions log. * Ban supergroup members via the right click menu in the service actions log. - Update name of patch-1.1.10.diff to patch-1.1.15.diff (no rebase was needed). - Use post(un) scriptlets to update hicolor icon-theme cache, and the desktop database; without these the desktop menu icon does not get registered to the icon and picks up a default ugly icon, until subsequent installation of other programs or manual invocation of the commands corresponding to these scriptlets. - Update to version 1.1.10: * Add event log filter for channel or supergroup event log. * Fix search by username in privacy exceptions editor. * Fix adding admins in channels. - Update to version 1.1.9: * Supergroups can now have up to 10.000 members. * Appoint supergroup admins with granular rights. Choose who can add users, manage messages, block members, edit group info & username, add new admins, etc. * Restrict and ban supergroup members with granular precision. Read-only bans, GIF & sticker bans, media bans, temporary bans and restrictions. * Check the new event log to see all service actions taken by members and admins of a channel or supergroup in the last 48 hours. * Toggle night mode in the main menu. - Rebase patch-%{version}.diff for updated version. - Enforce strict version dependence for BuildRequires on libtelegram-qt5-devel-static = 5.6.2, since telegram does not build with older versions any more. Pass -Dqt_version="5.6.2" instead of -Dqt_version="5.6.0" when configuring for build with gyp. - For openSUSE Leap, use gcc6 from the Update repository (gcc6 from OSS is uninstallable). - Add a _constraints file to restrict building to hardware with at 2 GB of physical memory. - Update to version 1.1.7. - Add libtgvoip.zip to sources, required to build Telegram - Rebase patch-1.0.29.diff for updated version; rename to patch-%{version}.diff. - New BuildRequires: pkgconfig(libpulse), pkgconfig(alsa); needed to build Telegram with audio/video support. - Update to version 1.0.29. - Use full URL for telegram-desktop source. - Require gcc-c++ >= 5.0, since support for -std=gnu++14 is now required; on openSUSE versions <= 1320 using gcc5 or gcc6 nonetheless leads to build failures. - Update icon file name in keeping with upstream. - Rebase patch-1.0.24.diff for updated version; rename it to patch-1.0.29.diff. - Add %post scriptlets to update icon theme cache and desktop database (BuildRequires: hicolor-icon-theme, Requires(post): desktop-file-utils). - Use full URL for source. - Run through spec-cleaner to clean up spec file according to openSUSE guidelines. - Upgrade to 0.9.56 - Fixed photo viewer to handle screen resolution change correctly. - Fixed forwarding photos via drag-n-drop. - Various design improvements and other bug fixes. - 0.9.48 Initial Commit. OBS-URL: https://build.opensuse.org/request/show/597205 OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=37
2018-04-16 21:10:42 +02:00
Version: 1.2.17
Release: 0
Summary: Telegram is a messaging app with a focus on speed and security
License: GPL-3.0-only
Group: Productivity/Networking/Instant Messenger
URL: https://github.com/telegramdesktop/tdesktop
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
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
Source2: linux-syscall-support-refs-heads-master.tar.gz
# curl https://chromium.googlesource.com/external/gyp/+archive/master.tar.gz -o gyp-master.tar.gz
Source3: gyp-master.tar.gz
Source4: patch.py
# curl https://codeload.github.com/Microsoft/GSL/zip/master -o GSL-master.zip
Source5: GSL-master.zip
# curl https://codeload.github.com/mapbox/variant/zip/master -o variant-master.zip
Source6: variant-master.zip
# curl https://codeload.github.com/grishka/libtgvoip/zip/public -o libtgvoip.zip
Source7: libtgvoip.zip
# curl https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp -o catch.hpp
Source8: catch.hpp
# curl https://codeload.github.com/ericniebler/range-v3/zip/master -o range-v3-master.zip
Source9: range-v3-master.zip
# curl https://codeload.github.com/telegramdesktop/crl/zip/master -o 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
Patch0: breakpad-ucontext_t-glibc2_26.patch
Patch1: tdesktop.patch
BuildRequires: chrpath
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: ffmpeg-devel
BuildRequires: fontconfig-devel
BuildRequires: freetype-devel
BuildRequires: gcc-c++
BuildRequires: glibc-devel
BuildRequires: libQt5Core-private-headers-devel
BuildRequires: libQt5DBus-devel
BuildRequires: libQt5Gui-private-headers-devel
BuildRequires: libQt5Network-devel
BuildRequires: libQt5Widgets-devel
BuildRequires: libXfixes-devel
BuildRequires: libexpat-devel
BuildRequires: libjpeg-devel
BuildRequires: libmng-devel
BuildRequires: libopus-devel
BuildRequires: libproxy-devel
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: libqt5-qtimageformats-devel
BuildRequires: libtiff-devel
BuildRequires: minizip-devel
BuildRequires: openal-soft-devel
BuildRequires: opusfile-devel
BuildRequires: pcre-devel
BuildRequires: pkgconfig
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: 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(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: libqt5-qtimageformats
Requires: openssl
ExclusiveArch: x86_64
%description
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
%setup -q -n tdesktop-%{version}
cp %{SOURCE8} Telegram/SourceFiles/base
# Already included in %{S:8}
sed -i "/catch_reporter_compact.hpp/d" Telegram/SourceFiles/base/tests_main.cpp
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/
cp %{_sourcedir}/range-v3-master.zip . && unzip range-v3-master.zip
mv range-v3-master range-v3
mkdir -p %{_builddir}/Libraries
mv range-v3 %{_builddir}/Libraries/
cp %{_sourcedir}/crl-master.zip . && unzip crl-master.zip
mv crl-master crl
mv crl %{_builddir}/tdesktop-%{version}/Telegram/ThirdParty/
cp %{_sourcedir}/tdesktop.patch %{_builddir}/tdesktop-%{version}
cd %{_builddir}/tdesktop-%{version}
patch -p1 < tdesktop.patch
cp %{_sourcedir}/patch.py . && python3 ./patch.py
cp %{_sourcedir}/catch.hpp ./Telegram/SourceFiles/
%setup -q -T -c -n breakpad -a 1
%setup -q -T -c -n breakpad-lss -a 2
%setup -q -T -c -n gyp -a 3
pushd %{_builddir}/breakpad/src
%patch0 -p1
popd
%build
mv %{_builddir}/tdesktop-%{version} %{_builddir}/tdesktop
# patch gyp
cd %{_builddir}/Libraries
ln -s %{_builddir}/gyp
cp %{_builddir}/tdesktop/Telegram/Patches/gyp.diff gyp
cd gyp
patch -p1 < gyp.diff
# Build breakpad
cd %{_builddir}/breakpad
ln -s %{_builddir}/breakpad-lss src/third_party/lss
# FIXME: you should use the %%configure macro
./configure --prefix=%{_builddir}/Libraries/breakpad
make %{?_smp_mflags}
make install
# FIXME: you should use %%cmake macros
# use gyp to generate cmake files
cd %{_builddir}/tdesktop/Telegram/gyp
# patch qt.gypi to change libxkbcommon path
%{_builddir}/Libraries/gyp/gyp \
-Dlinux_lib_ssl=-lssl \
-Dlinux_lib_crypto=-lcrypto \
-Dlinux_lib_icu="-licuuc -licutu -licui18n" \
-Dlinux_path_opus_include="%{_includedir}/opus" \
-Dlinux_path_breakpad="%{_builddir}/Libraries/breakpad" \
-Gconfig=Release \
--depth=. --generator-output="%{_builddir}/tdesktop" -Goutput_dir=out Telegram.gyp --format=cmake
# build Telegram
cd %{_builddir}/tdesktop/out/Release
# FIXME: you should use %%cmake macros
cmake -LA .
make %{?_smp_mflags}
chrpath --delete Telegram
%install
# Install binary
install -dm755 %{buildroot}%{_bindir}
install -m755 %{_builddir}/tdesktop/out/Release/Telegram %{buildroot}%{_bindir}/%{name}
# 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(0664,root,root,-)
%license LICENSE
%doc README.md
%attr(0755,root,root) %{_bindir}/%{name}
%{_datadir}/applications/telegramdesktop.desktop
%dir %{_datadir}/kde4
%dir %{_datadir}/kde4/services
%{_datadir}/kde4/services/tg.protocol
%{_datadir}/icons/hicolor/*/apps/telegram.png
%changelog