%define name mailpile
%define version 0.4.0.dev20141126
%define unmangled_version 0.4.0.dev20141126
%define release 1

Summary: An e-mail search engine and webmail client
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Source0: %{name}-%{unmangled_version}.tar.gz
License: AGPL-3.0+
Group: Applications/Internet
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: python-devel 
BuildRequires: python-setuptools
BuildRequires: gettext
Requires: python-lxml
Requires: python-jinja2
Requires: python-markupsafe
Prefix: %{_prefix}
BuildArch: noarch
Vendor: Mailpile ehf. <team@mailpile.is>
Url: https://www.mailpile.is/

%description
# Welcome to Mailpile! #

[![Build Status](https://img.shields.io/travis/mailpile/Mailpile/master.svg)](https://travis-ci.org/mailpile/Mailpile)


## Introduction ##

Mailpile (<https://www.mailpile.is/>) is a modern, fast web-mail client with
user-friendly encryption and privacy features. The development of Mailpile
is funded by [a large community of backers](https://www.mailpile.is/#community)
and all code related to the project is and will be released under an OSI
approved Free Software license.

Mailpile places great emphasis on providing a clean, elegant user interface
and pleasant user experience. In particular, Mailpile aims to make it easy
and convenient to receive and send PGP encrypted or signed e-mail.

Mailpile's primary user interface is web-based, but it also has a basic
command-line interface and an API for developers. Using web technology for
the interface allows Mailpile to function both as a local desktop
application (accessed by visiting `localhost` in the browser) or a remote
web-mail on a personal server or VPS.

The core of Mailpile is a fast search engine, custom written to deal
with large volumes of e-mail on consumer hardware. The search engine
allows e-mail to be organized using tags (similar to GMail's labels) and
the application can be configured to automatically tag incoming mail
either based on static rules or bayesian classifiers.

**Note:** We are currently "in beta", which means the app's basic features
are (mostly) in place and packages are available for popular operating
systems, for people who would like to help test and debug. For more details
[follow @MailpileTeam on Twitter](https://twitter.com/MailpileTeam)
or [read our blog](https://www.mailpile.is/blog/).


### Trying Mailpile

We have live demos up and running [on our
website](https://www.mailpile.is/demos/). If you are curious about what
Mailpile looks like, please feel free to check it out.


### Installing Mailpile

Note that Mailpile is still in development and is not suitable for
production or end-user use. However, developers and early adopters are
encouraged to give it a try and even help us find bugs, fix them
and develop new features.

Please see our [download page](https://www.mailpile.is/download/) or read
[the Getting Started guide on our wiki](https://github.com/pagekite/Mailpile/wiki/Getting-started).


## Credits and License ##

Bjarni R. Einarsson (<http://bre.klaki.net/>) created this!  If you think
it's neat, you should also check out PageKite: <https://pagekite.net/>. At some point Bjarni, that crafty fellow convinced [Smári](<http://www.smarimccarthy.is/>) and [Brennan](https://brennannovak.com) to start working on the project as well.

The GMail guys get mad props for creating the best webmail service out
there.  Wishing the Free Software world had something like it is what
inspired Bjarni to start working on Mailpile. Edward Snowden also gets mad props for inspiring us to try and make PGP usable for journalists and everday folks!

Contributors:

- Bjarni R. Einarsson (<http://bre.klaki.net/>)
- Brennan Novak (<https://brennannovak.com/>)
- Smari McCarthy (<http://www.smarimccarthy.is/>)
- Lots more, run `git shortlog -s` for a list! (Or see the list [on Github](https://github.com/pagekite/Mailpile/graphs/contributors).)

And of course, we couldn't do this without [our community of
backers](https://www.mailpile.is/#community).

This program is free software: you can redistribute it and/or modify it under
the terms of either the GNU Affero General Public License as published by the
Free Software Foundation. See the file `COPYING.md` for details.


%prep
%setup -n %{name}-%{unmangled_version}

%build
python setup.py build

%install
python setup.py install --single-version-externally-managed -O1 --prefix=%{_prefix} --root=%{buildroot} --record=INSTALLED_FILES

# FIXME: This does not work...
#%find_lang %{name}
#%files -f %{name}.lang

%files
%defattr(-,root,root)
%doc README.md LICENSE-2.0.txt
%{python_sitelib}/*
%{_bindir}/*
#%{_mandir}/*

%changelog
* Tue Nov 25 2014 Bjarni R. Einarsson <bre@mailpile.is> - 0.4.0.dev20141126-1
- Merging/adapting setup.py-generated .spec file

* Fri Oct 17 2014 Smári McCarthy <smari@mailpile.is> - 0.4.1-1
- First RPM build
