2006-11-23 19:13:08 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
from distutils.core import setup
|
|
|
|
import distutils.sysconfig
|
|
|
|
import os
|
|
|
|
|
|
|
|
## define some strings (not patterns) to exclude specific files or directories
|
|
|
|
IGNORE_FILES = [ '.svn' ]
|
|
|
|
|
|
|
|
## define the data destination directory (below the python directory - we will fix this for debian in the rules file)
|
2006-11-24 11:03:34 +00:00
|
|
|
pydir = distutils.sysconfig.get_python_lib()
|
2006-11-23 19:13:08 +00:00
|
|
|
## remove installation prefix to get relative path
|
2006-11-24 11:03:34 +00:00
|
|
|
pydir = pydir.replace(distutils.sysconfig.get_config_var("prefix") + os.path.sep, '')
|
|
|
|
pydir = os.path.join(pydir, 'cryptobox')
|
2006-11-23 19:13:08 +00:00
|
|
|
|
2006-11-24 11:03:34 +00:00
|
|
|
## shared data dir
|
|
|
|
datadir = os.path.join(pydir, 'share')
|
|
|
|
## doc dir
|
|
|
|
docdir = os.path.join(pydir, 'doc')
|
2006-11-23 20:52:30 +00:00
|
|
|
## configuration directory
|
2006-11-27 19:25:26 +00:00
|
|
|
confdir = os.path.join(os.path.sep, 'etc', 'cryptobox-server')
|
2006-11-23 20:52:30 +00:00
|
|
|
|
2006-11-24 11:03:34 +00:00
|
|
|
|
|
|
|
def listfiles(prefix,src):
|
|
|
|
"""create a list of files below a directory recursively
|
|
|
|
|
|
|
|
If the src contains more then one path element (multiple levels), then only the
|
|
|
|
last one (basename part) is added to the prefix path (e.g.: 'dest','src1/src2' will
|
|
|
|
create a list below 'dest/src2').
|
|
|
|
The result is a list of tuples: (destination, [srcfiles,...]).
|
|
|
|
This is the datatype expected by 'data_files' in setup."""
|
|
|
|
## we will not add the 'dirname' part of srcdir to the destination
|
|
|
|
src_dir, src_base = os.path.split(src)
|
2006-11-23 20:52:30 +00:00
|
|
|
## add the files of this directory
|
2006-11-24 11:03:34 +00:00
|
|
|
result = [(os.path.join(prefix,src_base), [ os.path.join(src,f) for f in os.listdir(src) if os.path.isfile(os.path.join(src,f)) and not f in IGNORE_FILES ])]
|
2006-11-23 20:52:30 +00:00
|
|
|
## add the files in subdirectories
|
2006-11-24 11:03:34 +00:00
|
|
|
for d in os.listdir(src):
|
|
|
|
if os.path.isdir(os.path.join(src,d)) and not d in IGNORE_FILES:
|
|
|
|
result.extend(listfiles(os.path.join(prefix,src_base),os.path.join(src,d)))
|
2006-11-23 20:52:30 +00:00
|
|
|
return result
|
2006-11-24 11:03:34 +00:00
|
|
|
|
|
|
|
|
2006-11-23 20:52:30 +00:00
|
|
|
def getdatafiles(prefix,dirs):
|
2006-11-23 19:13:08 +00:00
|
|
|
filelist = []
|
|
|
|
for d in dirs:
|
2006-11-23 20:52:30 +00:00
|
|
|
if os.path.isdir(d):
|
|
|
|
filelist.extend(listfiles(prefix,d))
|
|
|
|
else:
|
|
|
|
filelist.append((prefix, [d]))
|
2006-11-23 19:13:08 +00:00
|
|
|
return filelist
|
|
|
|
|
|
|
|
|
|
|
|
setup(
|
2006-11-27 19:25:26 +00:00
|
|
|
name = 'cryptobox-server',
|
2006-11-23 19:13:08 +00:00
|
|
|
version = '0.3.0',
|
|
|
|
description = 'webinterface for handling encrypted disks',
|
|
|
|
author = 'Lars Kruse',
|
|
|
|
author_email = 'devel@sumpfralle.de',
|
|
|
|
maintainer = 'Lars Kruse',
|
|
|
|
maintainer_email = 'devel@sumpfralle.de',
|
|
|
|
license = 'GPL',
|
|
|
|
url = 'http://cryptobox.org',
|
|
|
|
packages = [ 'cryptobox', 'cryptobox.core', 'cryptobox.web', 'cryptobox.plugins', 'cryptobox.tests' ],
|
2006-11-23 20:52:30 +00:00
|
|
|
data_files = getdatafiles(datadir, ['templates','www-data','lang','plugins']) +
|
|
|
|
getdatafiles(confdir, ['conf-examples/cryptobox.conf']) +
|
2006-11-24 11:03:34 +00:00
|
|
|
getdatafiles(os.path.join(confdir,'events.d'), ['event-scripts/README','event-scripts/_event_scripts_']) +
|
|
|
|
getdatafiles(docdir, ['doc/html']) +
|
|
|
|
getdatafiles(docdir, ['conf-examples','event-scripts','README','changelog','LICENSE','copyright','doc/html']),
|
2006-11-23 20:52:30 +00:00
|
|
|
package_dir = { '': 'src' },
|
2006-11-23 19:13:08 +00:00
|
|
|
scripts = [ 'bin/CryptoBoxWebserver', 'bin/CryptoBoxRootActions' ],
|
|
|
|
classifiers = [
|
|
|
|
'Development Status :: 2 - Beta',
|
|
|
|
'Environment :: Web Environment',
|
|
|
|
'Intended Audience :: End Users/Desktop',
|
|
|
|
'Intended Audience :: System Administrators',
|
|
|
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
|
|
|
'Topic :: System :: Systems Administration',
|
|
|
|
'Operating System :: POSIX',
|
|
|
|
'Operating System :: Unix',
|
|
|
|
'Programming Language :: Python'],
|
|
|
|
)
|
|
|
|
|