From 2f522172ce2a7eaa251a742079dadb67aa0ec900 Mon Sep 17 00:00:00 2001 From: Vladimir Kuklin Date: Tue, 28 Feb 2017 15:03:42 +0300 Subject: [PATCH] Introduce proper packaging for fuel-nailgun deb package Closes-bug: #1665311 Related blueprint: distributed-serialization Change-Id: I0c11d18ed456c253971a312f9fb5a41220549be5 --- debian/control | 84 +++++++++++++++++++++++--- debian/copyright | 28 +++++++++ debian/docs | 1 + debian/fencing-agent.dirs | 2 + debian/fencing-agent.install | 3 +- debian/fuel-nailgun.dirs | 4 ++ debian/fuel-nailgun.install | 2 + debian/fuel-openstack-metadata.dirs | 2 + debian/fuel-openstack-metadata.install | 2 + debian/openstack-version | 12 ++++ debian/rules | 47 +++++++++++--- 11 files changed, 170 insertions(+), 17 deletions(-) create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100644 debian/fencing-agent.dirs create mode 100644 debian/fuel-nailgun.dirs create mode 100644 debian/fuel-nailgun.install create mode 100644 debian/fuel-openstack-metadata.dirs create mode 100644 debian/fuel-openstack-metadata.install create mode 100755 debian/openstack-version diff --git a/debian/control b/debian/control index e2a08a9dc3..b44b87a9c8 100644 --- a/debian/control +++ b/debian/control @@ -1,11 +1,80 @@ Source: fuel-nailgun -Section: unknown -Priority: net -Maintainer: Mirantis Producta -Build-Depends: debhelper (>= 8.0.0), python-setuptools -X-Python-Version: 2.6, 2.7 -Standards-Version: 3.9.2 -Homepage: mirantis.com +Section: python +Priority: optional +Maintainer: Mirantis +Build-Depends: debhelper (>= 9), + dh-python, + dh-systemd, + openstack-pkg-tools, + python-all, + python-setuptools (>= 16.0), + python-pbr (>= 1.8), + python-yaml (>= 3.1.0), + git, +Standards-Version: 3.9.4 +Homepage: https://launchpad.net/fuel + +Package: fuel-nailgun +Architecture: all +Depends: fuel-openstack-metadata, + python-alembic (>= 0.8.4), + python-amqplib (>= 1.0.2), + python-anyjson (>= 0.3.3), + python-babel (>= 2.3.4), + python-crypto (>= 2.6.1), + python-decorator (>= 3.4.0), + python-fysom (>= 1.0.11), + python-iso8601 (>= 0.1.11), + python-jinja2 (>= 2.8), + python-jsonschema (>= 2.3.0), + python-keystoneclient (>= 1.7.0), + python-keystonemiddleware (>= 4.0.0), + python-kombu (>= 3.0.25), + python-mako (>= 0.9.1), + python-markupsafe (>= 0.18), + python-migrate (>= 0.9.6), + python-netaddr (>= 0.7.12), + python-netifaces (>= 0.10.4), + python-oslo-config (>= 1:1.2.1), + python-oslo-serialization (>= 1.0.0), + python-oslo-db (>= 1.0.0), + python-paste (>= 1.7.5.1), + python-ply (>= 3.4), + python-psycopg2 (>= 2.5.1), + python-requests (>= 2.10.0), + python-simplejson (>= 3.3.0), + python-six (>= 1.9.0), + python-sqlalchemy (>= 1.0.10), + python-stevedore (>= 1.10.0), + python-urllib3 (>= 1.15.1), + python-webpy (>= 0.37), + python-wsgilog (>= 0.3), + python-yaml (>= 3.10), + python-novaclient (>= 2.29.0), + python-networkx (>= 1.8), + python-cinderclient (>= 1.6.0), + python-pydot-ng (>= 1.0.0), + python-uwsgidecorators (>= 2.0.12), + python-yaql (>= 1.1.0), + python-tz (>= 2013.6), + ${python:Depends}, + ${misc:Depends} +Description: fuel-web (nailgun) implements REST API and deployment data management. + It manages disk volumes configuration data, networks configuration data + and any other environment specific data which are necessary for successful deployment. + It has required orchestration logic to build instructions for provisioning + and deployment in a right order. Nailgun uses SQL database to store its data + and AMQP service to interact with workers. + +Package: fuel-openstack-metadata +Architecture: all +Depends: ${misc:Depends} +Description: fuel-web (nailgun) implements REST API and deployment data management. + It manages disk volumes configuration data, networks configuration data + and any other environment specific data which are necessary for successful deployment. + It has required orchestration logic to build instructions for provisioning + and deployment in a right order. Nailgun uses SQL database to store its data + and AMQP service to interact with workers. Package: fencing-agent Architecture: all @@ -16,4 +85,3 @@ Depends: ohai, ruby-json, ${misc:Depends} Description: Fencing agent - . diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000..8f214532b5 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: fuel-web +Source: https://github.com/openstack/fuel-web.git + +Files: * +Copyright: (c) 2016, Mirantis, Inc. +License: Apache-2 + +Files: debian/* +Copyright: (c) 2016, Mirantis, Inc. +License: Apache-2 + +License: Apache-2 + 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. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. + diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000000..b43bf86b50 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.md diff --git a/debian/fencing-agent.dirs b/debian/fencing-agent.dirs new file mode 100644 index 0000000000..b23cc24dde --- /dev/null +++ b/debian/fencing-agent.dirs @@ -0,0 +1,2 @@ +opt/nailgun/bin +etc/cron.d diff --git a/debian/fencing-agent.install b/debian/fencing-agent.install index 19e8c4724c..713bd0468f 100644 --- a/debian/fencing-agent.install +++ b/debian/fencing-agent.install @@ -1 +1,2 @@ -bin/fencing-agent.rb /opt/nailgun/bin +bin/fencing-agent.rb opt/nailgun/bin +bin/fencing-agent.cron etc/cron.d diff --git a/debian/fuel-nailgun.dirs b/debian/fuel-nailgun.dirs new file mode 100644 index 0000000000..67d11e4780 --- /dev/null +++ b/debian/fuel-nailgun.dirs @@ -0,0 +1,4 @@ +etc/nailgun +var/log/nailgun +usr/bin +usr/share diff --git a/debian/fuel-nailgun.install b/debian/fuel-nailgun.install new file mode 100644 index 0000000000..ef0bddc9c9 --- /dev/null +++ b/debian/fuel-nailgun.install @@ -0,0 +1,2 @@ +nailgun/nailgun/settings.yaml /etc/nailgun/ +systemd/* /lib/systemd/system/ diff --git a/debian/fuel-openstack-metadata.dirs b/debian/fuel-openstack-metadata.dirs new file mode 100644 index 0000000000..7a41f21470 --- /dev/null +++ b/debian/fuel-openstack-metadata.dirs @@ -0,0 +1,2 @@ +usr/share/fuel-openstack-metadata +etc diff --git a/debian/fuel-openstack-metadata.install b/debian/fuel-openstack-metadata.install new file mode 100644 index 0000000000..5c955f5317 --- /dev/null +++ b/debian/fuel-openstack-metadata.install @@ -0,0 +1,2 @@ +nailgun/nailgun/fixtures/openstack.yaml usr/share/fuel-openstack-metadata +fuel_openstack_version etc diff --git a/debian/openstack-version b/debian/openstack-version new file mode 100755 index 0000000000..07f857f01e --- /dev/null +++ b/debian/openstack-version @@ -0,0 +1,12 @@ +#! /usr/bin/env python2 + +import sys +import yaml + +if len(sys.argv) == 2: + openstack_yaml = open(sys.argv[1]) + yaml = yaml.safe_load(openstack_yaml) + elems = filter(lambda r: r['fields'].get('name'), yaml) + print elems[0]['fields']['version'] +else: + print """Usage: {} OPENSTACK_YAML""".format(sys.argv[0]) diff --git a/debian/rules b/debian/rules index 97312077be..c4d7e8e62c 100755 --- a/debian/rules +++ b/debian/rules @@ -1,15 +1,46 @@ #!/usr/bin/make -f +# -*- makefile -*- + DH_VERBOSE=1 -topdir=$(shell pwd) +PYTHONS:=$(shell pyversions -vr) + +include /usr/share/openstack-pkg-tools/pkgos.make + +#export OSLO_PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1) %: - dh $@ --with python2 + dh $@ --with python2,systemd + +override_dh_auto_build: + dh_auto_build + python $(CURDIR)/debian/openstack-version nailgun/nailgun/fixtures/openstack.yaml > $(CURDIR)/fuel_openstack_version override_dh_auto_install: - dh_auto_install -override_dh_auto_build: - dh_clean - dh_auto_build -override_dh_auto_clean: - dh_auto_clean + cd nailgun \ + set -e ; for pyvers in $(PYTHONS); do \ + python$$pyvers setup.py install --install-layout=deb \ + --root $(CURDIR)/debian/fuel-nailgun; \ + done + +override_dh_clean: + rm -rf build + dh_clean -O--buildsystem=python_distutils + rm -f debian/nailgun-common.postinst + rm -f debian/*.service debian/*.init debian/*.upstart + +override_dh_systemd_enable: gen-init-configurations + dh_systemd_enable --no-enable + +override_dh_systemd_start: gen-init-configurations + dh_systemd_start --no-start + +# Commands not to run +override_dh_installcatalogs: +override_dh_installemacsen override_dh_installifupdown: +override_dh_installinfo override_dh_installmenu override_dh_installmime: +override_dh_installmodules override_dh_installlogcheck: +override_dh_installpam override_dh_installppp override_dh_installudev override_dh_installwm: +override_dh_installxfonts override_dh_gconf override_dh_icons override_dh_perl override_dh_usrlocal: +override_dh_installcron override_dh_installdebconf: +override_dh_installlogrotate override_dh_installgsettings: