summaryrefslogtreecommitdiff
path: root/setup.py
blob: 1d3a17ab22a601f90ac87b519b794a4cb3e4afe7 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python

import os, sys
import glob
from distutils.core import setup
#try:
#    import setuptools
#    # enable "setup.py develop", optional
#except ImportError:
#    pass

MOD_NAME = 'mic'

version_path = 'VERSION'
if not os.path.isfile(version_path):
    print 'No VERSION file in topdir, abort'
    sys.exit(1)

try:
    # first line should be the version number
    version = open(version_path).readline().strip()
    if not version:
        print 'VERSION file is invalid, abort'
        sys.exit(1)

    ver_file = open('%s/__version__.py' % MOD_NAME, 'w')
    ver_file.write("VERSION = \"%s\"\n" % version)
    ver_file.close()
except IOError:
    print 'WARNING: Cannot write version number file'
    pass

PACKAGES = [MOD_NAME,
            MOD_NAME + '/utils',
            MOD_NAME + '/imager',
            MOD_NAME + '/pluginbase',
            MOD_NAME + '/kickstart',
            MOD_NAME + '/kickstart/custom_commands',
            MOD_NAME + '/kickstart/pykickstart',
            MOD_NAME + '/kickstart/pykickstart/commands',
            MOD_NAME + '/kickstart/pykickstart/handlers',
           ]

setup(name=MOD_NAME,
      version = version,
      description = 'New MeeGo Image Creator',
      author='Jian-feng Ding',
      author_email='jian-feng.ding@intel.com',
      url='https://meego.gitorious.org/meego-developer-tools/image-creator',
      scripts=[
          'tools/mic',
          ],
      packages = PACKAGES,
      data_files = [("/usr/lib/mic/plugins/imager", ["plugins/imager/fs_plugin.py",
                                                     "plugins/imager/livecd_plugin.py",
                                                     "plugins/imager/liveusb_plugin.py",
                                                     "plugins/imager/loop_plugin.py",
                                                     "plugins/imager/raw_plugin.py"]),
                    ("/usr/lib/mic/plugins/backend", ["plugins/backend/zypppkgmgr.py",
                                                      "plugins/backend/yumpkgmgr.py"]),
                    ("/etc/mic", ["distfiles/mic.conf"])]
)