summaryrefslogtreecommitdiffstats
path: root/packaging/deb/debuild.sh
blob: 46072bc37275ed136703a17ca2c173ef65756151 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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.16.9-RC2-hc.tar.gz
cp ${ARCHIVE} ${DIR}
ARCHIVE=${DIR}/vpp-integration-distribution-${VERSION}-RC2-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}-RC2/ ${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}-RC2/* /opt/honeycomb/
honeycomb.conf /etc/init/
EOT

# Build deb binary only package
cd ${PACKAGING_ROOT}
dpkg-buildpackage -b
cd -