From 0131cd569c2da721aea050a251f1176589a338bf Mon Sep 17 00:00:00 2001 From: Tracey Bogue Date: Mon, 8 Nov 2021 10:06:16 -0600 Subject: [PATCH] Add Debian packaging for patch packages Create Debian packages for patch-alarm and enable-dev-patch. Story: 2009101 Task: 43897 Signed-off-by: Tracey Bogue Change-Id: Iaa0958cc857d914a99c69e063b46ded59b4af285 --- debian_pkg_dirs | 2 + enable-dev-patch/debian/deb_folder/changelog | 5 +++ enable-dev-patch/debian/deb_folder/control | 15 +++++++ enable-dev-patch/debian/deb_folder/copyright | 41 +++++++++++++++++ .../deb_folder/enable-dev-patch.install | 1 + enable-dev-patch/debian/deb_folder/rules | 15 +++++++ .../debian/deb_folder/source/format | 1 + enable-dev-patch/debian/meta_data.yaml | 7 +++ patch-alarm/debian/deb_folder/changelog | 5 +++ patch-alarm/debian/deb_folder/control | 27 ++++++++++++ patch-alarm/debian/deb_folder/copyright | 41 +++++++++++++++++ .../python3-patch-alarm-wheels.install | 1 + .../deb_folder/python3-patch-alarm.install | 4 ++ patch-alarm/debian/deb_folder/rules | 44 +++++++++++++++++++ patch-alarm/debian/deb_folder/source/format | 1 + patch-alarm/debian/dl_hook | 13 ++++++ patch-alarm/debian/meta_data.yaml | 7 +++ 17 files changed, 230 insertions(+) create mode 100644 enable-dev-patch/debian/deb_folder/changelog create mode 100644 enable-dev-patch/debian/deb_folder/control create mode 100644 enable-dev-patch/debian/deb_folder/copyright create mode 100644 enable-dev-patch/debian/deb_folder/enable-dev-patch.install create mode 100755 enable-dev-patch/debian/deb_folder/rules create mode 100644 enable-dev-patch/debian/deb_folder/source/format create mode 100644 enable-dev-patch/debian/meta_data.yaml create mode 100644 patch-alarm/debian/deb_folder/changelog create mode 100644 patch-alarm/debian/deb_folder/control create mode 100644 patch-alarm/debian/deb_folder/copyright create mode 100644 patch-alarm/debian/deb_folder/python3-patch-alarm-wheels.install create mode 100644 patch-alarm/debian/deb_folder/python3-patch-alarm.install create mode 100755 patch-alarm/debian/deb_folder/rules create mode 100644 patch-alarm/debian/deb_folder/source/format create mode 100755 patch-alarm/debian/dl_hook create mode 100644 patch-alarm/debian/meta_data.yaml diff --git a/debian_pkg_dirs b/debian_pkg_dirs index de8743c4..3ec2cc02 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -1 +1,3 @@ cgcs-patch +enable-dev-patch +patch-alarm diff --git a/enable-dev-patch/debian/deb_folder/changelog b/enable-dev-patch/debian/deb_folder/changelog new file mode 100644 index 00000000..97e02153 --- /dev/null +++ b/enable-dev-patch/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +enable-dev-patch (1.0-1) unstable; urgency=medium + + * Initial release. + + -- Tracey Bogue Mon, 8 Nov 2021 08:53:42 +0000 diff --git a/enable-dev-patch/debian/deb_folder/control b/enable-dev-patch/debian/deb_folder/control new file mode 100644 index 00000000..3e846319 --- /dev/null +++ b/enable-dev-patch/debian/deb_folder/control @@ -0,0 +1,15 @@ +Source: enable-dev-patch +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: enable-dev-patch +Section: libs +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX Enable Developer Patch Installation + This package enables the installation of StarlingX patches signed by + developers. diff --git a/enable-dev-patch/debian/deb_folder/copyright b/enable-dev-patch/debian/deb_folder/copyright new file mode 100644 index 00000000..5225061e --- /dev/null +++ b/enable-dev-patch/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: enable-dev-patch +Source: https://opendev.org/starlingx/update/ + +Files: * +Copyright: (c) 2013-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'. + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +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/enable-dev-patch/debian/deb_folder/enable-dev-patch.install b/enable-dev-patch/debian/deb_folder/enable-dev-patch.install new file mode 100644 index 00000000..94344406 --- /dev/null +++ b/enable-dev-patch/debian/deb_folder/enable-dev-patch.install @@ -0,0 +1 @@ +etc/pki/wrs/dev_certificate_enable.bin diff --git a/enable-dev-patch/debian/deb_folder/rules b/enable-dev-patch/debian/deb_folder/rules new file mode 100755 index 00000000..9009c199 --- /dev/null +++ b/enable-dev-patch/debian/deb_folder/rules @@ -0,0 +1,15 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export ROOT=debian/tmp +export WRSPKIDIR=$(ROOT)/etc/pki/wrs + +%: + dh $@ + +override_dh_auto_install: + install -m 755 -d $(WRSPKIDIR) + install -m 444 dev_certificate_enable.bin $(WRSPKIDIR) + +override_dh_fixperms: + dh_fixperms -Xdev_certificate_enable.bin diff --git a/enable-dev-patch/debian/deb_folder/source/format b/enable-dev-patch/debian/deb_folder/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/enable-dev-patch/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/enable-dev-patch/debian/meta_data.yaml b/enable-dev-patch/debian/meta_data.yaml new file mode 100644 index 00000000..282eb967 --- /dev/null +++ b/enable-dev-patch/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: enable-dev-patch +debver: 1.0-1 +src_path: enable-dev-patch +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/patch-alarm/debian/deb_folder/changelog b/patch-alarm/debian/deb_folder/changelog new file mode 100644 index 00000000..d09295e8 --- /dev/null +++ b/patch-alarm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +python3-patch-alarm (1.0-1) unstable; urgency=medium + + * Initial release. + + -- Tracey Bogue Fri, 5 Nov 2021 15:07:42 +0000 diff --git a/patch-alarm/debian/deb_folder/control b/patch-alarm/debian/deb_folder/control new file mode 100644 index 00000000..d2e1873b --- /dev/null +++ b/patch-alarm/debian/deb_folder/control @@ -0,0 +1,27 @@ +Source: python3-patch-alarm +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), + dh-python, + python3-all, + python3-setuptools, + python3-wheel +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: python3-patch-alarm +Section: libs +Architecture: any +Depends: ${misc:Depends}, ${python3:Depends}, python3-dev +Description: StarlingX Patch Alarm Management + This package contains the StarlingX platform patching alarm + manager. + +Package: python3-patch-alarm-wheels +Section: libs +Architecture: any +Depends: ${misc:Depends}, ${python3:Depends}, python3-wheel +Description: StarlingX Patch Alarm Management Wheels + This package contains python wheels for the platform patching + alarm manager. diff --git a/patch-alarm/debian/deb_folder/copyright b/patch-alarm/debian/deb_folder/copyright new file mode 100644 index 00000000..b191bb0c --- /dev/null +++ b/patch-alarm/debian/deb_folder/copyright @@ -0,0 +1,41 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: python3-patch-alarm +Source: https://opendev.org/starlingx/update/ + +Files: * +Copyright: (c) 2013-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'. + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines +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/patch-alarm/debian/deb_folder/python3-patch-alarm-wheels.install b/patch-alarm/debian/deb_folder/python3-patch-alarm-wheels.install new file mode 100644 index 00000000..20b9ca7f --- /dev/null +++ b/patch-alarm/debian/deb_folder/python3-patch-alarm-wheels.install @@ -0,0 +1 @@ +plugins/patch-alarm/*.whl diff --git a/patch-alarm/debian/deb_folder/python3-patch-alarm.install b/patch-alarm/debian/deb_folder/python3-patch-alarm.install new file mode 100644 index 00000000..ed2fba48 --- /dev/null +++ b/patch-alarm/debian/deb_folder/python3-patch-alarm.install @@ -0,0 +1,4 @@ +etc/init.d/patch-alarm-manager +usr/bin/patch-alarm-manager +usr/lib/python3/dist-packages/patch_alarm-1.0.0.egg-info/* +usr/lib/python3/dist-packages/patch_alarm/* diff --git a/patch-alarm/debian/deb_folder/rules b/patch-alarm/debian/deb_folder/rules new file mode 100755 index 00000000..aea39011 --- /dev/null +++ b/patch-alarm/debian/deb_folder/rules @@ -0,0 +1,44 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export ROOT=debian/tmp +export BINDIR=$(ROOT)/usr/bin +export INITDIR=$(ROOT)/etc/init.d + +export APP_NAME=patch-alarm +export PYBUILD_NAME=k8sapp-vault +export SKIP_PIP_INSTALL=1 + +%: + dh $@ --with=python3 --buildsystem=pybuild + +override_dh_auto_build: + python3 setup.py build + +override_dh_auto_install: + python3 setup.py install \ + --skip-build \ + --install-layout=deb \ + --root $(ROOT) \ + --prefix=/usr \ + --install-data=/usr/share \ + --single-version-externally-managed + python3 setup.py bdist_wheel \ + --universal \ + -d $(ROOT)/plugins/$(APP_NAME) + install -m 755 -d $(BINDIR) + install -m 700 scripts/bin/patch-alarm-manager $(BINDIR) + install -m 755 -d $(INITDIR) + install -m 700 scripts/init.d/patch-alarm-manager $(INITDIR) + +override_dh_fixperms: + dh_fixperms -Xpatch-alarm-manager + +override_dh_python3: + dh_python3 --shebang=/usr/bin/python3 + +ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) +override_dh_auto_test: + # (tbogue) FIXME + PYTHONDIR=$(CURDIR) stestr run || true +endif diff --git a/patch-alarm/debian/deb_folder/source/format b/patch-alarm/debian/deb_folder/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/patch-alarm/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/patch-alarm/debian/dl_hook b/patch-alarm/debian/dl_hook new file mode 100755 index 00000000..4a128d3f --- /dev/null +++ b/patch-alarm/debian/dl_hook @@ -0,0 +1,13 @@ +#!/bin/bash +set -x + +PKG_BUILD_NAME=$1 +PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME}) +STX_BASE=$(realpath ${MY_REPO}/stx) +SRC=$(realpath ${STX_BASE}/update/patch-alarm) + +mkdir ${PKG_BUILD_NAME} + +# Copy source files from multiple locations to build root. +cp -pr ${SRC}/patch-alarm/* ${PKG_BUILD_ROOT} +cp -pr ${SRC}/scripts ${PKG_BUILD_ROOT} diff --git a/patch-alarm/debian/meta_data.yaml b/patch-alarm/debian/meta_data.yaml new file mode 100644 index 00000000..0041fc4e --- /dev/null +++ b/patch-alarm/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: python3-patch-alarm +debver: 1.0-1 +dl_hook: dl_hook +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true