f81e7fba |
from distutils.core import setup |
093be855 |
import sys |
ab58f171 |
import os
|
747ddb2a |
import S3.PkgInfo
|
10465167 |
if float("%d.%d" % sys.version_info[:2]) < 2.4:
sys.stderr.write("Your Python version %d.%d.%d is not supported.\n" % sys.version_info[:3]) |
9ed3c782 |
sys.stderr.write("S3cmd requires Python 2.4 or newer.\n") |
10465167 |
sys.exit(1)
try: |
7bae4e19 |
import xml.etree.ElementTree as ET
print "Using xml.etree.ElementTree for XML processing" |
10465167 |
except ImportError, e: |
7bae4e19 |
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) |
10465167 |
|
ab58f171 |
try: |
093be855 |
## 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") |
ab58f171 |
except:
pass
|
c9930864 |
## 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", "INSTALL", "NEWS" ]),
(man_path+"/man1", [ "s3cmd.1" ] ),
]
else:
data_files = None |
09b29caf |
## Main distutils info |
747ddb2a |
setup( |
7023e931 |
## Content description |
747ddb2a |
name = S3.PkgInfo.package,
version = S3.PkgInfo.version, |
f81e7fba |
packages = [ 'S3' ], |
c76aaa1e |
scripts = ['s3cmd'], |
c9930864 |
data_files = data_files, |
7023e931 |
## Packaging details
author = "Michal Ludvig",
author_email = "michal@logix.cz", |
747ddb2a |
url = S3.PkgInfo.url,
license = S3.PkgInfo.license,
description = S3.PkgInfo.short_description, |
7023e931 |
long_description = """ |
747ddb2a |
%s |
7023e931 |
Authors:
-------- |
747ddb2a |
Michal Ludvig <michal@logix.cz>
""" % (S3.PkgInfo.long_description) |
f81e7fba |
) |