| mirabal | d87877c | 2017-03-31 15:15:52 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | from setuptools import setup, find_packages |
| 4 | from setuptools.command.install import install |
| 5 | from os import system |
| 6 | from setuptools import setup |
| 7 | |
| 8 | __name__ = 'lib-osm-openvim' |
| 9 | __version__ = '1.0.0' |
| 10 | __description__ = 'OSM Openvim library' |
| 11 | __author__ = 'ETSI OSM' |
| 12 | __author_email__ = 'alfonso.tiernosepulveda@telefonica.com' |
| 13 | __maintainer__ = 'mirabal' |
| 14 | __maintainer_email__ = 'leonardo.mirabal@altran.com' |
| 15 | __license__ = 'Apache 2.0' |
| 16 | __url__ = 'https://osm.etsi.org/gitweb/?p=osm/openvim.git;a=summary' |
| 17 | |
| mirabal | 622e55d | 2017-04-06 11:01:05 +0200 | [diff] [blame^] | 18 | cmd = 'cp ovim.py ovim' |
| 19 | system(cmd) |
| mirabal | d87877c | 2017-03-31 15:15:52 +0200 | [diff] [blame] | 20 | |
| 21 | __data_files__ = [('osm/openvim/', ['openvimd.cfg']), |
| 22 | ('osm/openvim/database_utils/', ['database_utils/vim_db_structure.sql', |
| 23 | 'database_utils/nets.sql', |
| 24 | 'database_utils/of_ports_pci_correspondence.sql', |
| 25 | 'database_utils/host_ranking.sql', |
| 26 | 'database_utils/dump_db.sh', |
| 27 | 'database_utils/init_vim_db.sh', |
| 28 | 'database_utils/migrate_vim_db.sh', |
| 29 | 'database_utils/install-db-server.sh' |
| 30 | ]), |
| 31 | ('osm/openvim/scripts/', ['scripts/service-openvim.sh', |
| 32 | 'scripts/openvim-report.sh', |
| 33 | 'scripts/service-floodlight.sh', |
| 34 | 'scripts/service-opendaylight.sh', |
| 35 | 'scripts/initopenvim.sh' |
| 36 | ]), |
| 37 | ] |
| 38 | |
| 39 | |
| 40 | _req = [ |
| 41 | "asn1crypto", |
| 42 | "cffi", |
| 43 | "enum34", |
| 44 | "functools32", |
| 45 | "idna", |
| 46 | "ipaddress", |
| 47 | "packaging", |
| 48 | "pbr", |
| 49 | "pkgconfig", |
| 50 | "pyasn1", |
| 51 | "pycparser", |
| 52 | "pycrypto", |
| 53 | "pyparsing", |
| 54 | "six", |
| 55 | "jsonschema", |
| 56 | "argcomplete", |
| 57 | "requests", |
| 58 | "PyYAML", |
| 59 | "requestsexceptions", |
| 60 | "netaddr", |
| 61 | "bottle", |
| 62 | "MySQL-python", |
| 63 | "paramiko", |
| 64 | "libvirt-python" |
| 65 | ] |
| 66 | |
| mirabal | 622e55d | 2017-04-06 11:01:05 +0200 | [diff] [blame^] | 67 | __scripts__ = ['openflow', 'openvim', 'ovim'] |
| mirabal | d87877c | 2017-03-31 15:15:52 +0200 | [diff] [blame] | 68 | |
| 69 | |
| 70 | class LibOpenvimInstaller(install): |
| 71 | lite = None |
| 72 | user_options = install.user_options + [('lite', None, "Don't install without Machine Learning modules.")] |
| 73 | |
| 74 | def initialize_options(self): |
| 75 | self.lite = None |
| 76 | install.initialize_options(self) |
| 77 | |
| 78 | def finalize_options(self): |
| 79 | install.finalize_options(self) |
| 80 | |
| 81 | def run(self): |
| 82 | |
| mirabal | 622e55d | 2017-04-06 11:01:05 +0200 | [diff] [blame^] | 83 | cmd = 'ln -sf -v /usr/local/osm/openvim/openvimd.cfg /etc/default/openvimd.cfg' |
| mirabal | d87877c | 2017-03-31 15:15:52 +0200 | [diff] [blame] | 84 | system(cmd) |
| 85 | cmd = 'ln -sf -v /usr/local/osm/openvim/openflow /usr/bin/openflow' |
| 86 | system(cmd) |
| 87 | cmd = 'ln -sf -v /usr/local/osm/openvim/ovim.py /usr/bin/ovim' |
| 88 | system(cmd) |
| mirabal | d87877c | 2017-03-31 15:15:52 +0200 | [diff] [blame] | 89 | |
| 90 | install.run(self) |
| 91 | |
| 92 | |
| 93 | setup(name=__name__, |
| 94 | version=__version__, |
| 95 | description=__description__, |
| 96 | long_description=__description__, |
| 97 | author=__author__, |
| 98 | author_email=__author_email__, |
| 99 | license=__license__, |
| 100 | maintainer=__maintainer__, |
| 101 | maintainer_email=__maintainer_email__, |
| 102 | url=__url__, |
| 103 | py_modules=['ovim', |
| 104 | 'openvimd', |
| 105 | 'vim_db', |
| 106 | 'httpserver', |
| 107 | 'RADclass', |
| 108 | 'auxiliary_functions', |
| 109 | 'dhcp_thread', |
| 110 | 'definitionsClass', |
| 111 | 'host_thread', |
| 112 | 'vim_schema', |
| 113 | 'ovim', |
| 114 | 'openflow_thread', |
| mirabal | 15f2387 | 2017-04-04 18:03:27 +0200 | [diff] [blame] | 115 | 'openflow_conn', |
| mirabal | d87877c | 2017-03-31 15:15:52 +0200 | [diff] [blame] | 116 | 'onos', |
| 117 | 'ODL', |
| 118 | 'floodlight', |
| 119 | ], |
| 120 | packages=find_packages() + ['database_utils'] + ['scripts'], |
| 121 | package_dir={__name__: __name__}, |
| 122 | package_data={'database_utils': ['*'], 'scripts': ['*']}, |
| 123 | scripts=__scripts__, |
| 124 | data_files=__data_files__, |
| 125 | include_package_data=True, |
| 126 | cmdclass={'install': LibOpenvimInstaller}, |
| 127 | install_requires=_req |
| 128 | ) |
| 129 | |
| 130 | |