blob: 08e57f4bd1e995a0380fc925fb74998260096491 [file] [log] [blame]
Damjan Marion01fe7ab2023-10-23 18:36:18 +02001#!/bin/bash
2
3PKG=vpp-dep-octeon-roc
4URL=https://github.com/MarvellEmbeddedProcessors/marvell-vpp.git
5ARCH=$(dpkg --print-architecture)
6TMP_DIR=$(mktemp -d -p $PWD)
7
8set -eEuo pipefail
9
10err_handler()
11{
12 trap '' INT TERM EXIT ERR
13 echo "Cleaning up ${TMP_DIR}"
14 rm -rf ${TMP_DIR}
15 exit
16}
17trap "err_handler" INT TERM EXIT ERR
18
19SRC=${TMP_DIR}/src
20BUILD=${TMP_DIR}/build
21STAGE=${TMP_DIR}/pkg
22INSTALL_PREFIX=/opt/vpp/external/$(uname -m)
23
24git clone ${URL} ${SRC}
25VER=0.0.$(git -C ${SRC} rev-list --count HEAD)
26
27cmake -S ${SRC} -B ${BUILD}
28cmake --build ${BUILD} --parallel
29cmake --install ${BUILD} --prefix ${STAGE}${INSTALL_PREFIX}
30
31mkdir -p ${STAGE}/DEBIAN
32
33cat > ${STAGE}/DEBIAN/control << __EOF__
34Package: ${PKG}
35Version: ${VER}
36Architecture: ${ARCH}
37Maintainer: vpp-dev <vpp-dev@fd.io>
38Installed-Size: $(du -ks ${STAGE}|cut -f 1)
39Section: system
40Priority: extra
41Description: Marvell Octeon ROC library for VPP
42 See https://github.com/MarvellEmbeddedProcessors/marvell-vpp
43__EOF__
44
45DEB=${PKG}_${VER}_${ARCH}.deb
46dpkg-deb -b ${STAGE} ${DEB}