-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathrules
More file actions
executable file
·150 lines (130 loc) · 4.79 KB
/
rules
File metadata and controls
executable file
·150 lines (130 loc) · 4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -fPIC
%:
dh $@
execute_after_dh_autoreconf:
patch -f --no-backup-if-mismatch -i $(CURDIR)/debian/ltmain-whole-archive.diff build-aux/ltmain.sh
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
PARALLEL = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
PARALLEL =
endif
DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
override_dh_auto_configure:
test -d _debian || mkdir _debian
cd _debian && ( \
test -e Makefile || \
../configure --prefix=/usr --localstatedir=/var \
--enable-ssl \
--disable-afxdp \
--sysconfdir=/etc \
$(DATAPATH_CONFIGURE_OPTS) \
$(EXTRA_CONFIGURE_OPTS) \
)
ifneq (,$(filter i386 amd64 ppc64el arm64, $(DEB_HOST_ARCH)))
ifeq (,$(filter nodpdk, $(DEB_BUILD_OPTIONS)))
test -d _dpdk || mkdir _dpdk
cd _dpdk && ( \
test -e Makefile || \
../configure --prefix=/usr --localstatedir=/var \
--enable-ssl \
--disable-afxdp \
--with-dpdk=shared \
--sysconfdir=/etc \
$(DATAPATH_CONFIGURE_OPTS) \
$(EXTRA_CONFIGURE_OPTS) \
)
endif
endif
# NOTE(jamespage): by default, just run all tests
TEST_LIST =
TEST_LIST_DPDK =
# armhf:
# 30: bfd - check that BFD works together with RSTP FAILED (bfd.at:829)
ifneq (,$(filter armhf, $(DEB_HOST_ARCH)))
TEST_LIST = 1-29 31-
TEST_LIST_DPDK = $(TEST_LIST)
endif # armhf
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
if $(MAKE) -C _debian check TESTSUITEFLAGS='$(PARALLEL) $(TEST_LIST)' || \
$(MAKE) -C _debian check TESTSUITEFLAGS='--recheck'; then :; \
else \
cat _debian/tests/testsuite.log; \
exit 1; \
fi
# Skip DPDK testing on arm64 as builders don't have crc32 support
# which is used in aarch64 based crc optimization in ovs >= 2.12.0~
ifneq (,$(filter i386 amd64 ppc64el, $(DEB_HOST_ARCH)))
ifeq (,$(filter nodpdk, $(DEB_BUILD_OPTIONS)))
if $(MAKE) -C _dpdk check TESTSUITEFLAGS='$(PARALLEL) $(TEST_LIST_DPDK)' || \
$(MAKE) -C _dpdk check TESTSUITEFLAGS='--recheck'; then :; \
else \
cat _dpdk/tests/testsuite.log; \
exit 1; \
fi
endif # nodpdk
endif # i386/amd64/ppc64el
endif # nocheck
export PYBUILD_DESTDIR = $(CURDIR)/debian/tmp
export PYBUILD_DIR = $(CURDIR)/python
pybuild = \
export PKG_CONFIG_PATH=$(CURDIR)/debian/tmp/usr/lib/pkgconfig; \
export PKG_CONFIG_SYSROOT_DIR=$(CURDIR)/debian/tmp; \
export PKG_CONFIG_SYSTEM_INCLUDE_PATH=/; \
export PKG_CONFIG_SYSTEM_LIBRARY_PATH=/; \
enable_shared=no \
extra_cflags="`pkg-config --cflags libopenvswitch`" \
extra_libs="-Wl,-Bstatic -lopenvswitch -Wl,-Bdynamic `pkg-config --libs --static libopenvswitch`" \
pybuild
override_dh_auto_build:
dh_auto_build --sourcedirectory=_debian -- dist distdir=openvswitch
dh_auto_build --sourcedirectory=_debian
# We need an extra install here so that we can use pkgconfig to
# retrieve accurate CFLAGS and LDFLAGS for building Python extensions.
dh_auto_install --sourcedirectory=_debian
$(pybuild) --build
ifneq (,$(filter i386 amd64 ppc64el arm64, $(DEB_HOST_ARCH)))
ifeq (,$(filter nodpdk, $(DEB_BUILD_OPTIONS)))
dh_auto_build --sourcedirectory=_dpdk
endif
endif
execute_before_dh_auto_clean:
find . -name "*.pyc" -delete
if test -d $(PYBUILD_DIR)/build; then \
pybuild --clean ; \
fi
override_dh_auto_install:
# We need to use pybuild to install Python extensions.
$(pybuild) --install
dh_auto_install --sourcedirectory=_debian
override_dh_installinit:
dh_installinit --restart-after-upgrade
dh_installinit -popenvswitch-switch --name=ovsdb-server --no-start
dh_installinit -popenvswitch-switch --name=ovs-vswitchd --no-start
dh_installinit -popenvswitch-switch --name=ovs-record-hostname --no-start
override_dh_installsystemd:
dh_installsystemd -popenvswitch-switch --name=ovsdb-server --no-start
dh_installsystemd -popenvswitch-switch --name=ovs-vswitchd --no-start
dh_installsystemd -popenvswitch-switch --name=ovs-record-hostname --no-start
dh_installsystemd --restart-after-upgrade -Xovs-vswitchd.service -Xovsdb-server.service -Xovs-record-hostname.service
override_dh_strip:
dh_strip --dbgsym-migration='openvswitch-dbg (<< 2.17~)'
override_dh_python3:
DEB_HOST_ARCH=$(DEB_HOST_ARCH) dh_python3 --shebang=/usr/bin/python3
# Helper target for creating snapshots from upstream git
DATE=$(shell date +%Y%m%d)
# Upstream branch to track
BRANCH=branch-3.7
VERSION=3.7.0
get-orig-snapshot:
rm -Rf openvswitch-upstream
git clone --branch $(BRANCH) --depth 1 https://github.com/openvswitch/ovs openvswitch-upstream
cd openvswitch-upstream && \
export COMMIT=`git rev-parse --short HEAD` && \
git archive --format tgz --prefix=openvswitch-$(VERSION)~git$(DATE).$$COMMIT/ \
-o ../../openvswitch_$(VERSION)~git$(DATE).$$COMMIT.orig.tar.gz $(BRANCH)
rm -Rf openvswitch-upstream