Introduce hc2vpp_version 46/10046/3
authorMarek Gradzki <[email protected]>
Wed, 10 Jan 2018 09:51:11 +0000 (10:51 +0100)
committerMarek Gradzki <[email protected]>
Thu, 11 Jan 2018 07:01:53 +0000 (08:01 +0100)
Hc2vpp jar versioning is currently slightly different
than honeycomb DEB/RPM versioning.

This patch introduces hc2vpp_version to reflect that
difference and simplify release process.

In the future unification of versioning scheme should be considered.

Change-Id: I6b6f3c39a7bee9de86163b107f5e6ba941c839ee
Signed-off-by: Marek Gradzki <[email protected]>
packaging/deb/common/prepare.sh
packaging/rpm/hc2vpp_version [new file with mode: 0755]
packaging/rpm/honeycomb.spec

index 90853c2..b58b98a 100755 (executable)
@@ -7,6 +7,7 @@ set -xe
 # $5 - build dependencies file
 SOURCE_DIR=$1
 VERSION=$(${SOURCE_DIR}/../../rpm/version)
+HC2VPP_VERSION=$(${SOURCE_DIR}/../../rpm/hc2vpp_version)
 RELEASE=$(${SOURCE_DIR}/../../rpm/release)
 BUILD_DIR=${SOURCE_DIR}/honeycomb-${VERSION}
 VPP_DEPENDENCIES=$(${SOURCE_DIR}/../../deb/common/vpp_dependencies)
@@ -14,9 +15,9 @@ BUILD_DEPENDENCIES=$($5)
 
 # Copy and unpack the archive with vpp-integration distribution
 ARCHIVE_DIR=${SOURCE_DIR}/../../../vpp-integration/minimal-distribution/target/
-ARCHIVE=${ARCHIVE_DIR}/vpp-integration-distribution-${VERSION}-SNAPSHOT-hc.tar.gz
+ARCHIVE=${ARCHIVE_DIR}/vpp-integration-distribution-${HC2VPP_VERSION}-hc.tar.gz
 cp ${ARCHIVE} ${SOURCE_DIR}
-ARCHIVE=${SOURCE_DIR}/vpp-integration-distribution-${VERSION}-SNAPSHOT-hc.tar.gz
+ARCHIVE=${SOURCE_DIR}/vpp-integration-distribution-${HC2VPP_VERSION}-hc.tar.gz
 tar -xf ${ARCHIVE} -C ${SOURCE_DIR}/
 
 # Create packaging root
@@ -24,7 +25,7 @@ rm -rf ${BUILD_DIR}
 mkdir ${BUILD_DIR}
 
 # Copy contents of tar.gz
-mv ${SOURCE_DIR}/vpp-integration-distribution-${VERSION}-SNAPSHOT/ ${BUILD_DIR}/
+mv ${SOURCE_DIR}/vpp-integration-distribution-${HC2VPP_VERSION}/ ${BUILD_DIR}/
 cp -r $2 ${BUILD_DIR}
 
 # OS service definition
@@ -41,7 +42,7 @@ EOT
 
 # Install instructions
 cat <<EOT >> ${BUILD_DIR}/debian/install
-vpp-integration-distribution-${VERSION}-SNAPSHOT/* /opt/honeycomb/
+vpp-integration-distribution-${HC2VPP_VERSION}/* /opt/honeycomb/
 $3 $4
 EOT
 
diff --git a/packaging/rpm/hc2vpp_version b/packaging/rpm/hc2vpp_version
new file mode 100755 (executable)
index 0000000..a084540
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Determines hc2vpp jar version to use while building
+# DEB/RPM packages.
+
+DIR_NAME=$(dirname $0)
+VERSION=`$DIR_NAME/version`
+
+echo "${VERSION}-SNAPSHOT"
+# echo "${VERSION}-RC1"
+# echo "${VERSION}-RC2"
+# echo "${VERSION}"
index 3c4e7ef..6ec63e1 100644 (file)
@@ -2,6 +2,7 @@
 %define __jar_repack 0
 %define _version %(./version)
 %define _release %(./release)
+%define _hc2vpp_version %(./hc2vpp_version)
 %define _vpp_dependencies %(./vpp_dependencies)
 
 Name:       honeycomb
@@ -17,7 +18,7 @@ Summary:    fd.io Honeycomb
 Group:      Applications/Communications
 License:    Apache-1.0
 URL:        http://www.fd.io
-Source0:     vpp-integration-distribution-%{_version}-SNAPSHOT-hc.zip
+Source0:     vpp-integration-distribution-%{_hc2vpp_version}-hc.zip
 Source1:     honeycomb.service
 Requires:    %{_vpp_dependencies}, java >= 1:1.8.0
 # Required for creating honeycomb group
@@ -38,13 +39,13 @@ fd.io Honeycomb
 
 %prep
 # Extract Source0 (Honeycomb archive)
-%autosetup -n vpp-integration-distribution-%{_version}-SNAPSHOT
+%autosetup -n vpp-integration-distribution-%{_hc2vpp_version}
 
 %install
 # Create directory in build root for Honeycomb
 mkdir -p $RPM_BUILD_ROOT/opt/%name
 # Copy Honeycomb from archive to its dir in build root
-cp -r ../vpp-integration-distribution-%{_version}-SNAPSHOT/* $RPM_BUILD_ROOT/opt/%name
+cp -r ../vpp-integration-distribution-%{_hc2vpp_version}/* $RPM_BUILD_ROOT/opt/%name
 # Create directory in build root for systemd .service file
 mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
 # Copy Honeycomb's systemd .service file to correct dir in build root