From: Zhe Huang Date: Fri, 12 Jul 2019 16:58:37 +0000 (-0400) Subject: Script to package it/dep repo as a debian package X-Git-Tag: 0.0.2~61^2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=839d43f79233d580f53102563bc4b29df3282763;p=it%2Fdep.git Script to package it/dep repo as a debian package Signed-off-by: Zhe Huang Change-Id: Ieb9b4e98c0169f065f565a6c6e3f8bbb544ce923 --- diff --git a/bin/package-ric-deployment-tools b/bin/package-ric-deployment-tools new file mode 100755 index 00000000..d932fb9e --- /dev/null +++ b/bin/package-ric-deployment-tools @@ -0,0 +1,116 @@ +#!/bin/bash +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# 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. # +################################################################################ + +# This script package RIC deployment tools as a debian package + +VERSION=$1 + +if [ -z "$VERSION" ];then +echo "Please provide a version number." +exit 1 + +fi + +DPKG_BUILDPACKAGE=$(whereis dpkg-buildpackage | awk '{print $2}') + +if [ -z "$DPKG_BUILDPACKAGE" ];then +echo "dpkg-buildpackage not found. Please run \"apt install -y dpkg-dev\"" +exit 1 + +fi + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +mkdir -p /tmp/ric-deployment-tools-$VERSION +cp -r $DIR/../* /tmp/ric-deployment-tools-$VERSION/ + + +DIR=/tmp/ric-deployment-tools-$VERSION + + +mkdir $DIR/debian + +cat <$DIR/debian/changelog +ric-deployment-tools ($VERSION) stable; urgency=low + + * Release $VERSION + + -- Zhe Huang $(date -R) +EOF + +cat <$DIR/debian/compat +9 +EOF + +cat <$DIR/debian/control +Source: ric-deployment-tools +Section: Miscellaneous +Priority: optional +Maintainer: Zhe Huang +Build-Depends: debhelper (>= 9) +Standards-Version: 4.1.2 +Homepage: https://gerrit.o-ran-sc.org/r/admin/repos/it/dep +#Vcs-Git: https://anonscm.debian.org/git/collab-maint/ric-deployment.git +#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/ric-deployment.git + +Package: ric-deployment-tools +Architecture: all +Depends: \${misc:Depends} +Description: Utility tools to deploy RAN intelligent controller + ric-deployment-tools provides scripts and helm charts to deploy RIC platform components and RIC auxiliary functions. +EOF + +cat <$DIR/debian/rules +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + +export DESTROOT=\$(CURDIR)/debian/ric-deployment-tools + +%: + dh \$@ + +override_dh_auto_install: + dh_auto_install + install -d \$(DESTROOT)/opt/ric/ric-deployment-tools + rsync -a \$(CURDIR)/* \$(DESTROOT)/opt/ric/ric-deployment-tools --exclude debian +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=\$(DEB_HOST_MULTIARCH) + + +EOF + + +cd $DIR +dpkg-buildpackage -us -uc + + +echo "RIC it/dep repo has been packaged as /tmp/ric-deployment-tools_${VERSION}_all.deb."