summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packaging/deb/bionic/.gitignore6
-rwxr-xr-xpackaging/deb/bionic/build_dependencies2
-rwxr-xr-xpackaging/deb/bionic/clean.sh4
-rwxr-xr-xpackaging/deb/bionic/debian/rules32
-rwxr-xr-xpackaging/deb/bionic/debuild.sh8
-rw-r--r--packaging/deb/bionic/honeycomb.service10
-rwxr-xr-xpackaging/deb/bionic/prepare.sh67
7 files changed, 129 insertions, 0 deletions
diff --git a/packaging/deb/bionic/.gitignore b/packaging/deb/bionic/.gitignore
new file mode 100644
index 000000000..8beb0829c
--- /dev/null
+++ b/packaging/deb/bionic/.gitignore
@@ -0,0 +1,6 @@
+*.tar.xz
+*.tar.gz
+**/honeycomb-*/
+*.deb
+*.changes
+*.buildinfo
diff --git a/packaging/deb/bionic/build_dependencies b/packaging/deb/bionic/build_dependencies
new file mode 100755
index 000000000..efc1c1362
--- /dev/null
+++ b/packaging/deb/bionic/build_dependencies
@@ -0,0 +1,2 @@
+#!/bin/bash
+echo "debhelper (>= 11), dh-systemd"
diff --git a/packaging/deb/bionic/clean.sh b/packaging/deb/bionic/clean.sh
new file mode 100755
index 000000000..b261eb5ab
--- /dev/null
+++ b/packaging/deb/bionic/clean.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# remove outcomes of honeycomb package generation
+rm -rf honeycomb-* honeycomb_* vpp*
diff --git a/packaging/deb/bionic/debian/rules b/packaging/deb/bionic/debian/rules
new file mode 100755
index 000000000..048f5f738
--- /dev/null
+++ b/packaging/deb/bionic/debian/rules
@@ -0,0 +1,32 @@
+#!/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 EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
+
+# 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
+
+
+# main packaging script based on dh7 syntax
+%:
+ dh $@ --with systemd
+
+# 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)
+
+
+
+
diff --git a/packaging/deb/bionic/debuild.sh b/packaging/deb/bionic/debuild.sh
new file mode 100755
index 000000000..2d0b99bcc
--- /dev/null
+++ b/packaging/deb/bionic/debuild.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -xe
+DIR=$(dirname $0)
+DIR=$(readlink -f ${DIR})
+
+BUILD_FOLDER=$(${DIR}/prepare.sh ${DIR} ${DIR}/../trusty/debian honeycomb.service /lib/systemd/system ${DIR}/build_dependencies)
+cp -r ${DIR}/debian/* ${BUILD_FOLDER}/debian/
+${DIR}/../common/debuild.sh ${BUILD_FOLDER}
diff --git a/packaging/deb/bionic/honeycomb.service b/packaging/deb/bionic/honeycomb.service
new file mode 100644
index 000000000..3b88ba425
--- /dev/null
+++ b/packaging/deb/bionic/honeycomb.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=honeycomb agent for VPP
+
+[Service]
+Type=simple
+ExecStart=/bin/sh -ec "exec /opt/honeycomb/honeycomb"
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/packaging/deb/bionic/prepare.sh b/packaging/deb/bionic/prepare.sh
new file mode 100755
index 000000000..49949525f
--- /dev/null
+++ b/packaging/deb/bionic/prepare.sh
@@ -0,0 +1,67 @@
+#!/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
+# $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)
+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-${HC2VPP_VERSION}-hc.tar.gz
+cp ${ARCHIVE} ${SOURCE_DIR}
+ARCHIVE=${SOURCE_DIR}/vpp-integration-distribution-${HC2VPP_VERSION}-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-${HC2VPP_VERSION}/ ${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
+
+ * 19.04 release
+
+ -- mcmarada <mcmarada@cisco.com> Thu, 18 Oct 2018 13:42:07 +0200
+EOT
+
+# Install instructions
+cat <<EOT >> ${BUILD_DIR}/debian/install
+vpp-integration-distribution-${HC2VPP_VERSION}/* /opt/honeycomb/
+$3 $4
+EOT
+
+# Generate control file
+cat <<EOT >> ${BUILD_DIR}/debian/control
+Source: honeycomb
+Section: misc
+Priority: optional
+Maintainer: fd.io/hc2vpp <hc2vpp@lists.fd.io>
+Build-Depends: ${BUILD_DEPENDENCIES}
+Standards-Version: 3.9.6
+Homepage: https://wiki.fd.io/view/Hc2vpp
+Vcs-Browser: https://git.fd.io/cgit/hc2vpp/tree/
+
+Package: honeycomb
+Architecture: all
+Depends: ${VPP_DEPENDENCIES}, openjdk-11-jre-headless
+Suggests: vpp-nsh-plugin
+Description: Honeycomb agent for VPP
+EOT
+
+echo ${BUILD_DIR} \ No newline at end of file