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
This commit is contained in:
Brad Hall 2011-11-09 22:57:13 -08:00
parent dde7be9168
commit f6e088ee87
6 changed files with 8 additions and 63 deletions

5
MANIFEST.in Normal file
View File

@ -0,0 +1,5 @@
include etc/*
include etc/init.d/*
include etc/quantum/plugins/openvswitch/*
include etc/quantum/plugins/cisco/*
include version.py

View File

@ -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

View File

@ -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

View File

@ -1,2 +1,2 @@
#!/bin/bash
cd $@ && python setup.py bdist_rpm
python setup_$@.py bdist_rpm

View File

@ -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'))

View File

@ -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'))