licenses: Add license headers
[ovsnfv.git] / fuel-plugin-ovsnfv / pre_build_hook
1 #!/bin/bash
2
3 # Copyright (c) 2016 Open Platform for NFV Project, Inc. and its contributors
4 #
5 #    Licensed under the Apache License, Version 2.0 (the "License");
6 #    you may not use this file except in compliance with the License.
7 #    You may obtain a copy of the License at
8 #
9 #        http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #    Unless required by applicable law or agreed to in writing, software
12 #    distributed under the License is distributed on an "AS IS" BASIS,
13 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #    See the License for the specific language governing permissions and
15 #    limitations under the License.
16
17 set -eux
18
19 BUILD_FOR=${BUILD_FOR:-ubuntu}
20 DIR="$(dirname `readlink -f $0`)"
21 TMP=${DIR}/tmp
22
23 INCLUDE_DEPENDENCIES=${INCLUDE_DEPENDENCIES:-true}
24 ovs_ref=${ovs_ref:-master}
25 dpdk_ref=${dpdk_ref:-2.1.0}
26 networking_ovs_dpdk=${networking_ovs_dpdk:-master}
27
28 rm -rf ${TMP}
29 mkdir -p ${TMP}
30
31 # sudo apt-get install -qq --reinstall --print-uris bash | perl -lne "/'(.*?)'/;print \$1"
32 if [ "$INCLUDE_DEPENDENCIES" = true ]
33 then
34   rm -rf ${DIR}/repositories/${BUILD_FOR}/*
35   wget --content-disposition -N -P ${DIR}/repositories/${BUILD_FOR}/ -i "${DIR}/ovs_package/${BUILD_FOR}/dependencies.txt"
36 fi
37
38 cd ${TMP}
39
40 git clone https://github.com/openstack/networking-ovs-dpdk --branch stable/liberty --single-branch networking-ovs-dpdk
41 rm -rf ${TMP}/networking_ovs_dpdk/.git
42 tar cfz ${DIR}/repositories/${BUILD_FOR}/networking-ovs-dpdk.tgz networking-ovs-dpdk
43
44 git clone https://github.com/openvswitch/ovs
45 cd ovs
46 git checkout 1e77bbe565bbf5ae7f4c47f481a4097d666d3d68
47 cd ..
48 rm -rf ${TMP}/ovs/.git
49 tar cfz ${DIR}/repositories/${BUILD_FOR}/ovs.tgz ovs
50
51 git clone http://dpdk.org/git/dpdk --branch v2.0.0 --single-branch dpdk
52 rm -rf ${TMP}/dpdk/.git
53 tar cfz ${DIR}/repositories/${BUILD_FOR}/dpdk.tgz dpdk
54
55 cd $DIR
56 rm -rf ${TMP}