From 7b127659e58af5f26230dad4fcb0fda3dc3d28b6 Mon Sep 17 00:00:00 2001 From: Charles Short Date: Wed, 25 Aug 2021 15:08:47 -0400 Subject: [PATCH] Add debian package infra for fm-api Add debian packaging infrastructure for fm-api so we can create a debian packaging for it. Also update the directory layout due to limitations of the STX tool. Update the centos build information to reflect the new layout. Story: 2009101 Task: 43091 Signed-off-by: Charles Short Change-Id: I5c9784647581f31384d7475f596663adc0d26498 --- fm-api/centos/build_srpm.data | 2 +- fm-api/debian/control | 14 --------- fm-api/debian/deb_folder/changelog | 5 ++++ fm-api/debian/deb_folder/control | 16 ++++++++++ fm-api/debian/deb_folder/copyright | 40 +++++++++++++++++++++++++ fm-api/debian/deb_folder/rules | 7 +++++ fm-api/debian/deb_folder/source/format | 1 + fm-api/debian/deb_folder/source/options | 1 + fm-api/debian/meta_data.yaml | 7 +++++ fm-api/debian/rules | 7 ----- fm-api/{ => source}/LICENSE | 0 fm-api/{ => source}/fm_api/__init__.py | 0 fm-api/{ => source}/fm_api/constants.py | 0 fm-api/{ => source}/fm_api/fm_api.py | 0 fm-api/{ => source}/fm_api_test.py | 0 fm-api/{ => source}/fm_api_v2_test.py | 0 fm-api/{ => source}/setup.cfg | 0 fm-api/{ => source}/setup.py | 0 fm-rest-api/fm/tox.ini | 4 +-- tox.ini | 2 +- 20 files changed, 81 insertions(+), 25 deletions(-) delete mode 100644 fm-api/debian/control create mode 100644 fm-api/debian/deb_folder/changelog create mode 100644 fm-api/debian/deb_folder/control create mode 100644 fm-api/debian/deb_folder/copyright create mode 100755 fm-api/debian/deb_folder/rules create mode 100644 fm-api/debian/deb_folder/source/format create mode 100644 fm-api/debian/deb_folder/source/options create mode 100644 fm-api/debian/meta_data.yaml delete mode 100644 fm-api/debian/rules rename fm-api/{ => source}/LICENSE (100%) rename fm-api/{ => source}/fm_api/__init__.py (100%) rename fm-api/{ => source}/fm_api/constants.py (100%) rename fm-api/{ => source}/fm_api/fm_api.py (100%) rename fm-api/{ => source}/fm_api_test.py (100%) rename fm-api/{ => source}/fm_api_v2_test.py (100%) rename fm-api/{ => source}/setup.cfg (100%) rename fm-api/{ => source}/setup.py (100%) diff --git a/fm-api/centos/build_srpm.data b/fm-api/centos/build_srpm.data index 3d66cb2e..743c6aa7 100755 --- a/fm-api/centos/build_srpm.data +++ b/fm-api/centos/build_srpm.data @@ -1,4 +1,4 @@ -SRC_DIR="." +SRC_DIR="source" EXCLUDE_FILES_FROM_TAR="centos" TIS_PATCH_VER=PKG_GITREVCOUNT diff --git a/fm-api/debian/control b/fm-api/debian/control deleted file mode 100644 index e7ce9ded..00000000 --- a/fm-api/debian/control +++ /dev/null @@ -1,14 +0,0 @@ -Source: fm-api -Priority: optional -Maintainer: StarlingX team -Build-Depends: python-setuptools, - python-all, - debhelper, - dh-python -Standards-Version: 3.9.6 - -Package: fm-api -Architecture: all -Depends: ${misc:Depends}, - ${python:Depends} -Description: This package contains the fm-api project. diff --git a/fm-api/debian/deb_folder/changelog b/fm-api/debian/deb_folder/changelog new file mode 100644 index 00000000..aac69af5 --- /dev/null +++ b/fm-api/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +fm-api (1.0-1) unstable; urgency=medium + + * Initial release. + + -- Charles Short +Build-Depends: debhelper-compat (= 13), dh-python, python3-setuptools, python3-all +Standards-Version: 4.4.1 +Homepage: https://www.starlingx.io + +Package: python3-fm-api +Architecture: all +Depends: ${python3:Depends}, ${misc:Depends} +Description: Starlingx fault management api + Provides the the APIs for applications to raise/clear/update + active alarms. + . + This package installs the library for Python 3. diff --git a/fm-api/debian/deb_folder/copyright b/fm-api/debian/deb_folder/copyright new file mode 100644 index 00000000..f7e88ce0 --- /dev/null +++ b/fm-api/debian/deb_folder/copyright @@ -0,0 +1,40 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: fm-api +Source: https://opendev.org/starlingx/fault + +Files: * +Copyright: (c) 2013-2021 Wind River Systems, Inc + Others (See individual files for more details) +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 + . + https://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'. + +Files: debian/* +Copyright: 2021 Wind River Systems, Inc +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 + . + https://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/fm-api/debian/deb_folder/rules b/fm-api/debian/deb_folder/rules new file mode 100755 index 00000000..085e19ab --- /dev/null +++ b/fm-api/debian/deb_folder/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + +export PYBUILD_NAME=fm-api + +%: + dh $@ --with python3 --buildsystem=pybuild diff --git a/fm-api/debian/deb_folder/source/format b/fm-api/debian/deb_folder/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/fm-api/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/fm-api/debian/deb_folder/source/options b/fm-api/debian/deb_folder/source/options new file mode 100644 index 00000000..cb61fa52 --- /dev/null +++ b/fm-api/debian/deb_folder/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "^[^/]*[.]egg-info/" diff --git a/fm-api/debian/meta_data.yaml b/fm-api/debian/meta_data.yaml new file mode 100644 index 00000000..fe5c7d0a --- /dev/null +++ b/fm-api/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: fm-api +debver: 1.0-1 +src_path: source +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/fm-api/debian/rules b/fm-api/debian/rules deleted file mode 100644 index b54cfd7e..00000000 --- a/fm-api/debian/rules +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/make -f - -export PYBUILD_INSTALL_ARGS=--install-data=/usr/share --prefix=/usr - -%: - dh $@ --with python2 --buildsystem=pybuild - diff --git a/fm-api/LICENSE b/fm-api/source/LICENSE similarity index 100% rename from fm-api/LICENSE rename to fm-api/source/LICENSE diff --git a/fm-api/fm_api/__init__.py b/fm-api/source/fm_api/__init__.py similarity index 100% rename from fm-api/fm_api/__init__.py rename to fm-api/source/fm_api/__init__.py diff --git a/fm-api/fm_api/constants.py b/fm-api/source/fm_api/constants.py similarity index 100% rename from fm-api/fm_api/constants.py rename to fm-api/source/fm_api/constants.py diff --git a/fm-api/fm_api/fm_api.py b/fm-api/source/fm_api/fm_api.py similarity index 100% rename from fm-api/fm_api/fm_api.py rename to fm-api/source/fm_api/fm_api.py diff --git a/fm-api/fm_api_test.py b/fm-api/source/fm_api_test.py similarity index 100% rename from fm-api/fm_api_test.py rename to fm-api/source/fm_api_test.py diff --git a/fm-api/fm_api_v2_test.py b/fm-api/source/fm_api_v2_test.py similarity index 100% rename from fm-api/fm_api_v2_test.py rename to fm-api/source/fm_api_v2_test.py diff --git a/fm-api/setup.cfg b/fm-api/source/setup.cfg similarity index 100% rename from fm-api/setup.cfg rename to fm-api/source/setup.cfg diff --git a/fm-api/setup.py b/fm-api/source/setup.py similarity index 100% rename from fm-api/setup.py rename to fm-api/source/setup.py diff --git a/fm-rest-api/fm/tox.ini b/fm-rest-api/fm/tox.ini index fa993e46..738dfeb3 100644 --- a/fm-rest-api/fm/tox.ini +++ b/fm-rest-api/fm/tox.ini @@ -14,7 +14,7 @@ deps = -chttps://opendev.org/openstack/requirements/raw/branch/stable/stein/uppe -r{toxinidir}/test-requirements.txt -e{[tox]stxdir}/config/tsconfig/tsconfig -e{[tox]stxdir}/config/sysinv/cgts-client/cgts-client - -e{[tox]stxdir}/fault/fm-api + -e{[tox]stxdir}/fault/fm-api/source -e{[tox]stxdir}/fault/fm-rest-api/fm [testenv:venv] @@ -39,7 +39,7 @@ deps = -chttps://opendev.org/starlingx/root/raw/branch/master/build-tools/requir -r{toxinidir}/test-requirements.txt -e{[tox]stxdir}/config/tsconfig/tsconfig -e{[tox]stxdir}/config/sysinv/cgts-client/cgts-client - -e{[tox]stxdir}/fault/fm-api + -e{[tox]stxdir}/fault/fm-api/source -e{[tox]stxdir}/fault/fm-rest-api/fm commands = stestr run {posargs} diff --git a/tox.ini b/tox.ini index 6355540b..b8ca21be 100644 --- a/tox.ini +++ b/tox.ini @@ -59,7 +59,7 @@ deps = {[testenv]deps} -r{toxinidir}/requirements.txt commands = pylint {posargs} --rcfile=./pylint.rc \ - fm-api/fm_api \ + fm-api/source/fm_api \ fm-common/sources/fm_db_sync_event_suppression.py \ fm-rest-api/fm/fm \ python-fmclient/fmclient/fmclient