1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2017 Enea AB and others.
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
10 Date: Wed, 25 Jan 2017 22:11:44 +0100
11 Subject: [PATCH] deb-src: Enable building Debian source pkgs
13 Armband plans on shipping prebuilt binaries.
14 Opensource rules dictate they should be accompanied by the
15 corresponding source packages.
17 So, add the possibility to also build Debian sources when a
18 dummy "ovs_build/build_debian_source" file exists (to avoid
19 passing an useless env var to each docker run).
21 Change-Id: I4e308d84c2eb01af043ed73440c46fc692c30d12
22 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
24 ovs_build/build-ovs-dpdk.sh | 28 +++++++++++++++++-----
25 ovs_build/build-ovs-nsh.sh | 26 +++++++++++++++++---
26 .../debian/patches/series | 1 -
27 3 files changed, 45 insertions(+), 10 deletions(-)
28 delete mode 100644 ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series
30 diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
31 index 7ce2a62..8dd7430 100755
32 --- a/ovs_build/build-ovs-dpdk.sh
33 +++ b/ovs_build/build-ovs-dpdk.sh
34 @@ -11,14 +11,30 @@ DEB_ARCH="$(dpkg --print-architecture)"
36 export DEB_BUILD_OPTIONS='parallel=8 nocheck'
38 +function debian_build() {
39 + if [ -f "${BUILD_SRC}/build_debian_source" ]; then
41 + cp -f ../*.{dsc,xz} ${BUILD_HOME}/deb
43 + debian/rules build; fakeroot debian/rules binary
46 +function debian_src_prepare_ovs() {
47 + if [ -f "${BUILD_SRC}/build_debian_source" ]; then
48 + suffix="${OVS_VER}.orig.tar.xz"
49 + tar cJf ../openvswitch_${suffix} --exclude='./debian' .
50 + cd ..; ln -sf openvswitch_${suffix} openvswitch-dpdk_${suffix}; cd -
55 sudo apt-get -y --force-yes install devscripts dpkg-dev git wget dkms
57 rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}/deb
60 -wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
61 -xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
62 +wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz -O dpdk_16.07.orig.tar.xz
63 +tar xJvf dpdk_16.07.orig.tar.xz
65 cp -r ${BUILD_SRC}/dpdk_16.07.fuel/debian .
66 cat << EOF > debian/changelog
67 @@ -45,7 +61,7 @@ sudo apt-get install -y --force-yes debhelper \
69 texlive-fonts-recommended \
71 -debian/rules build; fakeroot debian/rules binary
75 sudo apt-get install -y --force-yes hwdata
76 @@ -73,7 +89,7 @@ sudo apt-get install -y --force-yes autoconf \
79 git clone https://github.com/openvswitch/ovs.git
80 -cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git
81 +cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git; debian_src_prepare_ovs
82 cd ${BUILD_HOME}; cp -r ovs ovs-dpdk
85 @@ -86,10 +102,10 @@ openvswitch-dpdk (${OVS_VER}-1) unstable; urgency=low
86 -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
89 -debian/rules build; fakeroot debian/rules binary
93 -debian/rules build; fakeroot debian/rules binary
96 cp -r ${BUILD_HOME}/*.deb ${BUILD_HOME}/deb
98 diff --git a/ovs_build/build-ovs-nsh.sh b/ovs_build/build-ovs-nsh.sh
99 index dbebdb2..efbabab 100755
100 --- a/ovs_build/build-ovs-nsh.sh
101 +++ b/ovs_build/build-ovs-nsh.sh
102 @@ -11,6 +11,22 @@ DEB_ARCH="$(dpkg --print-architecture)"
104 export DEB_BUILD_OPTIONS='parallel=8 nocheck'
106 +function debian_build() {
107 + if [ -f "${BUILD_SRC}/build_debian_source" ]; then
109 + cp -f ../*.{dsc,xz} ${BUILD_HOME}/deb
111 + debian/rules build; fakeroot debian/rules binary
114 +function debian_src_prepare_ovs() {
115 + if [ -f "${BUILD_SRC}/build_debian_source" ]; then
116 + suffix="${OVS_VER}.orig.tar.xz"
117 + tar cJf ../openvswitch_${suffix} --exclude='./debian' .
118 + cd ..; ln -sf openvswitch_${suffix} openvswitch-dpdk_${suffix}; cd -
123 sudo apt-get -y --force-yes install devscripts dpkg-dev git wget dkms
125 @@ -39,12 +55,16 @@ sudo apt-get install -y --force-yes autoconf \
128 git clone https://github.com/openvswitch/ovs.git
129 -cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git
130 +cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git; debian_src_prepare_ovs
131 +mkdir -p debian/patches; mkdir -p .pc
132 PATCHES=$(cd ${BUILD_SRC}/ovs_nsh_patches/v2.6.1/; echo *patch)
133 for patch in ${PATCHES}
135 - patch -p1 < ${BUILD_SRC}/ovs_nsh_patches/v2.6.1/${patch}
136 + echo "${patch}" >> debian/patches/series
137 + cp ${BUILD_SRC}/ovs_nsh_patches/v2.6.1/${patch} debian/patches/
138 + patch -p1 < debian/patches/${patch}
140 +cp debian/patches/series .pc/applied-patches
142 cat << EOF > debian/changelog
143 openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
144 @@ -53,7 +73,7 @@ openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
146 -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
148 -debian/rules build; fakeroot debian/rules binary
151 cp -r ${BUILD_HOME}/*.deb ${BUILD_HOME}/deb
153 diff --git a/ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series b/ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series
154 deleted file mode 100644
155 index 8b13789..0000000
156 --- a/ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series