File getmail.spec of Package getmail

#
# spec file for package getmail (Version 4.9.1)
#
# Copyright 2009 Mario García H.
#
# 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.

%define py_version 2.6

Summary: Flexible mail retriever intended to replace fetchmail
Name: getmail
Version: 4.9.1
Release: 1
Source0: %{name}-%{version}.tar.bz2
#Source1: http://pyropus.ca/software/getmail/old-versions/%{name}-%{version}.tar.gz
Patch0: %{name}-%{version}-modules.patch
Vendor: %{vendor}
URL: http://pyropus.ca/software/getmail/
License: GPLv2
Group: Productivity/Networking/Email/Utilities
BuildRequires: python
BuildRoot: %{_builddir}/%{name}-%{version}-build


%description
getmail is a mail retriever designed to allow you
to get your mail from one or more mail accounts
on various mail servers to your local machine for
reading with a minimum of fuss.

getmail is designed to be secure, flexible,
reliable, and easy-to-use. It is designed to
replace other mail retrievers such as fetchmail.

Furthermore, it is a multi-protocol mail retrieval
system with support for simple and domain POP3 and
IMAP4 mailboxes, domain SDPS mailboxes,
POP3-over-SSL and IMAP-over-SSL, mail sorting,
message filtering, and delivery to Maildirs,
Mboxrd files, external MDAs, and other advanced
features.


%prep
%setup -q
%patch0 -p1

%build


%install
%{__python} setup.py install --root="%{buildroot}"

%{__mv} -f %{buildroot}/usr/local/bin \
%{buildroot}/%{_bindir}

if [ -d %{buildroot}/usr/local/%{_lib} ]
then
%{__mv} -f %{buildroot}/usr/local/%{_lib} %{buildroot}%{_libdir}
else
%{__mv} -f %{buildroot}/usr/local/lib %{buildroot}%{_libdir}
fi

%{__install} -d -m 0755 %{buildroot}%{_docdir}
%{__mv} -f %{buildroot}/usr/share/doc/%{name}-%{version} \
%{buildroot}/%{_docdir}/%{name}


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-,root,root,-)
%attr(0755,root,root)%{_bindir}/%{name}
%attr(0755,root,root)%{_bindir}/%{name}_*
%{_libdir}/python%{py_version}/site-packages/%{name}core
%{_libdir}/python%{py_version}/site-packages/%{name}core/*
%{_libdir}/python%{py_version}/site-packages/%{name}-%{version}*.egg-info

%doc %{_mandir}/man1/%{name}*.1.gz



###################
## Documentation ##
###################

%package doc
Summary: Documentation and configuration examples for getmail
Group: Documentation/Other


%description doc
getmail is a mail retriever designed to allow you
to get your mail from one or more mail accounts
on various mail servers to your local machine for
reading with a minimum of fuss.

This package installs documentation related to
getmail's usage, configuration, licensing and
development information.


%files doc
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}
%doc %{_docdir}/%{name}/*
#%doc %{_docdir}/%{name}/BUGS
#%doc %{_docdir}/%{name}/COPYING
#%doc %{_docdir}/%{name}/CHANGELOG
#%doc %{_docdir}/%{name}/configuration.*
#%doc %{_docdir}/%{name}/documentation.*
#%doc %{_docdir}/%{name}/README
#%doc %{_docdir}/%{name}/THANKS
#%doc %{_docdir}/%{name}/TODO
#%doc %{_docdir}/%{name}/troubleshooting.*
#%doc %{_docdir}/%{name}/faq.*
#%doc %{_docdir}/%{name}/getmailrc-examples
#%doc %{_docdir}/%{name}/getmaildocs.css

%exclude %{_docdir}/%{name}/%{name}.spec

%changelog
* Tue Jul 7 2009 Mario García H. <code933k@gmail.com> - 4.9.1
- Initial package.
openSUSE Build Service is sponsored by