File claws-mail.spec of Package claws-mail

#
# spec file for package claws-mail
#
# Copyright (c) 2015 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

Name:           claws-mail
Version:        3.12.0
Release:        0
Url:            http://www.claws-mail.org/
Summary:        A lightweight and highly configurable email client
License:        GPL-3.0+
Group:          Productivity/Networking/Email/Clients
# Both sourceforge and project url fails, so just have source manually.
#Source:        http://www.claws-mail.org/download.php?file=releases/claws-mail-3.12.0.tar.xz
Source0:        claws-mail-%{version}.tar.xz
BuildRequires:  NetworkManager-devel
BuildRequires:  compface
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
%else
BuildRequires:  gtk3-devel
%endif
BuildRequires:  libarchive-devel
BuildRequires:  libcanberra-devel >= 0.6
BuildRequires:  libcurl-devel
BuildRequires:  libetpan-devel >= 0.57
BuildRequires:  libexpat-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  libpoppler-glib-devel
BuildRequires:  libwebkit-devel
BuildRequires:  openldap2-devel
BuildRequires:  pilot-link-devel
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
# Set version to 1330 as the branch it needs is a unstable release
%if 0%{?suse_version} > 1330
BuildRequires:  pkgconfig(libgdata) >= 0.17.1
%endif
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 lightweight and
highly configurable email client and news reader based on the GTK+ GUI
toolkit, it runs on the X Window System.

Claws Mail is free software distributed under the GNU GPL.

To run Claws Mail use 'claws-mail' on the command line.

When claws-mail is executed for the first time a configuration 'Wizard'
will appear prompting you for the minimum information necessary to
create a new account.

%package devel
Summary:        A lightweight and highly configurable email client
License:        GPL-2.0+
Group:          Development/Libraries/Other
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 lightweight and
highly configurable email client and news reader based on the GTK+ GUI
toolkit, it runs on the X Window System.

Claws Mail is free software distributed under the GNU GPL.

To run Claws Mail use 'claws-mail' on the command line.

When claws-mail is executed for the first time a configuration 'Wizard'
will appear prompting you for the minimum information necessary to
create a new account.

%lang_package
%prep
%setup -q

%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 \
        --enable-fancy-plugin \
        --enable-fetchinfo-plugin \
%if 0%{?suse_version} > 1330
        --enable-gdata-plugin \
%endif
        --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 \
        --enable-tnef_parse-plugin \
        --enable-vcalendar-plugin \
        --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
openSUSE Build Service is sponsored by