forked from mailpile/Mailpile
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·90 lines (79 loc) · 2.78 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env python2
from datetime import date
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py
import datetime
import os
import re
import subprocess
from glob import glob
here = os.path.abspath(os.path.dirname(__file__))
## This figures out what version we want to call ourselves ###################
try:
GIT_HEAD = open('.git/HEAD').read().strip().split('/')[-1]
BRANCH = {
'master': 'dev',
'release': ''
}.get(GIT_HEAD, GIT_HEAD)
except (OSError, IOError):
BRANCH = None
if BRANCH:
BRANCHVER = '.%s%s' % (BRANCH, str(datetime.date.today()).replace('-', ''))
else:
BRANCHVER = ''
APPVER = '%s%s' % (next(
line.strip() for line in open('mailpile/defaults.py', 'r')
if re.match(r'^APPVER\s*=', line)
).split('"')[1], BRANCHVER)
## Cleanup ###################################################################
try:
assert(0 == subprocess.call(['make', 'clean'], cwd=here))
except:
print "Faild to run 'make clean'. Bailing out."
exit(1)
## Install ###################################################################
class Builder(build_py):
def run(self):
try:
assert(0 == subprocess.call(['make', 'bdist-prep'], cwd=here))
except:
print "Error building package. Try running 'make'."
exit(1)
else:
build_py.run(self)
## "Main" ####################################################################
setup(
name="mailpile",
version=APPVER,
license="AGPLv3+",
author="Mailpile ehf.",
author_email="[email protected]",
url="https://www.mailpile.is/",
description="""\
An e-mail search engine and webmail client, with easy encryption and privacy.
""",
long_description=open('README.md', 'r').read(),
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'Programming Language :: JavaScript',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'License :: OSI Approved :: Apache Software License',
'Intended Audience :: End Users/Desktop',
'Topic :: Communications :: Email :: Email Clients (MUA)',
'Topic :: Security :: Cryptography',
'Operating System :: POSIX',
'Environment :: Console',
'Environment :: Web Environment'],
keywords='email webmail search pgp',
packages=find_packages(
exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
include_package_data=True,
install_requires=open('requirements.txt', 'r').read().strip().splitlines(),
cmdclass={'build_py': Builder},
entry_points={
'console_scripts': [
'mailpile = mailpile.__main__:main'
]},
test_suite='nose.collector',
tests_require=['nose'])