summaryrefslogtreecommitdiffstats
path: root/extras/deb/mkdeb-octeon-roc
diff options
context:
space:
mode:
Diffstat (limited to 'extras/deb/mkdeb-octeon-roc')
-rwxr-xr-xextras/deb/mkdeb-octeon-roc46
1 files changed, 46 insertions, 0 deletions
diff --git a/extras/deb/mkdeb-octeon-roc b/extras/deb/mkdeb-octeon-roc
new file mode 100755
index 00000000000..08e57f4bd1e
--- /dev/null
+++ b/extras/deb/mkdeb-octeon-roc
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+PKG=vpp-dep-octeon-roc
+URL=https://github.com/MarvellEmbeddedProcessors/marvell-vpp.git
+ARCH=$(dpkg --print-architecture)
+TMP_DIR=$(mktemp -d -p $PWD)
+
+set -eEuo pipefail
+
+err_handler()
+{
+ trap '' INT TERM EXIT ERR
+ echo "Cleaning up ${TMP_DIR}"
+ rm -rf ${TMP_DIR}
+ exit
+}
+trap "err_handler" INT TERM EXIT ERR
+
+SRC=${TMP_DIR}/src
+BUILD=${TMP_DIR}/build
+STAGE=${TMP_DIR}/pkg
+INSTALL_PREFIX=/opt/vpp/external/$(uname -m)
+
+git clone ${URL} ${SRC}
+VER=0.0.$(git -C ${SRC} rev-list --count HEAD)
+
+cmake -S ${SRC} -B ${BUILD}
+cmake --build ${BUILD} --parallel
+cmake --install ${BUILD} --prefix ${STAGE}${INSTALL_PREFIX}
+
+mkdir -p ${STAGE}/DEBIAN
+
+cat > ${STAGE}/DEBIAN/control << __EOF__
+Package: ${PKG}
+Version: ${VER}
+Architecture: ${ARCH}
+Maintainer: vpp-dev <vpp-dev@fd.io>
+Installed-Size: $(du -ks ${STAGE}|cut -f 1)
+Section: system
+Priority: extra
+Description: Marvell Octeon ROC library for VPP
+ See https://github.com/MarvellEmbeddedProcessors/marvell-vpp
+__EOF__
+
+DEB=${PKG}_${VER}_${ARCH}.deb
+dpkg-deb -b ${STAGE} ${DEB}