summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xbin/ryu-manager6
-rw-r--r--ryu/hooks.py33
-rw-r--r--setup.cfg35
-rw-r--r--setup.py51
4 files changed, 77 insertions, 48 deletions
diff --git a/bin/ryu-manager b/bin/ryu-manager
index 62188dea..cc1ea747 100755
--- a/bin/ryu-manager
+++ b/bin/ryu-manager
@@ -53,7 +53,11 @@ CONF.register_cli_opts([
def main():
- CONF(project='ryu', version='ryu-manager %s' % version)
+ try:
+ CONF(project='ryu', version='ryu-manager %s' % version,
+ default_config_files=['/usr/local/etc/ryu/ryu.conf'])
+ except cfg.ConfigFilesNotFoundError:
+ CONF(project='ryu', version='ryu-manager %s' % version)
log.init_log()
diff --git a/ryu/hooks.py b/ryu/hooks.py
new file mode 100644
index 00000000..c2414cdb
--- /dev/null
+++ b/ryu/hooks.py
@@ -0,0 +1,33 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2013 Hewlett-Packard Development Company, L.P.
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import sys
+from ryu import version
+
+
+def setup_hook(config):
+ """Filter config parsed from a setup.cfg to inject our defaults."""
+ metadata = config['metadata']
+ if sys.platform == 'win32':
+ requires = metadata.get('requires_dist', list()).split('\n')
+ requires.append('pywin32')
+ requires.append('wmi')
+ requires.remove('pyudev')
+ metadata['requires_dist'] = "\n".join(requires)
+ config['metadata'] = metadata
+
+ metadata['version'] = str(version)
diff --git a/setup.cfg b/setup.cfg
index 1cbeeddc..e5a38037 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,33 @@
+[metadata]
+name = ryu
+summary = Component-based Software-defined Networking Framework
+license = Apache License 2.0
+author = Ryu project team
+author-email = ryu-devel@lists.sourceforge.net
+home-page = http://osrg.github.io/ryu/
+description-file = README.rst
+platform = any
+classifier =
+ Development Status :: 5 - Production/Stable
+ License :: OSI Approved :: Apache Software License
+ Topic :: System :: Networking
+ Natural Language :: English
+ Programming Language :: Python
+ Operating System :: Unix
+keywords =
+ openflow
+ openvswitch
+ openstack
+
+[files]
+packages =
+ ryu
+data_files =
+ etc/ryu =
+ etc/ryu/ryu.conf
+scripts =
+ bin/ryu-manager
+
[build_sphinx]
all_files = 1
build-dir = doc/build
@@ -12,3 +42,8 @@ doc_files = LICENSE
README.rst
SubmittingPatches.rst
doc/
+
+[global]
+setup-hooks =
+ pbr.hooks.setup_hook
+ ryu.hooks.setup_hook
diff --git a/setup.py b/setup.py
index 55c2660a..a613f3fb 100644
--- a/setup.py
+++ b/setup.py
@@ -14,52 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import sys
+import setuptools
-from setuptools import find_packages
-from setuptools import setup
-from ryu import version
-from ryu import utils
-
-requires = utils.parse_requirements()
-
-doing_bdist = any(arg.startswith('bdist') for arg in sys.argv[1:])
-
-long_description = open('README.rst').read() + '\n\n'
-
-if doing_bdist:
- start = long_description.find('=\n') + 2
- long_description = long_description[
- start:long_description.find('\n\n\n', start)]
-
-classifiers = [
- 'Development Status :: 5 - Production/Stable',
- 'License :: OSI Approved :: Apache Software License',
- 'Topic :: System :: Networking',
- 'Natural Language :: English',
- 'Programming Language :: Python',
- 'Operating System :: Unix',
-]
-
-if sys.platform == 'win32':
- data_files = [('etc/ryu', ['etc/ryu/ryu.conf'])]
-else:
- data_files = [('/etc/ryu', ['etc/ryu/ryu.conf'])]
-
-setup(name='ryu',
- version=version,
- description=("Ryu Network Operating System"),
- long_description=long_description,
- classifiers=classifiers,
- keywords='openflow openvswitch openstack',
- url='http://osrg.github.io/ryu/',
- author='Ryu project team',
- author_email='ryu-devel@lists.sourceforge.net',
- install_requires=requires,
- license='Apache License 2.0',
- packages=find_packages(),
- scripts=['bin/ryu-manager', ],
- data_files=data_files,
- include_package_data=True,
- )
+setuptools.setup(name='ryu',
+ setup_requires=['d2to1', 'pbr'],
+ d2to1=True)