From f6e088ee872f4ecbeff3c2c0d52a14eeaf580b99 Mon Sep 17 00:00:00 2001 From: Brad Hall Date: Wed, 9 Nov 2011 22:57:13 -0800 Subject: [PATCH] Second round of packaging changes This change condenses the directory structure to something more similar to what we had before while producing similar packages. It also introduces version.py which allows us to get the version from git tags (or a fallback version if not available). Fixes lp bug 889336 Fixes lp bug 888795 Change-Id: I86136bd9dbabb5eb1f8366ed665ed9b54f695124 --- MANIFEST.in | 5 +++++ setup.py | 3 +-- tools/build_debs.sh | 7 +------ tools/build_rpms.sh | 2 +- tools/source_environment.py | 28 --------------------------- tools/source_nonplugin_environment.py | 26 ------------------------- 6 files changed, 8 insertions(+), 63 deletions(-) create mode 100644 MANIFEST.in delete mode 100644 tools/source_environment.py delete mode 100644 tools/source_nonplugin_environment.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 000000000..fee445d39 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include etc/* +include etc/init.d/* +include etc/quantum/plugins/openvswitch/* +include etc/quantum/plugins/cisco/* +include version.py diff --git a/setup.py b/setup.py index cdb14e4ab..78334102f 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,7 @@ from tools import install_venv ROOT = path.abspath(path.dirname(__file__)) CONFIG_PATH = path.abspath('/etc/quantum') BASE_PACKAGES = ['common', 'server', 'client'] -PLUGINS = ['plugins/sample-plugin', 'plugins/cisco-plugin', - 'plugins/openvswitch-plugin'] +PLUGINS = ['sample_plugin', 'openvswitch_plugin', 'cisco_plugin'] RELATIVE = False diff --git a/tools/build_debs.sh b/tools/build_debs.sh index 557876349..2a7e563e4 100755 --- a/tools/build_debs.sh +++ b/tools/build_debs.sh @@ -13,15 +13,10 @@ if [ `id -u` != 0 ]; then fi fi -ls $@/dist/*.rpm >/dev/null 2>&1 +ls dist/*.rpm >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "You must build rpms before building debian packages" exit 1 fi -cd $@ -if [ $? -ne 0 ]; then - echo "Directory $@ doesn't exist -- what do you want me to build?" - exit 1 -fi $FAKEROOT $ALIEN -c -v -d dist/*.noarch.rpm diff --git a/tools/build_rpms.sh b/tools/build_rpms.sh index 7ae6ef7a2..9775db0de 100755 --- a/tools/build_rpms.sh +++ b/tools/build_rpms.sh @@ -1,2 +1,2 @@ #!/bin/bash -cd $@ && python setup.py bdist_rpm +python setup_$@.py bdist_rpm diff --git a/tools/source_environment.py b/tools/source_environment.py deleted file mode 100644 index 960225cb8..000000000 --- a/tools/source_environment.py +++ /dev/null @@ -1,28 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2011 Cisco Systems -# 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. -# @author: Tyler Smith, Cisco Systems -import os -import sys - -# To run from the source code, we need to add the various packages -# to our path so we can find all of the modules correctly -packages = ['common', 'server', 'client'] -plugins = ["plugins/%s" % p for p in - os.listdir(os.path.join(os.getcwd(), 'plugins'))] - -for project in packages + plugins: - sys.path.insert(0, os.path.join(os.getcwd(), project, 'lib')) diff --git a/tools/source_nonplugin_environment.py b/tools/source_nonplugin_environment.py deleted file mode 100644 index 0891c2f70..000000000 --- a/tools/source_nonplugin_environment.py +++ /dev/null @@ -1,26 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2011 Cisco Systems -# 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. -# @author: Tyler Smith, Cisco Systems -import os -import sys - -# To run from the source code, we need to add the various packages -# to our path so we can find all of the modules correctly -packages = ['common', 'server', 'client'] - -for project in packages + ["plugins/sample-plugin"]: - sys.path.insert(0, os.path.join(os.getcwd(), project, 'lib'))