This repository has been archived by the owner on Nov 4, 2018. It is now read-only.
forked from s3tools/s3cmd
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
108 lines (94 loc) · 3.37 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/env python2
# -*- coding=utf-8 -*-
import sys
import os
from setuptools import setup
import S3.PkgInfo
if float("%d.%d" % sys.version_info[:2]) < 2.6:
sys.stderr.write("Your Python version %d.%d.%d is not supported.\n" % sys.version_info[:3])
sys.stderr.write("S3cmd requires Python 2.6 or newer.\n")
sys.exit(1)
try:
import xml.etree.ElementTree as ET
print "Using xml.etree.ElementTree for XML processing"
except ImportError, e:
sys.stderr.write(str(e) + "\n")
try:
import elementtree.ElementTree as ET
print "Using elementtree.ElementTree for XML processing"
except ImportError, e:
sys.stderr.write(str(e) + "\n")
sys.stderr.write("Please install ElementTree module from\n")
sys.stderr.write("http://effbot.org/zone/element-index.htm\n")
sys.exit(1)
try:
## Remove 'MANIFEST' file to force
## distutils to recreate it.
## Only in "sdist" stage. Otherwise
## it makes life difficult to packagers.
if sys.argv[1] == "sdist":
os.unlink("MANIFEST")
except:
pass
## Re-create the manpage
## (Beware! Perl script on the loose!!)
if sys.argv[1] == "sdist":
if os.stat_result(os.stat("s3cmd.1")).st_mtime < os.stat_result(os.stat("s3cmd")).st_mtime:
sys.stderr.write("Re-create man page first!\n")
sys.stderr.write("Run: ./s3cmd --help | ./format-manpage.pl > s3cmd.1\n")
sys.exit(1)
## Don't install manpages and docs when $S3CMD_PACKAGING is set
## This was a requirement of Debian package maintainer.
if not os.getenv("S3CMD_PACKAGING"):
man_path = os.getenv("S3CMD_INSTPATH_MAN") or "share/man"
doc_path = os.getenv("S3CMD_INSTPATH_DOC") or "share/doc/packages"
data_files = [
(doc_path+"/s3cmd", [ "README.md", "INSTALL", "NEWS" ]),
(man_path+"/man1", [ "s3cmd.1" ] ),
]
else:
data_files = None
## Main distutils info
setup(
## Content description
name = S3.PkgInfo.package,
version = S3.PkgInfo.version,
packages = [ 'S3' ],
scripts = ['s3cmd'],
data_files = data_files,
## Packaging details
author = "Michal Ludvig",
author_email = "michal@logix.cz",
maintainer = "github.com/mdomsch, github.com/matteobar",
maintainer_email = "s3tools-bugs@lists.sourceforge.net",
url = S3.PkgInfo.url,
license = S3.PkgInfo.license,
description = S3.PkgInfo.short_description,
long_description = """
%s
Authors:
--------
Michal Ludvig <michal@logix.cz>
""" % (S3.PkgInfo.long_description),
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: MacOS X',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2 :: Only',
'Topic :: System :: Archiving',
'Topic :: Utilities',
],
install_requires = ["python-dateutil", "python-magic"]
)
# vim:et:ts=4:sts=4:ai