%global git 0

Summary: Utility to synchronize IMAP mailboxes with local maildir folders
Name: isync
Version: 1.5.0
Release: 1%{?dist}
License: GPL
Group: Applications/Internet
Source: https://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.gz
URL: http://isync.sf.net/
BuildRoot: %{_tmppath}/%{name}-buildroot

BuildRequires: gcc
BuildRequires: make
BuildRequires: (perl-interpreter >= 5.14 or perl-base >= 5.14 or /usr/bin/perl)
BuildRequires: pkgconfig(libsasl2)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(zlib)
BuildRequires: (db4-devel >= 4.1 or db-devel >= 4.1 or libdb-devel >= 4.1)
%if %{git}
# Extra things needed when building from Git instead of the release tarball.
BuildRequires: automake, autoconf
BuildRequires: perl(DateTime)
BuildRequires: unzip
%endif

%description
isync is a command line utility which synchronizes mailboxes; currently
Maildir and IMAP4 mailboxes are supported.
New messages, message deletions and flag changes can be propagated both ways.
It is useful for working in disconnected mode, such as on a laptop or with a
non-permanent internet collection (dIMAP).

%prep
%setup -q

%build
%configure
%make_build

%install
rm -rf %{buildroot}
%make_install
rm -rf %{buildroot}%{_docdir}/%{name}

%clean
rm -rf %{buildroot}

%files
%doc AUTHORS COPYING NEWS README TODO ChangeLog src/mbsyncrc.sample
%{_bindir}/*
%{_mandir}/man1/*
%{_docdir}/