File datovka.spec of Package datovka

Name: datovka
Version: 4.17.0
Release: 1%{?dist}
Summary: A free graphical interface for Czech Databox (Datové schránky)

License: GPLv3+ with exceptions
URL: https://www.datovka.cz/
#Source0: https://secure.nic.cz/files/datove_schranky/%%{version}/datovka-%%{version}.tar.xz
Source0: datovka_%{version}.orig.tar.xz
%if 0%{?rhel}
# gcc in Centos 7 does not understand the -Wdate-time parameter
Patch0: 0002-Disable-Wdate-time-to-fix-FTBFS-with-older-gcc.patch
%endif

BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: desktop-file-utils
BuildRequires: libdatovka-devel >= 0.1.2
BuildRequires: openssl-devel
%if "x%{?rhel}" == "x"
BuildRequires: pkgconf-pkg-config
%endif
%if "x%{?rhel}" == "x"
BuildRequires: pkgconfig
%endif
BuildRequires: qt5-linguist
# qt5-qtbase provides SQLite driver
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qttools-devel
BuildRequires: sed
Requires: qt5-qttranslations

%description
GUI application allowing access to Czech Databox - an electronic communication
interface endorsed by the Czech government.

%prep
%setup -q
%if 0%{?rhel}
%patch0 -p1
%endif

%build
lrelease-qt5 datovka.pro
%{qmake_qt5} PREFIX=%{_prefix} DISABLE_VERSION_NOTIFICATION=1
make %{?_smp_mflags}

%install
mkdir -p %{buildroot}%{_bindir}
make install INSTALL_ROOT=%{buildroot}
%find_lang %{name} --with-qt
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop

#%%post
#/bin/touch --no-create %%{_datadir}/icons/hicolor &>/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

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

%files -f %{name}.lang
%if "x%{?rhel}" == "x"
%doc %{_pkgdocdir}
%endif
%if 0%{?rhel}
%doc %{_docdir}/%{name}
%endif
%{_bindir}/datovka
%{_datadir}/applications/datovka.desktop
%{_datadir}/metainfo/datovka.metainfo.xml
%{_datadir}/icons/hicolor/*/apps/datovka.png

%changelog
* Thu Mar 29 2018 Karel Slany <karel.slany@nic.cz> - 4.10.2-1
- see NEWS or https://www.datovka.cz/
- moved spec file to OBS
openSUSE Build Service is sponsored by