2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 # Build script for openvswitch
16 echo "---> scripts/openvswitch-build.sh"
18 ROOT=/tmp/opflex-prefix
24 ./configure --prefix="$ROOT" --enable-shared
26 DESTDIR=`pwd`/$DESTDIR make install
28 if [[ $OPENVSWITCH_VERSION =~ 2.6.0 ]]; then
29 mkdir -p $DESTDIR/$ROOT/include/openvswitch/openvswitch
30 mv $DESTDIR/$ROOT/include/openvswitch/*.h $DESTDIR/$ROOT/include/openvswitch/openvswitch
31 mv $DESTDIR/$ROOT/include/openflow $DESTDIR/$ROOT/include/openvswitch
32 cp -t "$DESTDIR/$ROOT/include/openvswitch/" include/*.h
33 find lib -name "*.h" -exec cp --parents -t "$DESTDIR/$ROOT/include/openvswitch/" {} \;
34 elif [[ $OPENVSWITCH_VERSION =~ noiro ]]; then
35 find lib ofproto -name "*.h" -exec cp --parents -t "$DESTDIR/$ROOT/include/openvswitch/" {} \;
39 tar -cvzf "openvswitch-$OPENVSWITCH_VERSION.tar.gz" *
40 # Move tarball to dir of files that will be uploaded to Nexus
41 UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
42 mkdir -p "$UPLOAD_FILES_PATH"