Honeycomb deb packaging
authorMaros Marsalek <[email protected]>
Mon, 22 Aug 2016 10:59:37 +0000 (12:59 +0200)
committerMaros Marsalek <[email protected]>
Mon, 22 Aug 2016 14:28:54 +0000 (14:28 +0000)
Change-Id: I6f029ef9236cbd3f7f20fd8e44f83b15cdedc5db
Signed-off-by: Maros Marsalek <[email protected]>
packaging/deb/.gitignore [new file with mode: 0644]
packaging/deb/debian/compat [new file with mode: 0644]
packaging/deb/debian/control [new file with mode: 0644]
packaging/deb/debian/copyright [new file with mode: 0644]
packaging/deb/debian/rules [new file with mode: 0755]
packaging/deb/debian/source/format [new file with mode: 0644]
packaging/deb/debuild.sh [new file with mode: 0755]
packaging/deb/honeycomb.conf [new file with mode: 0644]
packaging/rpm/honeycomb.service
packaging/rpm/rpmbuild.sh

diff --git a/packaging/deb/.gitignore b/packaging/deb/.gitignore
new file mode 100644 (file)
index 0000000..79f1221
--- /dev/null
@@ -0,0 +1,5 @@
+*.tar.xz
+*.tar.gz
+honeycomb-*/
+*.deb
+*.changes
\ No newline at end of file
diff --git a/packaging/deb/debian/compat b/packaging/deb/debian/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/packaging/deb/debian/control b/packaging/deb/debian/control
new file mode 100644 (file)
index 0000000..98ca224
--- /dev/null
@@ -0,0 +1,13 @@
+Source: honeycomb
+Section: misc
+Priority: optional
+Maintainer: fd.io/honeycomb <[email protected]>
+Build-Depends: debhelper (>= 9)
+Standards-Version: 3.9.6
+Homepage: https://wiki.fd.io/view/Honeycomb
+Vcs-Browser: https://git.fd.io/cgit/honeycomb/tree/
+
+Package: honeycomb
+Architecture: all
+Depends: vpp, openjdk-8-jdk | openjdk-8-jre
+Description: Honeycomb agent for VPP
diff --git a/packaging/deb/debian/copyright b/packaging/deb/debian/copyright
new file mode 100644 (file)
index 0000000..ad3a88c
--- /dev/null
@@ -0,0 +1,23 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: honeycomb
+Source: https://git.fd.io/cgit/honeycomb/tree/
+
+Files: *
+Copyright: 2016 Cisco and/or its affiliates <[email protected]>
+License: Apache-2.0
+ Copyright (c) 2016 Cisco and/or its affiliates.
+ .
+ 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.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/Apache-2.0".
diff --git a/packaging/deb/debian/rules b/packaging/deb/debian/rules
new file mode 100755 (executable)
index 0000000..5c1cebc
--- /dev/null
@@ -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 $@ 
+
+# 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/debian/source/format b/packaging/deb/debian/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/packaging/deb/debuild.sh b/packaging/deb/debuild.sh
new file mode 100755 (executable)
index 0000000..95327fa
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -xe
+DIR=$(dirname $0)
+DIR=$(readlink -f $DIR)
+VERSION=$(${DIR}/../rpm/version)
+RELEASE=$(${DIR}/../rpm/release)
+PACKAGING_ROOT=${DIR}/honeycomb-${VERSION}
+
+# Copy and unpack the archive with vpp-integration distribution
+ARCHIVE_DIR=${DIR}/../../vpp-integration/minimal-distribution/target/
+ARCHIVE=${ARCHIVE_DIR}/vpp-integration-distribution-1.0.0-SNAPSHOT-hc.tar.gz
+cp ${ARCHIVE} ${DIR}
+ARCHIVE=${DIR}/vpp-integration-distribution-${VERSION}-SNAPSHOT-hc.tar.gz
+tar -xf ${ARCHIVE} -C ${DIR}/
+
+# Create packaging root
+rm -rf ${PACKAGING_ROOT}
+mkdir ${PACKAGING_ROOT}
+
+# Copy contents of tar.gz
+mv ${DIR}/vpp-integration-distribution-${VERSION}-SNAPSHOT/ ${PACKAGING_ROOT}/
+cp -r ${DIR}/debian/ ${PACKAGING_ROOT}
+
+# Upstart configuration
+cp ${DIR}/honeycomb.conf ${PACKAGING_ROOT}
+
+# Changelog file
+cat <<EOT >> ${PACKAGING_ROOT}/debian/changelog
+honeycomb (${VERSION}-${RELEASE}) unstable; urgency=low
+
+  * Initial release
+
+ -- mmarsale <[email protected]>  Mon, 22 Aug 2016 09:41:37 +0200
+EOT
+
+# Install instructions
+cat <<EOT >> ${PACKAGING_ROOT}/debian/install
+vpp-integration-distribution-${VERSION}-SNAPSHOT/* /opt/honeycomb/
+honeycomb.conf /etc/init/
+EOT
+
+# Build deb binary only package
+cd ${PACKAGING_ROOT}
+dpkg-buildpackage -b
+cd -
\ No newline at end of file
diff --git a/packaging/deb/honeycomb.conf b/packaging/deb/honeycomb.conf
new file mode 100644 (file)
index 0000000..e9c7fb9
--- /dev/null
@@ -0,0 +1,8 @@
+description    "honeycomb agent for VPP"
+author "fd.io/honeycomb <[email protected]>"
+
+manual
+
+script
+  exec /opt/honeycomb/honeycomb
+end script
\ No newline at end of file
index 8a2a468..1746681 100644 (file)
@@ -5,7 +5,7 @@ After=vpp.service
 
 [Service]
 Type=forking
-ExecStart=/opt/honeycomb/honeycomb
+ExecStart=/opt/honeycomb/honeycomb-start
 
 [Install]
 WantedBy=multi-user.target
index 2cbb204..f9e9795 100755 (executable)
@@ -10,3 +10,4 @@ cp ${DIR}/honeycomb.spec ${DIR}/SOURCES/
 cd ${DIR}
 rpmbuild -bb --define "_topdir ${DIR}"  ${DIR}/honeycomb.spec
 cd -
+