mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 01:51:26 +00:00
Acked-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
151 lines
4.8 KiB
Makefile
Executable File
151 lines
4.8 KiB
Makefile
Executable File
#!/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.6
|
|
VERSION=3.6.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
|