File claws-mail.spec of Package claws-mail
#
# spec file for package claws-mail
#
# Copyright (c) 2017 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 http://bugs.opensuse.org/
#
%define gtk3_ready 0
%if !%{gtk3_ready}
%define favor_gtk2 1
%endif
%if 0%{?suse_version} >= 1330
%bcond_without vcalendar
%else
%bcond_with vcalendar
%endif
%bcond_with tnef
Name: claws-mail
Version: 3.16.0
Release: 0
URL: http://www.claws-mail.org/
Summary: A configurable email client
License: GPL-3.0+
Group: Productivity/Networking/Email/Clients
Source: http://www.claws-mail.org/download.php?file=releases/%{name}-%{version}.tar.xz
Patch: libcanberra-gtk3.patch
BuildRequires: NetworkManager-devel
BuildRequires: compface-devel
BuildRequires: db-devel
BuildRequires: docbook-utils
BuildRequires: enchant-devel
BuildRequires: fdupes
BuildRequires: gettext
BuildRequires: gmp-devel
BuildRequires: gpgme-devel
%if 0%{?favor_gtk2}
BuildRequires: gtk2-devel
BuildRequires: libcanberra-gtk-devel >= 0.6
%else
BuildRequires: gtk3-devel
BuildRequires: libcanberra-gtk3-devel >= 0.6
%endif
BuildRequires: libarchive-devel
BuildRequires: libcanberra-devel >= 0.6
BuildRequires: libcurl-devel
BuildRequires: libetpan-devel >= 0.57
BuildRequires: libexpat-devel
BuildRequires: libgcrypt-devel
BuildRequires: libgdata-devel >= 0.17.2
%if %{with vcalendar}
BuildRequires: libical-devel >= 2.0.0
%endif
BuildRequires: libpoppler-glib-devel
BuildRequires: librsvg-devel >= 2.40.5
BuildRequires: openldap2-devel
BuildRequires: pilot-link-devel
%if %{with tnef}
BuildRequires: libytnef-devel
%endif
BuildRequires: pkgconfig
BuildRequires: python-gtk-devel
BuildRequires: startup-notification-devel
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(dbus-1) >= 0.60
BuildRequires: pkgconfig(dbus-glib-1) >= 0.60
BuildRequires: pkgconfig(gnutls) >= 2.2
BuildRequires: pkgconfig(libnotify)
BuildRequires: pkgconfig(libsoup-2.4)
BuildRequires: pkgconfig(sm)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: pinentry-gtk2
%{?libperl_requires}
Recommends: %{name}-lang
Provides: sylpheed-claws = %{version}
Obsoletes: sylpheed-claws < %{version}
# The extra-plugin package was merged with version 3.9.1
Obsoletes: claws-mail-extra-plugins < %{version}
Provides: claws-mail-extra-plugins = %{version}
# The extra-plugin package was merged with version 3.9.1, also merge the -lang package
Obsoletes: claws-mail-extra-plugins-lang < %{version}
Provides: claws-mail-extra-plugins-lang = %{version}
%description
Claws Mail (previously known as Sylpheed-Claws) is a
configurable email client and news reader based on the GTK+ GUI
toolkit, and it runs on the X Window System.
When claws-mail is executed for the first time, a configuration "wizard"
(dialog) will appear prompting you for the minimum information necessary to
create a new account.
%package devel
Summary: Development files for claws-mail
License: GPL-2.0+
Group: Development/Libraries/C and C++
Provides: claws-mail:/usr/include/claws-mail/main.h
# The extra-plugin package was merged with version 3.9.1; as such, also the -devel package merged
Obsoletes: claws-mail-extra-plugins-devel < %{version}
Provides: claws-mail-extra-plugins-devel = %{version}
Requires: claws-mail = %{version}
Requires: enchant-devel
Requires: glib2-devel
Requires: gnutls-devel
Requires: gpgme-devel
Requires: gtk2-devel
Requires: libetpan-devel
Requires: openldap2-devel
%description devel
Claws Mail (previously known as Sylpheed-Claws) is a
configurable email client and news reader based on the GTK+ GUI
toolkit, and it runs on the X Window System.
This package contains header files for building plugins.
%lang_package
%prep
%setup -q
%if ! 0%{?favor_gtk2}
%patch -p1
%endif
sed -i 's/#!\/usr\/bin\/env python/#!\/usr\/bin\/python/' tools/*.py
sed -i 's/#!\/usr\/bin\/env bash/#!\/bin\/bash/' tools/*.sh
sed -i 's/#!\/usr\/bin\/env bash/#!\/bin\/bash/' tools/kdeservicemenu/install.sh
%build
%configure \
--docdir=%{_datadir}/claws-mail \
--disable-static \
%if !(0%{?favor_gtk2})
--enable-gtk3 \
%endif
--enable-ldap \
--enable-ipv6 \
--enable-jpilot \
--enable-acpi_notifier-plugin \
--enable-address_keeper-plugin \
--enable-archive-plugin \
--enable-att_remover-plugin \
--enable-attachwarner-plugin \
--enable-bogofilter-plugin \
--enable-bsfilter-plugin \
--enable-clamd-plugin \
--disable-fancy-plugin \
--enable-fetchinfo-plugin \
--enable-mailmbox-plugin \
--enable-newmail-plugin \
--enable-notification-plugin \
--enable-pdf_viewer-plugin \
--enable-perl-plugin \
--enable-python-plugin \
--enable-pgpcore-plugin \
--enable-pgpmime-plugin \
--enable-pgpinline-plugin \
--enable-rssyl-plugin \
--enable-smime-plugin \
--enable-spamassassin-plugin \
--enable-spam_report-plugin \
%if %{with tnef}
--enable-tnef_parse-plugin \
%else
--disable-tnef_parse-plugin \
%endif
%if %{with vcalendar}
--enable-vcalendar-plugin \
%else
--disable-vcalendar-plugin \
%endif
--disable-demo-plugin \
--enable-crash-dialog \
--enable-startup-notification \
--enable-compface \
--enable-libetpan
make %{?_smp_mflags}
%install
%makeinstall
# Clean up
rm %{buildroot}%{_libdir}/claws-mail/plugins/*.la
# install desktop file
%suse_update_desktop_file claws-mail
# we want to have the icon installed in /usr/share/pixmaps
mkdir -p %{buildroot}%{_datadir}/pixmaps/
cp claws-mail-64x64.png %{buildroot}%{_datadir}/pixmaps/
# Tools
cp -r tools %{buildroot}%{_datadir}/%{name}
rm %{buildroot}%{_datadir}/claws-mail/tools/Makefile*
# The ca-certificates are meant for windows. On Linux, it is not used and should not be distributed.
rm %{buildroot}%{_datadir}/claws-mail/tools/ca-certificates.crt
mv %{buildroot}%{_datadir}/claws-mail/tools/README ./README.tools
# fixing permissions
chmod 755 %{buildroot}%{_datadir}/claws-mail/tools/*
chmod 644 %{buildroot}%{_datadir}/claws-mail/tools/multiwebsearch.conf
%find_lang %{name} %{?no_lang_C}
%fdupes %{buildroot}%{_libdir}/%{name}/plugins/
install -d %{buildroot}%{_sysconfdir}/skel/.claws-mail/
cat <<EOF > %{buildroot}%{_sysconfdir}/skel/.claws-mail/clawsrc
[Plugins_GTK2]
%{_libdir}/claws-mail/plugins/pgpcore.so
%{_libdir}/claws-mail/plugins/pgpinline.so
%{_libdir}/claws-mail/plugins/pgpmime.so
%{_libdir}/claws-mail/plugins/smime.so
EOF
%if 0%{?suse_version} > 1130
%post
%desktop_database_post
%icon_theme_cache_post
%endif
%if 0%{?suse_version} > 1130
%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif
%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README README.tools TODO
%{_bindir}/claws-mail
%{_bindir}/sylpheed-claws
%dir %{_libdir}/claws-mail
%dir %{_libdir}/claws-mail/plugins
%{_libdir}/claws-mail/plugins/*.so
%{_libdir}/claws-mail/plugins/*.deps
%{_datadir}/applications/claws-mail.desktop
%{_datadir}/icons/hicolor/*/apps/claws-mail.png
%{_datadir}/pixmaps/claws-mail-64x64.png
%dir %{_datadir}/claws-mail
%doc %{_datadir}/claws-mail/RELEASE_NOTES
%doc %{_datadir}/claws-mail/manual/
%dir %{_datadir}/claws-mail/tools
%{_datadir}/claws-mail/tools/*.sh
%{_datadir}/claws-mail/tools/*.pl
%{_datadir}/claws-mail/tools/*.py
%{_datadir}/claws-mail/tools/*.conf
%{_datadir}/claws-mail/tools/tb2claws-mail
%{_datadir}/claws-mail/tools/u*
%{_datadir}/claws-mail/tools/kdeservicemenu/
%{_mandir}/man1/claws-mail.1.gz
%config(noreplace) %{_sysconfdir}/skel/.claws-mail/
%files devel
%defattr(-,root,root)
%{_includedir}/claws-mail/
%{_libdir}/pkgconfig/claws-mail.pc
%files lang -f %{name}.lang
%changelog