%global date 20151216
%global commit0 efa30f3
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
%global fetchpo l10n-fetch-po-files.py
%global X_display ":98"
%global _hardened_build 1
%bcond_with doxy
Name: trojita
Version: 0.5a
Release: 2.%{date}git%{shortcommit0}%{?dist}
# Almost everything: dual-licensed under the GPLv2 or GPLv3
# (with KDE e.V. provision for relicensing)
# src/XtConnect: BSD
# src/Imap/Parser/3rdparty/kcodecs.*: LGPLv2
# Nokia imports: LGPLv2.1 or GPLv3
# src/Imap/Parser/3rdparty/rfccodecs.cpp: LGPLv2+
# src/qwwsmtpclient/: GPLv2
## note that LGPL 2.1 short name is LGPLv2 according to
## https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
#License: GPLv2+ and LGPLv2+ and BSD
License: GPLv2+
Summary: IMAP e-mail client
URL: http://%{name}.flaska.net
#Source: http://downloads.sf.net/%{name}/%{name}-%{version}.tar.bz2
# git archive --remote git://anongit.kde.org/%{name} --prefix=%{name}-%{shortcommit0}/ --format=tar.gz -6 -o %{name}-%{shortcommit0}.tar.gz HEAD
Source0: %{name}-%{shortcommit0}.tar.gz
# use the script from above git to fetch l10n files, tar cf %{name}-l10n-%{date}.tar.gz po
Source1: %{name}-l10n-%{date}.tar.gz
Source2: http://quickgit.kde.org/?p=trojita.git&a=blob&f=%{fetchpo}&o=plain#/%{name}-%{fetchpo}
BuildRequires: cmake
BuildRequires: pkgconfig(zlib)
BuildRequires: help2man
BuildRequires: pkgconfig(Qt5WebKit)
BuildRequires: qtkeychain-qt5-devel
BuildRequires: qt5-qttools-devel
%if 0%{?fedora}
BuildRequires: ragel
%endif
%if %{with doxy}
BuildRequires: doxygen graphviz
%endif
# needs for %%check
BuildRequires: desktop-file-utils
%if 0%{?fedora}
BuildRequires: libappstream-glib
%endif
BuildRequires: xorg-x11-server-Xvfb
# provide some icons
Requires: hicolor-icon-theme
%description
Trojitá is a IMAP e-mail client which:
* Enables you to access your mail anytime, anywhere.
* Does not slow you down. If we can improve the productivity of an e-mail
user, we better do.
* Respects open standards and facilitates modern technologies. We value
the vendor-neutrality that IMAP provides and are committed to be as
inter-operable as possible.
* Is efficient — be it at conserving the network bandwidth, keeping memory
use at a reasonable level or not hogging the system's CPU.
* Can be used on many platforms. One UI is not enough for everyone, but our
IMAP core works fine on anything from desktop computers to cell phones
and big ERP systems.
* Plays well with the rest of the ecosystem. We don't like reinventing wheels,
but when the existing wheels quite don't fit the tracks, we're not afraid
of making them work.
This application is heavily based on Qt and uses WebKit.
%prep
%autosetup -n%{name}-%{shortcommit0} -a 1
# ignore unsupported translations
rm po/%{name}_common_ast.po po/%{name}_common_nds.po
%build
# change path for the library
# https://bugs.kde.org/show_bug.cgi?id=332579
%cmake \
-DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir}/%{name} \
-DCMAKE_INSTALL_RPATH=%{_libdir}/%{name} \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DWITH_QT5:BOOL=ON
%make_build
%if %{with doxy}
doxygen src/Doxyfile
%endif
%install
%make_install
%find_lang %{name}_common --with-qt
# generate manpage
mkdir -p %{buildroot}%{_mandir}/man1
help2man -o %{buildroot}%{_mandir}/man1/%{name}.1 --no-info --no-discard-stderr -h-h --version-string=%{version} ./%{name}
%check
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
# appstream is not available at EPEL
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml ||:
# do some fake X
# FIXME use xvfb-run
export DISPLAY=%{X_display}
Xvfb %{X_display} &
trap "kill $! || true" EXIT
export CTEST_OUTPUT_ON_FAILURE=BOOL:ON
ctest %{?_smp_mflags} --output-on-failure -VV
%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}_common.lang
%license LICENSE
%doc README src/Doxyfile
%{_mandir}/man1/%{name}.1*
%{_libdir}/%{name}/
%{_bindir}/%{name}
%{_bindir}/be.contacts
%{_datadir}/appdata/*.appdata.xml
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/32x32/apps/*.png
%{_datadir}/icons/hicolor/scalable/apps/*.svg
%if %{with doxy}
# optional developer documentation
%package doc
BuildArch: noarch
Summary: Documentation files for %{name}
%description doc
%{summary}.
%files doc
%license LICENSE
%doc _doxygen/*
%endif
%changelog
* Wed Dec 16 2015 Raphael Groner <projects.rg@smart.ms> - 0.5a-2.20151216gitefa30f3
- add QtKeyChain
- drop qt4
* Wed Dec 16 2015 Raphael Groner <projects.rg@smart.ms> - 0.5a-1.20151216gitefa30f3
- use latest upstream snapshot as post-release
- finally well Qt5.6 support!
* Sat Dec 12 2015 Raphael Groner <projects.rg@smart.ms> - 0.5-9
- add upstream patches for Qt5.x
* Mon Oct 05 2015 Raphael Groner <projects.rg@smart.ms> - 0.5-8
- add missing headers inclusion, rhbz#1266712
* Fri Jun 26 2015 Raphael Groner <projects.rg@smart.ms> - 0.5-7
- fix build conditional for optional doxygen
* Fri Jun 26 2015 Raphael Groner <projects.rg@smart.ms> - 0.5-6
- optional BR: at EPEL
* Wed Jun 24 2015 Raphael Groner <projects.rg@smart.ms> - 0.5-5
- add files validation
- use license GPLv2+ aggregated
- use build conditionals
- insert some comments
- insert BR: zlib-devel (optional imap compression)
* Wed Apr 01 2015 Raphael Groner <projects.rg@smart.ms> - 0.5-4
- reenable html formatting testcase
- optional doxygen
* Wed Apr 01 2015 Raphael Groner <projects.rg@smart.ms> - 0.5-3
- ease switching build with qt4 or qt5
- disable doxygen
- remove toolkit from summary
- use build subfolder
- improve tests execution
* Tue Mar 31 2015 Raphael Groner <projects.rg@smart.ms> - 0.5-2
- build for qt5
* Sat Feb 28 2015 Raphael Groner <projects.rg (AT) smart.ms> - 0.5-1
- clean files section and R: hicolor-icon-theme
- introduce license macro
- use name macro generally
- new upstream version 0.5
- distribute doxygen files
* Mon Oct 27 2014 Karel Volný <kvolny@redhat.com> 0.4.1-3
- Added ragel build requirement
* Mon Apr 14 2014 Karel Volný <kvolny@redhat.com> 0.4.1-2
- Fixed icon handling and added comments as per the package review
- https://bugzilla.redhat.com/show_bug.cgi?id=1080411#c2
* Tue Mar 25 2014 Karel Volný <kvolny@redhat.com> 0.4.1-1
- Initial Fedora version based on upstream OBS package