File: setup.py

package info (click to toggle)
codeville 0.8.0-2.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,140 kB
  • sloc: python: 10,335; ansic: 89; sh: 62; makefile: 25
file content (49 lines) | stat: -rw-r--r-- 1,473 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/python

# Written by Ross Cohen
# see LICENSE.txt for license information

import Codeville
from distutils.core import setup
import shutil
import sys
assert sys.version >= '2', "Install Python 2.0 or greater"

scripts = ["cdv", "cdvserver", "cdvpasswd", "cdv-agent", "cdvupgrade"]
plat_ext = []
data_files = [('share/doc/Codeville-' + Codeville.version, ['LICENSE.txt'])]

if sys.platform == 'win32':
    from distutils.core import Extension
    if sys.version < '2.4':
        plat_ext = [Extension("Codeville.winrandom",
                              libraries = ['ws2_32', 'advapi32'],
                              sources = ["src/winrand.c"])]
    for i in xrange(len(scripts)):
        shutil.copy(scripts[i], scripts[i] + '.py')
        scripts[i] = scripts[i] + '.py'
    #os.copy('bin/winrandom.pyd', 'Codeville/winrandom.pyd')
else:
    data_files[0][1].append('cdvserver.conf.sample')

for arg in sys.argv:
    if arg.find('wininst') >= 0:
        data_files = [('', ['LICENSE.txt'])]
        for i in xrange(len(scripts)):
            shutil.copy(scripts[i], scripts[i] + '.py')
            scripts[i] = scripts[i] + '.py'

setup(
    name = "Codeville",
    version = Codeville.version,
    author = "Ross Cohen",
    author_email = "rcohen@snurgle.org",
    url = "http://www.codeville.org/",
    license = "BSD",

    packages = ["Codeville", "Codeville/old"],
    ext_modules = plat_ext,

    scripts = scripts,
    data_files = data_files
    )