From 6bc8d4db5d436339b836e7cb58e90f0b14b2f214 Mon Sep 17 00:00:00 2001 From: Ramon Gazoni Lacerda Date: Wed, 3 Nov 2021 17:57:31 +0000 Subject: [PATCH] Add debian package for tools/collector Add debian packaging infrastructure for tools/collector to build a debian package. Test Plan: PASS: Built package PASS: Built iso PASS: Installed controller Story: 2009101 Task: 43843 Signed-off-by: Ramon Gazoni Lacerda Change-Id: Id8c1dc8e4b02d9208058cd6650621cbb5923bbde --- tools/collector/debian/deb_folder/changelog | 5 ++ .../debian/deb_folder/collector.install | 5 ++ tools/collector/debian/deb_folder/control | 15 +++++ tools/collector/debian/deb_folder/copyright | 44 ++++++++++++++ tools/collector/debian/deb_folder/rules | 57 +++++++++++++++++++ .../collector/debian/deb_folder/source/format | 1 + tools/collector/debian/meta_data.yaml | 7 +++ 7 files changed, 134 insertions(+) create mode 100644 tools/collector/debian/deb_folder/changelog create mode 100644 tools/collector/debian/deb_folder/collector.install create mode 100644 tools/collector/debian/deb_folder/control create mode 100644 tools/collector/debian/deb_folder/copyright create mode 100755 tools/collector/debian/deb_folder/rules create mode 100644 tools/collector/debian/deb_folder/source/format create mode 100644 tools/collector/debian/meta_data.yaml diff --git a/tools/collector/debian/deb_folder/changelog b/tools/collector/debian/deb_folder/changelog new file mode 100644 index 00000000..84b93168 --- /dev/null +++ b/tools/collector/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +collector (1.0-1) unstable; urgency=medium + + * Initial release. + + -- Ramon Gazoni Lacerda Wed, 27 Oct 2021 15:33:45 -0300 diff --git a/tools/collector/debian/deb_folder/collector.install b/tools/collector/debian/deb_folder/collector.install new file mode 100644 index 00000000..05221956 --- /dev/null +++ b/tools/collector/debian/deb_folder/collector.install @@ -0,0 +1,5 @@ +etc/collect/* /etc/collect +etc/collect.d/* /etc/collect.d +usr/local/sbin/* /usr/local/sbin +usr/local/bin/collect /usr/local/bin +usr/sbin/collect /usr/sbin diff --git a/tools/collector/debian/deb_folder/control b/tools/collector/debian/deb_folder/control new file mode 100644 index 00000000..9f632607 --- /dev/null +++ b/tools/collector/debian/deb_folder/control @@ -0,0 +1,15 @@ +Source: collector +Section: admin +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.1.2 +Homepage: https://www.starlingx.io + +Package: collector +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Data and Log Collection + This packages scripts that implement data and log collection that field + support can execute to gather current state and runtime history for off + platform analysis and debug. diff --git a/tools/collector/debian/deb_folder/copyright b/tools/collector/debian/deb_folder/copyright new file mode 100644 index 00000000..552fdfdf --- /dev/null +++ b/tools/collector/debian/deb_folder/copyright @@ -0,0 +1,44 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: collector +Upstream-Contact: StarlingX Developers +Source: https://opendev.org/starlingx/utilities/ + +Files: * +Copyright: + (c) 2013-2021 Wind River Systems, Inc + (c) 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'. + +# 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/tools/collector/debian/deb_folder/rules b/tools/collector/debian/deb_folder/rules new file mode 100755 index 00000000..72cd0e51 --- /dev/null +++ b/tools/collector/debian/deb_folder/rules @@ -0,0 +1,57 @@ +#!/usr/bin/make -f +export DH_VERBOSE = 1 + +export ROOT = debian/tmp +export SYSCONFDIR = $(ROOT)/etc +export SBINDIR = $(ROOT)/usr/sbin + +%: + dh $@ + + +override_dh_auto_install: + + install -m 755 -d $(SYSCONFDIR)/collect.d + install -m 755 -d $(SYSCONFDIR)/collect + install -m 755 -d $(ROOT)/usr/local/sbin + install -m 755 -d $(ROOT)/usr/local/bin + install -m 755 -d $(SBINDIR) + + install -m 755 -p collect $(ROOT)/usr/local/sbin/collect + install -m 755 -p collect_host $(ROOT)/usr/local/sbin/collect_host + install -m 755 -p collect_date $(ROOT)/usr/local/sbin/collect_date + install -m 755 -p collect_utils $(ROOT)/usr/local/sbin/collect_utils + install -m 755 -p collect_parms $(ROOT)/usr/local/sbin/collect_parms + install -m 755 -p collect_mask_passwords $(ROOT)/usr/local/sbin/collect_mask_passwords + install -m 755 -p expect_done $(ROOT)/usr/local/sbin/expect_done + install -m 755 -p mariadb-cli.sh $(ROOT)/usr/local/sbin/mariadb-cli + + install -m 755 -p collect_sysinv.sh $(SYSCONFDIR)/collect.d/collect_sysinv + install -m 755 -p collect_psqldb.sh $(SYSCONFDIR)/collect.d/collect_psqldb + install -m 755 -p collect_mariadb.sh $(SYSCONFDIR)/collect.d/collect_mariadb + install -m 755 -p collect_openstack.sh $(SYSCONFDIR)/collect.d/collect_openstack + install -m 755 -p collect_networking.sh $(SYSCONFDIR)/collect.d/collect_networking + install -m 755 -p collect_ceph.sh $(SYSCONFDIR)/collect.d/collect_ceph + install -m 755 -p collect_sm.sh $(SYSCONFDIR)/collect.d/collect_sm + install -m 755 -p collect_tc.sh $(SYSCONFDIR)/collect.d/collect_tc + install -m 755 -p collect_nfv_vim.sh $(SYSCONFDIR)/collect.d/collect_nfv_vim + install -m 755 -p collect_ovs.sh $(SYSCONFDIR)/collect.d/collect_ovs + install -m 755 -p collect_patching.sh $(SYSCONFDIR)/collect.d/collect_patching + install -m 755 -p collect_coredump.sh $(SYSCONFDIR)/collect.d/collect_coredump + install -m 755 -p collect_crash.sh $(SYSCONFDIR)/collect.d/collect_crash + install -m 755 -p collect_ima.sh $(SYSCONFDIR)/collect.d/collect_ima + install -m 755 -p collect_fm.sh $(SYSCONFDIR)/collect.d/collect_fm + install -m 755 -p collect_containerization.sh $(SYSCONFDIR)/collect.d/collect_containerization + install -m 755 -p collect_dc.sh $(SYSCONFDIR)/collect.d/collect_dc + install -m 755 -p collect_disk.sh $(SYSCONFDIR)/collect.d/collect_disk + install -m 755 -p collect_interfaces.sh $(SYSCONFDIR)/collect.d/collect_interfaces + + install -m 755 -p etc.exclude $(SYSCONFDIR)/collect/etc.exclude + install -m 755 -p run.exclude $(SYSCONFDIR)/collect/run.exclude + install -m 755 -p varlog.exclude $(SYSCONFDIR)/collect/varlog.exclude + + ln -sf /usr/local/sbin/collect $(SBINDIR)/collect + ln -sf /usr/local/sbin/collect $(ROOT)/usr/local/bin/collect + +override_dh_usrlocal: + echo "do nothing" diff --git a/tools/collector/debian/deb_folder/source/format b/tools/collector/debian/deb_folder/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/tools/collector/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/tools/collector/debian/meta_data.yaml b/tools/collector/debian/meta_data.yaml new file mode 100644 index 00000000..57d83649 --- /dev/null +++ b/tools/collector/debian/meta_data.yaml @@ -0,0 +1,7 @@ +--- +debname: collector +debver: 1.0-1 +src_path: scripts +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true