File offlineimap.spec of Package offlineimap

# spec file for package offlineimap
# Copyright (c) 2019 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

Name:           offlineimap
Version:        7.2.3
Release:        0
Summary:        IMAP/Maildir Synchronization Tool
License:        GPL-2.0-or-later
Group:          Productivity/Networking/Email/Utilities
BuildRequires:  asciidoc
BuildRequires:  docutils
BuildRequires:  libxml2-tools
BuildRequires:  libxslt-tools
BuildRequires:  python2-Sphinx
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-six
BuildRequires:  systemd-rpm-macros
Requires:       ca-certificates
Requires:       python2
Requires:       python2-curses
Requires:       python2-six
Suggests:       %{name}-htmldoc
Suggests:       python2-gssapi
BuildArch:      noarch

OfflineIMAP is a tool to synchronize IMAP and Maildir mailboxes and
which uses a multithreaded synchronization algorithm. It offers
several user interfaces and is configurable providing a great number
of settings for controlling its behavior. There are several
mechanisms for determining the list of mailboxes to synchronize. It
supports internal or external automation, SSL and PREAUTH tunnels,
offline (or "unplugged") reading, and a variety of esoteric IMAP
features for compatibility with IMAP servers. OfflineIMAP takes
precautions to avoid the loss of mails.

%package htmldoc
Summary:        HTML documentation for %{name}
Group:          Documentation/HTML

%description htmldoc
Separated documentation from %{name} package

%setup -q
sed -i '/^#!\/usr\/bin\/env/d' offlineimap/

python build
make %{?_smp_mflags} V=1 -C docs

python install --prefix=%{_prefix} --root=%{buildroot} \

rm -rf docs/html/_sources \
    docs/html/.buildinfo \

mkdir examples
mv offlineimap.conf* examples

install -D -m 644 docs/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
install -D -m 644 docs/%{name}ui.7 %{buildroot}%{_mandir}/man7/%{name}ui.7
install -D -m 444 contrib/systemd/%{name}.service %{buildroot}%{_userunitdir}/%{name}.service
install -D -m 444 contrib/systemd/%{name}@.service %{buildroot}%{_userunitdir}/%{name}@.service
install -D -m 444 contrib/systemd/%{name}-oneshot.service %{buildroot}%{_userunitdir}/%{name}-oneshot.service
install -D -m 444 contrib/systemd/%{name}-oneshot.timer %{buildroot}%{_userunitdir}/%{name}-oneshot.timer
install -D -m 444 contrib/systemd/%{name}-oneshot@.service %{buildroot}%{_userunitdir}/%{name}-oneshot@.service
install -D -m 444 contrib/systemd/%{name}-oneshot@.timer %{buildroot}%{_userunitdir}/%{name}-oneshot@.timer
rm docs/html/doctrees/environment.pickle

%license COPYING
%doc examples
%dir %{_userunitdir}

%files htmldoc
%doc docs/html