Name:    fetchmail
Version: 6.3.26
Release: 24
Summary: A mail-retrieval daemon
License: GPL+ and Public Domain
URL:     http://www.fetchmail.info/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
Source1: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz.asc
Source2: fetchmail.service
Source3: fetchmailrc.example
Patch0:  fetchmail-6.3.26-ssl-backport.patch
Patch1:  fetchmail-6.3.26-options-usage-manpage.patch
Patch2:  fetchmail-6.3.24-sslv3-in-ssllib-check.patch
Patch3:  fetchmail-6.3.26-ssl-set-sni.patch

BuildRequires: gcc gettext-devel krb5-devel openssl-devel
BuildRequires: python-unversioned-command systemd

%description
Fetchmail is a mail retrieval daemon that can download messages from
POP3, IMAP, ODMR and ETRN-based stores, with SSL/TLS security including
certificate verification, and pass downloaded mail to a local SMTP or
LMTP server, or a message delivery agent such as maildrop.

%package help
Summary:        Man files for fetchmail
Requires:       man
BuildArch:      noarch

%description help
This contains man files for the using of fetchmail.

%prep
%autosetup -p1

%build
%configure \
        --enable-IMAP --enable-POP3 \
        --enable-ETRN --enable-NTLM \
        --enable-RPA --enable-SDPS \
        --enable-nls \
        --without-hesiod --with-kerberos5 \
        --with-gssapi --with-ssl \
        --enable-fallback=no
make

%install
%make_install

install -Dp -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/fetchmail.service
install -Dp -m 600 %{SOURCE3} %{buildroot}%{_sysconfdir}/fetchmailrc.example

%find_lang fetchmail

%files -f fetchmail.lang
%license COPYING
%doc FAQ FEATURES NEWS NOTES README README.SSL
%config(noreplace) %attr(0600, mail, mail) %{_sysconfdir}/fetchmailrc.example
%{_bindir}/*
%{_unitdir}/*
%exclude %{_bindir}/fetchmailconf*
%exclude %{python_sitelib}/fetchmailconf.py*

%files help
%{_mandir}/man1/*
%exclude %{_mandir}/man1/fetchmailconf.1*

%changelog
* Thu May  6 2021 lingsheng <lingsheng@huawei.com> - 6.3.26-24
- drop hesiod support

* Thu Nov 28 2019 huyan <hu.huyan@huawei.com> - 6.3.26-23
- Package Initialization
