summaryrefslogtreecommitdiffstats
path: root/packaging/deb/common/prepare.sh
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-10-11 17:04:57 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-10-12 10:07:00 +0000
commit5d15c9ba461d4c1946b2315e18aeffff0ef898dd (patch)
treed78ff84e06b711f525718cde9ee21af2eff70ad9 /packaging/deb/common/prepare.sh
parent7f2ac934cf22313510750b47ca8359732f97ef3f (diff)
HONEYCOMB-217 Ubuntu16 (systemd) specific packaging
Change-Id: Id1c962412194dd809e68f27d7e62b5ab36378be3 Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'packaging/deb/common/prepare.sh')
-rwxr-xr-xpackaging/deb/common/prepare.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/packaging/deb/common/prepare.sh b/packaging/deb/common/prepare.sh
new file mode 100755
index 000000000..9663bccbe
--- /dev/null
+++ b/packaging/deb/common/prepare.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -xe
+# $1 - source dir root
+# $2 - $1/debian - just configurable for reuse
+# $3 - service definition file
+# $4 - service definition target during install
+SOURCE_DIR=$1
+VERSION=$(${SOURCE_DIR}/../../rpm/version)
+RELEASE=$(${SOURCE_DIR}/../../rpm/release)
+BUILD_DIR=${SOURCE_DIR}/honeycomb-${VERSION}
+
+# Copy and unpack the archive with vpp-integration distribution
+ARCHIVE_DIR=${SOURCE_DIR}/../../../vpp-integration/minimal-distribution/target/
+ARCHIVE=${ARCHIVE_DIR}/vpp-integration-distribution-1.16.12-SNAPSHOT-hc.tar.gz
+cp ${ARCHIVE} ${SOURCE_DIR}
+ARCHIVE=${SOURCE_DIR}/vpp-integration-distribution-${VERSION}-SNAPSHOT-hc.tar.gz
+tar -xf ${ARCHIVE} -C ${SOURCE_DIR}/
+
+# Create packaging root
+rm -rf ${BUILD_DIR}
+mkdir ${BUILD_DIR}
+
+# Copy contents of tar.gz
+mv ${SOURCE_DIR}/vpp-integration-distribution-${VERSION}-SNAPSHOT/ ${BUILD_DIR}/
+cp -r $2 ${BUILD_DIR}
+
+# OS service definition
+cp ${SOURCE_DIR}/$3 ${BUILD_DIR}
+
+# Changelog file
+cat <<EOT >> ${BUILD_DIR}/debian/changelog
+honeycomb (${VERSION}-${RELEASE}) unstable; urgency=low
+
+ * 16.12 release
+
+ -- mmarsale <mmarsale@cisco.com> Mon, 22 Aug 2016 09:41:37 +0200
+EOT
+
+# Install instructions
+cat <<EOT >> ${BUILD_DIR}/debian/install
+vpp-integration-distribution-${VERSION}-SNAPSHOT/* /opt/honeycomb/
+$3 $4
+EOT
+
+echo ${BUILD_DIR} \ No newline at end of file