Add debian package for platform-util

Add debian packaging infrastructure for platform-util.

Story: 2009101
Task: 43073

Depends-On: I4a3b9903c7510ecb3177a8341d6f83b750fbc01b
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: Ia64b128eb8f4cd0050c0d0b34729a365adfe26a0
This commit is contained in:
Charles Short 2021-09-23 08:05:20 -04:00 committed by Dan Voiculeasa
parent 12d8c8aa4c
commit 6d7ee3067f
19 changed files with 201 additions and 0 deletions

1
debian_pkg_dirs Normal file
View File

@ -0,0 +1 @@
utilities/platform-util

View File

@ -0,0 +1,5 @@
platform-util (1.0-1) unstable; urgency=medium
* Initial release.
-- Chuck Short <charles.short@windriver.com> Sat, 21 Aug 2021 11:19:49 -0400

View File

@ -0,0 +1,47 @@
Source: platform-util
Section: admin
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13),
dh-python,
python3-setuptools,
python3-wheel,
python3-all
Build-Depends-Indep: python3-stevedore
Standards-Version: 4.4.1
Package: platform-util
Architecture: all
Depends: ${python3:Depends}, ${misc:Depends}, python3-platform-util
Description: Controller platform utilities - scripts
Controller platform utilities
Package: python3-platform-util
Architecture: all
Section: python
Depends: ${python3:Depends}, ${misc:Depends}, python3-stevedore
Description: Controller platform utilities - python
Controller platform utilities
.
This package contains the core python bits
Package: platform-util-controller
Architecture: all
Depends: ${python3:Depends}, ${misc:Depends}, python3-platform-util, genisoimage
Description: Controller platform utilities
Platform utilities installed only on controllers
Package: platform-util-noncontroller
Architecture: all
Depends: ${python3:Depends}, ${misc:Depends}, python3-platform-util
Description: Noncontroller platform utilities
Platform utilities that don't get packaged on controller hosts
Platform utilities installed only on controllers
Package: platform-util-wheel
Architecture: all
Depends: ${misc:Depends}, python3-wheel
Description: Controller platform utilities - wheel
Controller platform utilities
.
This package contains the python3 wheels

View File

@ -0,0 +1,4 @@
scripts/gen-bootloader-iso.sh usr/local/bin
scripts/show-certs.sh usr/local/bin
scripts/stx-iso-utils.sh usr/local/bin
scripts/update-iso.sh usr/local/bin

View File

@ -0,0 +1,28 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: platform-util
Source: https://opendev.org/starlingx/utilities
Files: *
Copyright: (c) 2013-2021 Wind River Systems, Inc
Others (See individual files for more details)
License: Apache-2
Files: debian/*
Copyright: 2021 Wind River Systems, 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
.
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'.

View File

@ -0,0 +1,2 @@
scripts/opt-platform.mount lib/systemd/system
scripts/opt-platform.service lib/systemd/system

View File

@ -0,0 +1,9 @@
#!/bin/sh
set -e
if [ "$1" = "configure"]; then
mkdir -p /opt/platform
fi
#DEBHELPER#

View File

@ -0,0 +1,4 @@
/usr/local/bin/gen-bootloader-iso.sh
/usr/local/bin/show-certs.sh
/usr/local/bin/stx-iso-utils.sh
/usr/local/bin/update-iso.sh

View File

@ -0,0 +1,3 @@
non-standard-executable-perm
file-in-usr-local
dir-in-usr-local

View File

@ -0,0 +1,2 @@
scripts/opt-platform.mount lib/systemd/system
scripts/opt-platform.service lib/systemd/system

View File

@ -0,0 +1,9 @@
#!/bin/sh
set -e
if [ "$1" = "configure"]; then
mkdir -p /opt/platform
fi
#DEBHELPER#

View File

@ -0,0 +1,11 @@
usr/bin/verify-license
scripts/tc_setup.sh usr/local/bin
scripts/remotelogging_tc_setup.sh usr/local/bin
scripts/log_functions.sh etc/init.d
/usr/local/bin/set_keystone_user_option.sh
/usr/local/bin/connectivity_test
/usr/local/bin/is-rootdisk-device.sh
/usr/local/sbin/patch-restart-mtce
/usr/local/sbin/patch-restart-processes
/usr/local/sbin/patch-restart-haproxy

View File

@ -0,0 +1,5 @@
executable-is-not-world-readable
non-standard-executable-perm
file-in-usr-local
dir-in-usr-local
no-manual-page

View File

@ -0,0 +1 @@
usr/lib/python*

View File

@ -0,0 +1,50 @@
#!/usr/bin/make -f
#export DH_VERBOSE = 1
DEBIAN_BUILDDIR := $(CURDIR)/debian/tmp
%:
dh $@ --with python3 --buildsystem=pybuild
# do nothing here since we install stuff into /usr/local
override_dh_usrlocal:
echo
override_dh_auto_clean:
cd platform-util && python3 setup.py clean
override_dh_auto_build:
cd platform-util && python3 setup.py build
override_dh_auto_configure:
echo "CONFIGURE NOT REQUIRED"
override_dh_auto_test:
echo "AUTO TEST NOT REQUIRED"
override_dh_auto_install:
cd platform-util && python3 setup.py install -f --install-layout=deb --root=$(CURDIR)/debian/tmp
cd platform-util && python3 setup.py bdist_wheel \
--universal \
-d $(CURDIR)/debian/platform-util-wheel/usr/share/python3-wheels
install -d $(DEBIAN_BUILDDIR)/usr/local/bin/
install -m 555 scripts/update-iso.sh $(DEBIAN_BUILDDIR)/usr/local/bin/
install -m 555 scripts/gen-bootloader-iso.sh $(DEBIAN_BUILDDIR)/usr/local/bin/
install -m 555 scripts/stx-iso-utils.sh $(DEBIAN_BUILDDIR)/usr/local/bin/
install -m 555 scripts/show-certs.sh $(DEBIAN_BUILDDIR)/usr/local/bin/
install -m 555 scripts/is-rootdisk-device.sh $(DEBIAN_BUILDDIR)/usr/local/bin/
install -m 755 scripts/connectivity_test $(DEBIAN_BUILDDIR)/usr/local/bin/
install -m 750 scripts/set_keystone_user_option.sh $(DEBIAN_BUILDDIR)/usr/local/bin/
install -d $(DEBIAN_BUILDDIR)/usr/local/sbin/
install -m 700 -p -D scripts/patch-restart-mtce $(DEBIAN_BUILDDIR)/usr/local/sbin/
install -m 700 -p -D scripts/patch-restart-processes $(DEBIAN_BUILDDIR)/usr/local/sbin/
install -m 700 -p -D scripts/patch-restart-haproxy $(DEBIAN_BUILDDIR)/usr/local/sbin/
dh_install
override_dh_fixperms:
dh_fixperms -Xupdate-iso.sh -Xgen-bootloader-iso.sh -Xstx-iso-utils.sh \
-Xshow-certs.sh -Xis-rootdisk-device.sh -Xpatch-restart-* -Xconnectivity_test \
-Xset_keystone_user_option.sh

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1 @@
extend-diff-ignore = "^[^/]*[.]egg-info/"

View File

@ -0,0 +1,11 @@
#!/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}/utilities/utilities/platform-util)
mkdir ${PKG_BUILD_NAME}
pushd ${PKG_BUILD_NAME}
cp -pr ${SRC}/{platform-util,scripts} ${PKG_BUILD_ROOT}/

View File

@ -0,0 +1,7 @@
---
debname: platform-util
debver: 1.0-1
dl_hook: dl_hook
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true