aboutsummaryrefslogtreecommitdiffstats
path: root/build-root/scripts
diff options
context:
space:
mode:
authorEd Warnicke <eaw@cisco.com>2015-12-08 15:45:58 -0700
committerEd Warnicke <eaw@cisco.com>2015-12-08 15:47:27 -0700
commitcb9cadad578297ffd78fa8a33670bdf1ab669e7e (patch)
tree6ac2be912482cc7849a26f0ab845561c3d7f4e26 /build-root/scripts
parentfb0815d4ae4bb0fe27bd9313f34b45c8593b907e (diff)
Initial commit of vpp code.v1.0.0
Change-Id: Ib246f1fbfce93274020ee93ce461e3d8bd8b9f17 Signed-off-by: Ed Warnicke <eaw@cisco.com>
Diffstat (limited to 'build-root/scripts')
-rwxr-xr-xbuild-root/scripts/find-dev-contents31
-rwxr-xr-xbuild-root/scripts/generate-deb-changelog37
-rwxr-xr-xbuild-root/scripts/make-plugin-toolkit40
-rwxr-xr-xbuild-root/scripts/version22
4 files changed, 130 insertions, 0 deletions
diff --git a/build-root/scripts/find-dev-contents b/build-root/scripts/find-dev-contents
new file mode 100755
index 00000000000..77028af0051
--- /dev/null
+++ b/build-root/scripts/find-dev-contents
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# includes
+paths=`find $1/*/include -type f -print | grep -v '/dpdk/include/'`
+rm -f $2
+
+for path in $paths
+do
+ relpath=`echo $path | sed -e 's:.*/include/::'`
+ dir=`dirname $relpath`
+ if [ $dir = "." ] ; then
+ echo ../$path /usr/include >> $2
+ else
+ echo ../$path /usr/include/$dir >> $2
+ fi
+done
+
+# sample plugin
+paths=`(cd ..; find sample-plugin -type f -print | grep -v autom4te)`
+
+for path in $paths
+do
+ relpath=`echo $path | sed -e 's:.*/sample-plugin/::'`
+ dir=`dirname $relpath`
+ if [ $dir = "sample-plugin" ] ; then
+ echo ../../$path /usr/share/doc/vpp/examples/sample-plugin >> $2
+ else
+ echo ../../$path \
+ /usr/share/doc/vpp/examples/$dir >> $2
+ fi
+done
diff --git a/build-root/scripts/generate-deb-changelog b/build-root/scripts/generate-deb-changelog
new file mode 100755
index 00000000000..a143431257f
--- /dev/null
+++ b/build-root/scripts/generate-deb-changelog
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+CHANGELOG=deb/debian/changelog
+DIST=unstable
+FIRST=1
+
+print_changelog_item() {
+ DATE=$(git log -1 --format=%cD ${TAG})
+ DEBFULLNAME=$(git log -1 --format=%an ${TAG})
+ DEBEMAIL=$(git log -1 --format=%ae ${TAG})
+
+ if [ ${FIRST} = 0 ]; then echo >> ${CHANGELOG}; fi
+ FIRST=0
+
+ echo "vpp (${VER}) ${DIST}; urgency=low" >> ${CHANGELOG}
+ echo >> ${CHANGELOG}
+ echo "${DESC}" >> ${CHANGELOG}
+ echo >> ${CHANGELOG}
+ echo " -- ${DEBFULLNAME} <${DEBEMAIL}> ${DATE}" >> ${CHANGELOG}
+}
+
+VER=$(scripts/version)
+TAG=HEAD
+ADDS=$(echo ${VER} | sed -e 's/~.*//'| cut -s -d- -f2)
+
+rm -f ${CHANGELOG}
+
+if [ -n "${ADDS}" ]; then
+ DESC=" * includes ${ADDS} commits after $(echo ${VER}| cut -d- -f1) release"
+ print_changelog_item
+fi
+
+for TAG in $(git tag -l 'v[0-9].[0-9].[0-9]' | sort -r ); do
+ VER=$(echo ${TAG}| sed -e 's/^v//')
+ DESC=$(git tag -l -n20 ${TAG} | tail -n+2 | sed -e 's/^ */ /')
+ print_changelog_item
+done
diff --git a/build-root/scripts/make-plugin-toolkit b/build-root/scripts/make-plugin-toolkit
new file mode 100755
index 00000000000..14e9eda26fe
--- /dev/null
+++ b/build-root/scripts/make-plugin-toolkit
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+set -eux
+
+build_tarball() {
+ for dir in vppinfra dpdk svm vlib-api vlib vnet vpp vpp-api-test
+ do
+ tar -C install-$1/$dir/include -cf - . | tar -C $tmp_dir/include -xf -
+ done
+ tar -C ../sample-plugin -cf - . \
+ | tar -C $tmp_dir/src/sample-plugin -xf -
+ cp tools/bin/vppapigen $tmp_dir/tools/bin
+ echo Created by `id -u -n` on `hostname` at `date` > \
+ $tmp_dir/toolkit-version-stamp
+ cp scripts/vpp-plugin-toolkit-readme $tmp_dir/README
+ tar -C $tmp_dir -zcf $PWD/vpp-plugin-toolkit-$1.tar.gz .
+}
+
+if [ `basename $PWD` != "build-root" ] ; then
+ echo Please run this script from build-root
+ exit 1
+fi
+
+echo Pull additional tookit repos
+make PLATFORM=vpp sample-plugin-find-source
+
+make PLATFORM=vpp TAG=vpp wipe-all
+echo Build vpp forwarder production package
+make PLATFORM=vpp TAG=vpp V=0 strip_sumbols=yes install-packages
+
+tmp_dir="`mktemp -d /tmp/plugin-XXXXXX`"
+trap "rm -rf $tmp_dir" err
+
+echo Create vpp forwarder production plugin toolkit tarball
+mkdir -p $tmp_dir/tools/bin $tmp_dir/include $tmp_dir/lib64 \
+ $tmp_dir/src/sample-plugin
+build_tarball vpp-native
+rm -rf $tmp_dir
+
+exit 0
diff --git a/build-root/scripts/version b/build-root/scripts/version
new file mode 100755
index 00000000000..9d236bc227a
--- /dev/null
+++ b/build-root/scripts/version
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+TAG=$(git describe | cut -d- -f1 | sed -e 's/^v//')
+ADD=$(git describe | cut -s -d- -f2)
+CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4)
+
+if [ "$1" = "rpm-version" ]; then
+ echo ${TAG}
+ exit
+fi
+
+if [ "$1" = "rpm-release" ]; then
+ [ -z "${ADD}" ] && echo release && exit
+ echo ${ADD}~${CMT}
+ exit
+fi
+
+if [ -n "${ADD}" ]; then
+ echo ${TAG}-${ADD}~${CMT}
+else
+ echo ${TAG}
+fi