diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-08-22 12:59:37 +0200 |
---|---|---|
committer | Maros Marsalek <mmarsale@cisco.com> | 2016-08-22 14:28:54 +0000 |
commit | 4ae1834e89a1b43d0d54b817397208232f5835a0 (patch) | |
tree | 2c684480edf47c889cc0918cb5bc01142329049a | |
parent | b47d696bf3bd5640f44b43cdb12688dc19a0b5d7 (diff) |
Honeycomb deb packaging
Change-Id: I6f029ef9236cbd3f7f20fd8e44f83b15cdedc5db
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
-rw-r--r-- | common/minimal-distribution-parent/pom.xml | 12 | ||||
-rw-r--r-- | packaging/deb/.gitignore | 5 | ||||
-rw-r--r-- | packaging/deb/debian/compat | 1 | ||||
-rw-r--r-- | packaging/deb/debian/control | 13 | ||||
-rw-r--r-- | packaging/deb/debian/copyright | 23 | ||||
-rwxr-xr-x | packaging/deb/debian/rules | 32 | ||||
-rw-r--r-- | packaging/deb/debian/source/format | 1 | ||||
-rwxr-xr-x | packaging/deb/debuild.sh | 45 | ||||
-rw-r--r-- | packaging/deb/honeycomb.conf | 8 | ||||
-rw-r--r-- | packaging/rpm/honeycomb.service | 2 | ||||
-rwxr-xr-x | packaging/rpm/rpmbuild.sh | 1 |
11 files changed, 138 insertions, 5 deletions
diff --git a/common/minimal-distribution-parent/pom.xml b/common/minimal-distribution-parent/pom.xml index bfc0aef6b..36514dfe6 100644 --- a/common/minimal-distribution-parent/pom.xml +++ b/common/minimal-distribution-parent/pom.xml @@ -146,15 +146,19 @@ log.info "Generating shell exec script" def args = properties.getOrDefault("exec.parameters", "") log.debug "Additional shell exec script properties: ${args}" - def scriptContent = "java ${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar &" + def scriptContent = "java ${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar" log.info "Generating shell exec script as ${scriptContent}" def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources") scriptParent.toFile().mkdirs() def scriptPath = Paths.get(scriptParent.toString(), "honeycomb") log.info "Writing shell exec script to ${scriptPath}" - scriptPath.toFile().text = "#!/bin/sh -" - scriptPath.toFile().text += "\n" - scriptPath.toFile().text += scriptContent + scriptContent = "#!/bin/sh -\n" + scriptContent + scriptPath.toFile().text = scriptContent + scriptPath.toFile().setExecutable(true) + + scriptPath = Paths.get(scriptParent.toString(), "honeycomb-start") + log.info "Writing shell exec script to ${scriptPath}" + scriptPath.toFile().text = scriptContent + " &" scriptPath.toFile().setExecutable(true) </source> </configuration> diff --git a/packaging/deb/.gitignore b/packaging/deb/.gitignore new file mode 100644 index 000000000..79f1221ce --- /dev/null +++ b/packaging/deb/.gitignore @@ -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 index 000000000..ec635144f --- /dev/null +++ b/packaging/deb/debian/compat @@ -0,0 +1 @@ +9 diff --git a/packaging/deb/debian/control b/packaging/deb/debian/control new file mode 100644 index 000000000..98ca224c4 --- /dev/null +++ b/packaging/deb/debian/control @@ -0,0 +1,13 @@ +Source: honeycomb +Section: misc +Priority: optional +Maintainer: fd.io/honeycomb <honeycomb-dev@lists.fd.io> +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 index 000000000..ad3a88c26 --- /dev/null +++ b/packaging/deb/debian/copyright @@ -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 <honeycomb-dev@lists.fd.io> +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 index 000000000..5c1cebc20 --- /dev/null +++ b/packaging/deb/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 $@ + +# 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 index 000000000..163aaf8d8 --- /dev/null +++ b/packaging/deb/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/packaging/deb/debuild.sh b/packaging/deb/debuild.sh new file mode 100755 index 000000000..95327fa35 --- /dev/null +++ b/packaging/deb/debuild.sh @@ -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 <mmarsale@cisco.com> 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 index 000000000..e9c7fb932 --- /dev/null +++ b/packaging/deb/honeycomb.conf @@ -0,0 +1,8 @@ +description "honeycomb agent for VPP" +author "fd.io/honeycomb <honeycomb-dev@lists.fd.io>" + +manual + +script + exec /opt/honeycomb/honeycomb +end script
\ No newline at end of file diff --git a/packaging/rpm/honeycomb.service b/packaging/rpm/honeycomb.service index 8a2a46864..1746681ef 100644 --- a/packaging/rpm/honeycomb.service +++ b/packaging/rpm/honeycomb.service @@ -5,7 +5,7 @@ After=vpp.service [Service] Type=forking -ExecStart=/opt/honeycomb/honeycomb +ExecStart=/opt/honeycomb/honeycomb-start [Install] WantedBy=multi-user.target diff --git a/packaging/rpm/rpmbuild.sh b/packaging/rpm/rpmbuild.sh index 2cbb20482..f9e9795fc 100755 --- a/packaging/rpm/rpmbuild.sh +++ b/packaging/rpm/rpmbuild.sh @@ -10,3 +10,4 @@ cp ${DIR}/honeycomb.spec ${DIR}/SOURCES/ cd ${DIR} rpmbuild -bb --define "_topdir ${DIR}" ${DIR}/honeycomb.spec cd - + |