Blob Blame History Raw
%global origname Cutegram

%global commit bfdceb350b593bc26133e6f4e29ce84bf89952fb
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name:         cutegram
Version:      3.0
Release:      0.9git%{shortcommit}%{?dist}
Summary:      Cutegram is a telegram client by Aseman Land

# Bundled JS stuff:
# js-linkify: MIT
# js-twemoji: MIT and CC-BY-4.0
# awesome-fonts: MIT and OFL-1.0
License:        GPLv3+ and MIT and CC-BY-4.0 and OFL
URL:            https://github.com/Aseman-Land/%{origname}
Source0:        %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
# https://github.com/Aseman-Land/Cutegram/pull/233
Patch0001:      0001-Install-cutegram-binary-when-BinaryMode-is-enabled.patch
Patch0002:      0002-desktop-Exec-cutegram-when-binaryMode-is-enabled.patch
Patch0003:      0003-don-t-install-qmlFiles-when-binaryMode-is-enabled.patch

BuildRequires:  gcc-c++

BuildRequires:  qt5-qtbase-devel
BuildRequires:  qt5-qtdeclarative-devel

BuildRequires:  /usr/bin/desktop-file-validate

Provides:       bundled(js-linkify)
Provides:       bundled(js-twemoji)
Provides:       bundled(awesome-fonts)

Requires:       hicolor-icon-theme

Requires:       aseman-qt-tools%{?_isa}
Requires:       telegramqml%{?_isa}
Requires:       qt5-qtquickcontrols%{?_isa}
Requires:       qt5-qtgraphicaleffects%{?_isa}
Requires:       qt5-qtimageformats%{?_isa}

%description
A different telegram client from Aseman team. Cutegram forked from Sigram
by Sialan Labs. Cutegram project are released under the terms of the GPLv3
license.

%prep
%autosetup -n %{origname}-%{commit} -p1
mkdir %{_target_platform}

%build
pushd %{_target_platform}
  %qmake_qt5 PREFIX=%{_prefix} CONFIG+=binaryMode ..
popd
%make_build -C %{_target_platform}

%install
%make_install INSTALL_ROOT=%{buildroot} -C %{_target_platform}

%check
desktop-file-validate %{buildroot}%{_datadir}/applications/%{origname}.desktop

%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files
%license GPL.txt
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{origname}.desktop

%changelog
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0-0.9gitbfdceb3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0-0.8gitbfdceb3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0-0.7gitbfdceb3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Sat Aug 06 2016 Igor Gnatenko <ignatenko@redhat.com> - 3.0-0.6gitbfdceb3
- Update to latest snapshot
- Add runtime req: qt5-qtimageformats to display stickers

* Mon Jul 25 2016 Igor Gnatenko <ignatenko@redhat.com> - 3.0-0.5gitc67ce70
- Add Provides and License for awesome-fonts
- Run update-desktop-database due to MimeType in %%post and %%postun

* Sat Jul 23 2016 Igor Gnatenko <ignatenko@redhat.com> - 3.0-0.4git7294861
- Add missing Requires: qt5-qtgraphicaleffects

* Sat Jul 23 2016 Igor Gnatenko <ignatenko@redhat.com> - 3.0-0.3git7294861
- Apply patch to not install uncompressed qml files (we use one-binary mode)

* Sat Jul 23 2016 Igor Gnatenko <ignatenko@redhat.com> - 3.0-0.2git7294861
- Fix BuildRequires and Requires

* Sat Jul 23 2016 Vitaly Zaitsev <vitaly@easycoding.org> - 3.0-0.1git7294861
- Initial commit.