Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 81 lines (70 sloc) 2.399 kB
f81e7fb @mludvig All classes from s3.py go to S3/S3.py
mludvig authored
1 from distutils.core import setup
093be85 @mludvig 2007-06-17 Michal Ludvig <michal@logix.cz>
mludvig authored
2 import sys
ab58f17 @mludvig - Added configuration for setup.py sdist
mludvig authored
3 import os
4
747ddb2 @mludvig 2007-03-26 Michal Ludvig <michal@logix.cz>
mludvig authored
5 import S3.PkgInfo
6
1046516 @mludvig 2007-07-20 Michal Ludvig <michal@logix.cz>
mludvig authored
7 if float("%d.%d" % sys.version_info[:2]) < 2.4:
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
8 sys.stderr.write("Your Python version %d.%d.%d is not supported.\n" % sys.version_info[:3])
9 sys.stderr.write("S3cmd requires Python 2.4 or newer.\n")
10 sys.exit(1)
1046516 @mludvig 2007-07-20 Michal Ludvig <michal@logix.cz>
mludvig authored
11
12 try:
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
13 import xml.etree.ElementTree as ET
14 print "Using xml.etree.ElementTree for XML processing"
1046516 @mludvig 2007-07-20 Michal Ludvig <michal@logix.cz>
mludvig authored
15 except ImportError, e:
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
16 sys.stderr.write(str(e) + "\n")
17 try:
18 import elementtree.ElementTree as ET
19 print "Using elementtree.ElementTree for XML processing"
20 except ImportError, e:
21 sys.stderr.write(str(e) + "\n")
22 sys.stderr.write("Please install ElementTree module from\n")
23 sys.stderr.write("http://effbot.org/zone/element-index.htm\n")
24 sys.exit(1)
1046516 @mludvig 2007-07-20 Michal Ludvig <michal@logix.cz>
mludvig authored
25
ab58f17 @mludvig - Added configuration for setup.py sdist
mludvig authored
26 try:
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
27 ## Remove 'MANIFEST' file to force
28 ## distutils to recreate it.
29 ## Only in "sdist" stage. Otherwise
30 ## it makes life difficult to packagers.
31 if sys.argv[1] == "sdist":
32 os.unlink("MANIFEST")
ab58f17 @mludvig - Added configuration for setup.py sdist
mludvig authored
33 except:
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
34 pass
ab58f17 @mludvig - Added configuration for setup.py sdist
mludvig authored
35
593ef06 @mludvig * format-manpage.pl: new manpage auto-formatter
mludvig authored
36 ## Re-create the manpage
37 ## (Beware! Perl script on the loose!!)
38 if sys.argv[1] == "sdist":
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
39 if os.stat_result(os.stat("s3cmd.1")).st_mtime < os.stat_result(os.stat("s3cmd")).st_mtime:
40 sys.stderr.write("Re-create man page first!\n")
41 sys.stderr.write("Run: ./s3cmd --help | ./format-manpage.pl > s3cmd.1\n")
42 sys.exit(1)
593ef06 @mludvig * format-manpage.pl: new manpage auto-formatter
mludvig authored
43
c993086 @mludvig 2007-06-19 Michal Ludvig <michal@logix.cz>
mludvig authored
44 ## Don't install manpages and docs when $S3CMD_PACKAGING is set
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
45 ## This was a requirement of Debian package maintainer.
c993086 @mludvig 2007-06-19 Michal Ludvig <michal@logix.cz>
mludvig authored
46 if not os.getenv("S3CMD_PACKAGING"):
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
47 man_path = os.getenv("S3CMD_INSTPATH_MAN") or "share/man"
48 doc_path = os.getenv("S3CMD_INSTPATH_DOC") or "share/doc/packages"
49 data_files = [
50 (doc_path+"/s3cmd", [ "README", "INSTALL", "NEWS" ]),
51 (man_path+"/man1", [ "s3cmd.1" ] ),
52 ]
c993086 @mludvig 2007-06-19 Michal Ludvig <michal@logix.cz>
mludvig authored
53 else:
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
54 data_files = None
09b29ca @mludvig 2007-04-09 Michal Ludvig <michal@logix.cz>
mludvig authored
55
56 ## Main distutils info
747ddb2 @mludvig 2007-03-26 Michal Ludvig <michal@logix.cz>
mludvig authored
57 setup(
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
58 ## Content description
59 name = S3.PkgInfo.package,
60 version = S3.PkgInfo.version,
61 packages = [ 'S3' ],
62 scripts = ['s3cmd'],
63 data_files = data_files,
7023e93 @mludvig Added info for building RPM packages.
mludvig authored
64
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
65 ## Packaging details
66 author = "Michal Ludvig",
67 author_email = "michal@logix.cz",
68 url = S3.PkgInfo.url,
69 license = S3.PkgInfo.license,
70 description = S3.PkgInfo.short_description,
71 long_description = """
747ddb2 @mludvig 2007-03-26 Michal Ludvig <michal@logix.cz>
mludvig authored
72 %s
7023e93 @mludvig Added info for building RPM packages.
mludvig authored
73
74 Authors:
75 --------
747ddb2 @mludvig 2007-03-26 Michal Ludvig <michal@logix.cz>
mludvig authored
76 Michal Ludvig <michal@logix.cz>
77 """ % (S3.PkgInfo.long_description)
d439efb @mludvig ATTENTION -- Mega WhiteSpace conversion !!!
mludvig authored
78 )
79
80 # vim:et:ts=4:sts=4:ai
Something went wrong with that request. Please try again.