2006-11-23 20:13:08 +01: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)
|
|
|
|
datadir = distutils.sysconfig.get_python_lib()
|
|
|
|
## remove installation prefix to get relative path
|
|
|
|
datadir = datadir.replace(distutils.sysconfig.get_config_var("prefix") + os.path.sep, '')
|
|
|
|
datadir = os.path.join(datadir, 'cryptobox','share')
|
|
|
|
|
2006-11-23 21:52:30 +01:00
|
|
|
## configuration directory
|
|
|
|
confdir = os.path.join(os.path.sep, 'etc', 'cryptobox')
|
|
|
|
|
|
|
|
def listfiles(prefix,srcdir):
|
|
|
|
"""get files below a directory recursively - map them to the appropriate datatype as expected by 'data_files' in setup"""
|
|
|
|
## add the files of this directory
|
|
|
|
result = [(os.path.join(prefix,srcdir), [ os.path.join(srcdir, f) for f in os.listdir(srcdir) if os.path.isfile(os.path.join(srcdir, f)) and not f in IGNORE_FILES ])]
|
|
|
|
## add the files in subdirectories
|
|
|
|
for d in os.listdir(os.path.join(srcdir)):
|
|
|
|
if os.path.isdir(os.path.join(srcdir,d)) and not d in IGNORE_FILES:
|
|
|
|
result.extend(listfiles(prefix,os.path.join(srcdir,d)))
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
def getdatafiles(prefix,dirs):
|
2006-11-23 20:13:08 +01:00
|
|
|
filelist = []
|
|
|
|
for d in dirs:
|
2006-11-23 21:52:30 +01:00
|
|
|
if os.path.isdir(d):
|
|
|
|
filelist.extend(listfiles(prefix,d))
|
|
|
|
else:
|
|
|
|
filelist.append((prefix, [d]))
|
2006-11-23 20:13:08 +01:00
|
|
|
return filelist
|
|
|
|
|
|
|
|
|
|
|
|
setup(
|
|
|
|
name = 'cryptobox',
|
|
|
|
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 21:52:30 +01:00
|
|
|
data_files = getdatafiles(datadir, ['templates','www-data','lang','plugins']) +
|
|
|
|
getdatafiles(confdir, ['conf-examples/cryptobox.conf']) +
|
|
|
|
getdatafiles(os.path.join(confdir,'events.d'), ['event-scripts/README']) +
|
|
|
|
getdatafiles(datadir, ['doc']) +
|
|
|
|
getdatafiles(os.path.join(datadir,'doc'), ['conf-examples','event-scripts','README','changelog','LICENSE','copyright','doc/html']),
|
|
|
|
package_dir = { '': 'src' },
|
2006-11-23 20:13:08 +01: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'],
|
|
|
|
)
|
|
|
|
|