Control: tags -1 patch

On Mon, 03 Dec 2018 17:57:48 +0000 Luca Boccassi <bl...@debian.org>
wrote:
> Source: virtio-forwarder
> Version: 1.1.99.13-1~unstable
> Severity: serious
> Forwarded: https://www.rsyslog.com/doc/master/rainerscript/control_st
ructures.html
> 
> DPDK 18.11 does not ship a dpdk-dev package anymore, and the
dependency
> should be switched to libdpdk-dev.
> But more importantly, the RTE SDK scripts are no longer shipped
either,
> so virtio-forwarder should stop depending on them and either fully
> implement a self-contained makefile or use a different build system.

I have worked on a fix:

https://github.com/Netronome/virtio-forwarder/pull/4

The debdiff is attached.

Given it blocks the DPDK 18.11 transition, I might do an NMU before the
transition freeze happens in January. Let me know if that's an issue.

-- 
Kind regards,
Luca Boccassi
diff -Nru virtio-forwarder-1.1.99.13/debian/changelog virtio-forwarder-1.1.99.13/debian/changelog
--- virtio-forwarder-1.1.99.13/debian/changelog	2018-06-11 13:02:44.000000000 +0100
+++ virtio-forwarder-1.1.99.13/debian/changelog	2018-12-13 20:34:59.000000000 +0000
@@ -1,3 +1,17 @@
+virtio-forwarder (1.1.99.13-1~unstable+0.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add dpdk_1811.patch to fix build with DPDK 18.11.
+    (Closes: #915417)
+  * Add meson.patch to add independent build system, to fix build
+    with DPDK 18.11 which does not ship importable makefiles anymore.
+    Update the build-dependencies accordingly: added meson,
+    systemd (for pc file), removed dpdk-dev.
+  * Build-Depend on libprotobuf-c-dev instead of the deprecated
+    libprotobuf-c0-dev. (Closes: #906293)
+
+ -- Luca Boccassi <bl...@debian.org>  Thu, 13 Dec 2018 20:34:59 +0000
+
 virtio-forwarder (1.1.99.13-1~unstable) unstable; urgency=low
   *  Initial release (Closes: #901027)
  -- Frik Botha <frik.bo...@netronome.com>  Mon, 11 Jun 2018 14:02:44 +0200
diff -Nru virtio-forwarder-1.1.99.13/debian/compat virtio-forwarder-1.1.99.13/debian/compat
--- virtio-forwarder-1.1.99.13/debian/compat	2018-06-11 13:02:44.000000000 +0100
+++ virtio-forwarder-1.1.99.13/debian/compat	2018-12-13 19:52:58.000000000 +0000
@@ -1 +1 @@
-9
+11
diff -Nru virtio-forwarder-1.1.99.13/debian/control virtio-forwarder-1.1.99.13/debian/control
--- virtio-forwarder-1.1.99.13/debian/control	2018-06-11 13:02:44.000000000 +0100
+++ virtio-forwarder-1.1.99.13/debian/control	2018-12-13 19:52:58.000000000 +0000
@@ -1,7 +1,7 @@
 Source: virtio-forwarder
 Maintainer: Frik Botha <frik.bo...@netronome.com>
 Section: net
-Build-Depends: debhelper (>= 9), python-minimal, protobuf-c-compiler, libprotobuf-c0-dev, libzmq3-dev, protobuf-compiler, python3-sphinx, libnuma-dev, libdpdk-dev, dpdk-dev, libpcap-dev, libxen-dev
+Build-Depends: debhelper (>= 11~), python-minimal, protobuf-c-compiler, libprotobuf-c-dev, libzmq3-dev, protobuf-compiler, python3-sphinx, libnuma-dev, libdpdk-dev, libpcap-dev, libxen-dev, meson, systemd
 Standards-Version: 4.1.4
 Homepage: https://github.com/Netronome/virtio-forwarder
 Priority: optional
diff -Nru virtio-forwarder-1.1.99.13/debian/patches/dpdk_1811.patch virtio-forwarder-1.1.99.13/debian/patches/dpdk_1811.patch
--- virtio-forwarder-1.1.99.13/debian/patches/dpdk_1811.patch	1970-01-01 01:00:00.000000000 +0100
+++ virtio-forwarder-1.1.99.13/debian/patches/dpdk_1811.patch	2018-12-13 20:34:59.000000000 +0000
@@ -0,0 +1,96 @@
+From 8368876ffc66e16a505095484017f65a76580f9a Mon Sep 17 00:00:00 2001
+From: Luca Boccassi <bl...@debian.org>
+Date: Thu, 13 Dec 2018 20:30:02 +0000
+Subject: [PATCH] Fix build with DPDK 18.11
+
+A few APIs and struct members for offloading have been removed, so
+use the appropriate ifdefs to fix the build with 18.11.
+---
+ virtio_worker.c | 35 +++++++++++++++++++++++++++++++++--
+ 1 file changed, 33 insertions(+), 2 deletions(-)
+
+--- a/virtio_worker.c
++++ b/virtio_worker.c
+@@ -358,7 +358,9 @@
+ 				DEV_TX_OFFLOAD_TCP_TSO;
+ 	tx_conf->offloads = dev_info->tx_offload_capa & desired_offloads;
+ #endif
++#if RTE_VERSION < RTE_VERSION_NUM(18,8,0,0)
+ 	tx_conf->txq_flags &= ~ETH_TXQ_FLAGS_NOOFFLOADS;
++#endif
+ }
+ 
+ static void get_rx_conf(const struct rte_eth_dev_info *dev_info,
+@@ -374,9 +376,17 @@
+ 
+ 	rte_eth_dev_stop(port_id);
+ 	rte_eth_dev_close(port_id);
++#if RTE_VERSION >= RTE_VERSION_NUM(18,11,0,0)
++	const char rte_detach_api[] = "rte_dev_remove";
++	struct rte_eth_dev_info dev_info;
++	rte_eth_dev_info_get(port_id, &dev_info);
++	err = rte_dev_remove(dev_info.device);
++#else
++	const char rte_detach_api[] = "rte_eth_dev_detach";
+ 	err = rte_eth_dev_detach(port_id, detach_dbdf);
++#endif
+ 	if (err != 0) {
+-		log_warning("rte_eth_dev_detach(%hhu) failed with error %i",
++		log_warning("%s(%hhu) failed with error %i", rte_detach_api,
+ 			port_id, err);
+ 	}
+ 
+@@ -505,7 +515,13 @@
+ 	log_info("Adding DPDK port %hhu ('%s') to virtio ('%u')",
+ 		port_id, name, virtio_id);
+ 
++#if RTE_VERSION >= RTE_VERSION_NUM(18,8,0,0)
++	rte_eth_dev_info_get(port_id, &dev_info);
++	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME)
++		eth_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
++#else
+ 	eth_conf.rxmode.jumbo_frame = 1;
++#endif
+ 	eth_conf.rxmode.max_rx_pkt_len = relay->use_jumbo ? JUMBO_MBUF_SIZE :
+ 						DEFAULT_MBUF_SIZE;
+ 	err = rte_eth_dev_configure(port_id, 1, 1, &eth_conf);
+@@ -571,23 +587,38 @@
+ {
+ 	int err;
+ 
++#if RTE_VERSION >= RTE_VERSION_NUM(18,8,0,0)
++	const char rte_attach_api[] = "rte_dev_probe";
++	err = rte_dev_probe(pci_dbdf);
++#else
++	const char rte_attach_api[] = "rte_eth_dev_attach";
+ 	err = rte_eth_dev_attach(pci_dbdf, port_id);
++#endif
+ 	if (err != 0) {
+ 		/* err is always -1 on error, so no useful additional info.
+ 		 * Print it anyway for consistency with other error messages. */
+-		log_error("rte_eth_dev_attach('%s') failed with error %i",
++		log_error("%s('%s') failed with error %i", rte_attach_api,
+ 			pci_dbdf, err);
+ 		check_uio_driver_setup(pci_dbdf);
+ 		return 2;
+ 	}
+ 
++#if RTE_VERSION >= RTE_VERSION_NUM(18,8,0,0)
++	struct rte_dev_iterator it;
++	RTE_ETH_FOREACH_MATCHING_DEV(*port_id, pci_dbdf, &it) {
++#endif
+ 	err = dev_queue_configure(pci_dbdf, *port_id, virtio_id, relay, false);
+ 	if (err) {
++		// TODO: should probably accumulate the port_id and clean them all up
++		// but it's unlikely that there would be more than one match anyway
+ 		cleanup_eth_dev(*port_id);
+ 		return err;
+ 	}
+ 
+ 	rte_eth_promiscuous_enable(*port_id);
++#if RTE_VERSION >= RTE_VERSION_NUM(18,8,0,0)
++	}
++#endif
+ 
+ 	return 0;
+ }
diff -Nru virtio-forwarder-1.1.99.13/debian/patches/meson.patch virtio-forwarder-1.1.99.13/debian/patches/meson.patch
--- virtio-forwarder-1.1.99.13/debian/patches/meson.patch	1970-01-01 01:00:00.000000000 +0100
+++ virtio-forwarder-1.1.99.13/debian/patches/meson.patch	2018-12-13 20:34:59.000000000 +0000
@@ -0,0 +1,423 @@
+--- a/Makefile
++++ b/Makefile
+@@ -161,11 +161,11 @@
+ version:
+ 	@(git log>/dev/null 2>&1 && \
+ 	cp $${RTE_SRCDIR:+$$RTE_SRCDIR/}vrelay_version.h.in vrelay_version.h 2>/dev/null && \
+-	sed -ri "s/(.*VIRTIO_FWD_VERSION_MAJOR)\s+[0-9]+/\1 $(shell git describe --tags --long | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\-.*/\1/')/" vrelay_version.h && \
+-	sed -ri "s/(.*VIRTIO_FWD_VERSION_MINOR)\s+[0-9]+/\1 $(shell git describe --tags --long | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\-.*/\2/')/" vrelay_version.h && \
+-	sed -ri "s/(.*VIRTIO_FWD_VERSION_PATCH)\s+[0-9]+/\1 $(shell git describe --tags --long | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\-.*/\3/')/" vrelay_version.h && \
+-	sed -ri "s/(.*VIRTIO_FWD_VERSION_BUILD)\s+[0-9]+/\1 $(shell git describe --tags --long | sed -r 's/(.*)?\-([0-9]+)\-.*/\2/')/" vrelay_version.h && \
+-	sed -ri "s/(.*VIRTIO_FWD_VERSION_SHASH)\s+\"[[:alnum:]]*/\1 \"$(shell git describe --tags --long | sed -r 's/(.*)?\-([0-9]+)\-(.*)/\3/')/" vrelay_version.h) || \
++	sed -ri "s/@MAJOR@/$(shell git describe --tags --long | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\-.*/\1/')/" vrelay_version.h && \
++	sed -ri "s/@MINOR@/$(shell git describe --tags --long | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\-.*/\2/')/" vrelay_version.h && \
++	sed -ri "s/@PATCH@/$(shell git describe --tags --long | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)\-.*/\3/')/" vrelay_version.h && \
++	sed -ri "s/@BUILD@/$(shell git describe --tags --long | sed -r 's/(.*)?\-([0-9]+)\-.*/\2/')/" vrelay_version.h && \
++	sed -ri "s/@SHASH@/$(shell git describe --tags --long | sed -r 's/(.*)?\-([0-9]+)\-(.*)/\3/')/" vrelay_version.h) || \
+ 	cp $${RTE_SRCDIR:+$$RTE_SRCDIR/}vrelay_version.h . || :
+ 
+ vio_installdirs:
+@@ -185,7 +185,7 @@
+ 	find $(RTE_SRCDIR)/startup/ -maxdepth 1 -type f -regextype posix-extended -regex '.*\.sh' -exec $(INSTALL_PROGRAM) {} $(DESTDIR)$(libexecdir) \;
+ 	find $(RTE_SRCDIR)/startup/ -maxdepth 1 -type f -regextype posix-extended -regex '.*\.sh' -exec sh -c 'sed -ri "s#__LIBEXECDIR__#$(libexecdir)#" $(DESTDIR)$(libexecdir)/$$(basename {})' \;
+ 	$(INSTALL_DATA) $(RTE_SRCDIR)/startup/virtioforwarder $(DESTDIR)/etc/default
+-	sed -ri "s#__BINDIR__#$(bindir)#" $(DESTDIR)/etc/default/virtioforwarder
++	sed -ri "s#@BINDIR@#$(bindir)#" $(DESTDIR)/etc/default/virtioforwarder
+ 	find $(RTE_SRCDIR)/startup/systemd -maxdepth 1 -type f -regextype posix-extended -regex '.*\.service' -exec $(INSTALL_DATA) {} $(DESTDIR)$(unitdir) \;
+ 	find $(RTE_SRCDIR)/startup/systemd -maxdepth 1 -type f -regextype posix-extended -regex '.*\.service' -exec sh -c 'sed -ri "s#__LIBEXECDIR__#$(libexecdir)#" $(DESTDIR)$(unitdir)/$$(basename {})' \;
+ 	@if [ "$(VIO4WD_SHIP_UPSTART)" = "y" ]; then \
+@@ -267,8 +267,8 @@
+ 	cp $${RTE_SRCDIR:+$$RTE_SRCDIR/}doc/* _build/
+ 	cd _build; \
+ 	VERSION_VER_STRING="$(shell awk '/VIRTIO_FWD_VERSION/&&/define/&&!/SHASH/{count++; if (count<4) printf "%s.", $$3; else print $$3}' vrelay_version.h)"; \
+-	sed -ri "s/__VRELAY_VERSION__/$$VERSION_VER_STRING/" conf.py; \
+-	sed -ri "s/__APP__NAME__/$(APP)/" conf.py
++	sed -ri "s/@VRELAY_VERSION@/$$VERSION_VER_STRING/" conf.py; \
++	sed -ri "s/@APP__NAME@/$(APP)/" conf.py
+ 
+ doc: prepare_docs
+ 	cd _build; \
+--- a/doc/conf.py
++++ b/doc/conf.py
+@@ -83,7 +83,7 @@
+ # built documents.
+ #
+ # The short X.Y version.
+-version = u'__VRELAY_VERSION__'
++version = u'@VRELAY_VERSION@'
+ # The full version, including alpha/beta/rc tags.
+ release = version
+ 
+@@ -213,7 +213,7 @@
+ # One entry per manual page. List of tuples
+ # (source start file, name, description, authors, manual section).
+ man_pages = [
+-    (master_doc, '__APP__NAME__', u'Virtio-forwarder Documentation',
++    (master_doc, '@APP__NAME@', u'Virtio-forwarder Documentation',
+      [author], 8)
+ ]
+ 
+--- /dev/null
++++ b/doc/meson.build
+@@ -0,0 +1,84 @@
++# BSD 3-Clause License
++#
++# Copyright 2018 Luca Boccassi <bl...@debian.org>
++#
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions are met:
++#
++# * Redistributions of source code must retain the above copyright notice, this
++#   list of conditions and the following disclaimer.
++#
++# * Redistributions in binary form must reproduce the above copyright notice,
++#   this list of conditions and the following disclaimer in the documentation
++#   and/or other materials provided with the distribution.
++#
++# * Neither the name of the copyright holder nor the names of its
++#   contributors may be used to endorse or promote products derived from
++#   this software without specific prior written permission.
++#
++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
++# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
++# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
++# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++sphinx = find_program('sphinx-build', required: false)
++
++if sphinx.found()
++	conf_py_data = configuration_data()
++	conf_py_data.set('VRELAY_VERSION', meson.project_version())
++	conf_py_data.set('APP__NAME', meson.project_name())
++	conf_py = configure_file(input: 'conf.py',
++		output: 'conf.py',
++		configuration: conf_py_data,
++		install: false)
++	# need to copy index.rst and README.rst in the build directory
++	configure_file(input: 'index.rst',
++		output: 'index.rst',
++		copy: true,
++		install: false)
++	configure_file(input: 'README.rst',
++		output: 'README.rst',
++		copy: true,
++		install: false)
++
++	# always build the manpages, as the makefiles do
++	custom_target('man_doc',
++		input: meson.current_source_dir(),
++		output: 'man8',
++		command: [sphinx, '-b', 'man',
++			'-d', join_paths(meson.current_build_dir(), '.doctrees'),
++			meson.current_build_dir(),
++			join_paths(meson.current_build_dir(), 'man8')],
++		build_by_default: true,
++		install: true,
++		install_dir: join_paths(get_option('datadir'), 'man'))
++
++	html_build = custom_target('html_build',
++		input: meson.current_source_dir(),
++		output: 'html',
++		command: [sphinx, '-b', 'html',
++			'-d', join_paths(meson.current_build_dir(), '.doctrees'),
++			meson.current_build_dir(),
++			join_paths(meson.current_build_dir(), 'html')],
++		build_by_default: false,
++		install: false)
++
++	latex_build = custom_target('latex_build',
++		input: meson.current_source_dir(),
++		output: 'latex',
++		command: [sphinx, '-b', 'latex',
++			'-d', join_paths(meson.current_build_dir(), '.doctrees'),
++			meson.current_build_dir(),
++			join_paths(meson.current_build_dir(), 'latex')],
++		build_by_default: false,
++		install: false)
++
++	run_target('doc', command: ['echo', 'Building docs:', 'HTML and LateX'],
++		depends: [html_build, latex_build])
++endif
+--- /dev/null
++++ b/meson.build
+@@ -0,0 +1,116 @@
++# BSD 3-Clause License
++#
++# Copyright 2018 Luca Boccassi <bl...@debian.org>
++#
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions are met:
++#
++# * Redistributions of source code must retain the above copyright notice, this
++#   list of conditions and the following disclaimer.
++#
++# * Redistributions in binary form must reproduce the above copyright notice,
++#   this list of conditions and the following disclaimer in the documentation
++#   and/or other materials provided with the distribution.
++#
++# * Neither the name of the copyright holder nor the names of its
++#   contributors may be used to endorse or promote products derived from
++#   this software without specific prior written permission.
++#
++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
++# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
++# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
++# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++project('virtio-forwarder', 'C',
++	version: '1.1.99',
++	license: 'BSD',
++	default_options: ['buildtype=release'],
++	meson_version: '>= 0.41'
++)
++
++deps = [
++	dependency('libdpdk'),
++	dependency('libprotobuf-c'),
++	dependency('libzmq'),
++	dependency('threads'),
++]
++protoc_c = find_program('protoc-c')
++protoc = find_program('protoc')
++touch = find_program('touch')
++
++vf_install_dir = join_paths('lib', 'virtio-forwarder')
++
++custom_target('proto-py',
++	input: 'virtioforwarder.proto',
++	output: 'virtioforwarder_pb2.py',
++	command: [protoc, '--proto_path=@CURRENT_SOURCE_DIR@', '--python_out=@OUTDIR@', '@INPUT@'],
++	build_by_default: true,
++	install: true,
++	install_dir: join_paths(vf_install_dir, 'protobuf', 'virtioforwarder'))
++
++custom_target('init',
++	output: '__init__.py',
++	command: [touch, '@OUTPUT@'],
++	build_by_default: true,
++	install: true,
++	install_dir: join_paths(vf_install_dir, 'protobuf', 'virtioforwarder'))
++# non-portable hack - cannot currently install same file in multiple directories
++meson.add_install_script('sh', '-c',
++	'install -m0644 $MESON_BUILD_ROOT/__init__.py $MESON_INSTALL_DESTDIR_PREFIX/lib/virtio-forwarder/protobuf/__init__.py')
++
++subdir('scripts')
++
++pb_c = generator(protoc_c,
++	output: ['@BASENAME@.pb-c.h', '@BASENAME@.pb-c.c'],
++	arguments : ['--proto_path=@CURRENT_SOURCE_DIR@', '--c_out=@BUILD_DIR@', '@INPUT@'])
++generated_c = pb_c.process('virtioforwarder.proto')
++
++vrelay_version = configuration_data()
++vrelay_version.set('MAJOR', '@0@'.format(meson.project_version().split('.').get(0)))
++vrelay_version.set('MINOR', '@0@'.format(meson.project_version().split('.').get(1)))
++vrelay_version.set('PATCH', '@0@'.format(meson.project_version().split('.').get(2)))
++#vrelay_version.set('BUILD', '@0@'.format(meson.project_version().split('.').get(3)))
++#vrelay_version.set('SHASH', '@0@'.format(meson.project_version().split('.').get(4)))
++vrelay = configure_file(input: 'vrelay_version.h.in',
++	output: 'vrelay_version.h',
++	configuration: vrelay_version,
++	install: false)
++
++cflags = ['-Wno-error=cpp']
++cflags += '-std=gnu11'
++cflags += '-D_GNU_SOURCE'
++
++sources = files('argv.c',
++	'cmdline.c',
++	'cpuinfo.c',
++	'dpdk_eal.c',
++	'file_mon.c',
++	'log.c',
++	'ovsdb_mon.c',
++	'sriov.c',
++	'stats_dump.c',
++	'ugid.c',
++	'virtio_forwarder_main.c',
++	'virtio_vhostuser.c',
++	'virtio_worker.c',
++	'zmq_config.c',
++	'zmq_port_control.c',
++	'zmq_server.c',
++	'zmq_service.c',
++	'zmq_stats.c',
++	'zmq_core_sched.c',)
++
++executable('virtio-forwarder',
++	[vrelay, generated_c, sources],
++	c_args: cflags,
++	dependencies: deps,
++	install: true)
++
++subdir('startup')
++subdir('doc')
+--- /dev/null
++++ b/scripts/meson.build
+@@ -0,0 +1,40 @@
++# BSD 3-Clause License
++#
++# Copyright 2018 Luca Boccassi <bl...@debian.org>
++#
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions are met:
++#
++# * Redistributions of source code must retain the above copyright notice, this
++#   list of conditions and the following disclaimer.
++#
++# * Redistributions in binary form must reproduce the above copyright notice,
++#   this list of conditions and the following disclaimer in the documentation
++#   and/or other materials provided with the distribution.
++#
++# * Neither the name of the copyright holder nor the names of its
++#   contributors may be used to endorse or promote products derived from
++#   this software without specific prior written permission.
++#
++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
++# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
++# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
++# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++scripts = files('create_zmq_dir.py',
++	'parse_numa.py',
++	'virtioforwarder_config.py',
++	'virtioforwarder_core_pinner.py',
++	'virtioforwarder_core_scheduler.py',
++	'virtioforwarder_monitor_load.py',
++	'virtioforwarder_port_control.py',
++	'virtioforwarder_stats.py'
++)
++
++install_data(scripts, install_dir: vf_install_dir)
+--- /dev/null
++++ b/startup/meson.build
+@@ -0,0 +1,41 @@
++# BSD 3-Clause License
++#
++# Copyright 2018 Luca Boccassi <bl...@debian.org>
++#
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions are met:
++#
++# * Redistributions of source code must retain the above copyright notice, this
++#   list of conditions and the following disclaimer.
++#
++# * Redistributions in binary form must reproduce the above copyright notice,
++#   this list of conditions and the following disclaimer in the documentation
++#   and/or other materials provided with the distribution.
++#
++# * Neither the name of the copyright holder nor the names of its
++#   contributors may be used to endorse or promote products derived from
++#   this software without specific prior written permission.
++#
++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
++# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
++# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
++# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++cfg_data = configuration_data()
++cfg_data.set('BINDIR', join_paths(get_option('prefix'), get_option('bindir')))
++configure_file(input: 'virtioforwarder',
++	output: 'virtioforwarder',
++	configuration: cfg_data,
++	install: true,
++	install_dir: join_paths('/', 'etc', 'default'))
++
++install_data(files('vio4wd-post-stop.sh', 'vio4wd-pre-start.sh', 'vio4wd-start.sh'),
++	install_dir: vf_install_dir)
++
++subdir('systemd')
+--- /dev/null
++++ b/startup/systemd/meson.build
+@@ -0,0 +1,38 @@
++# BSD 3-Clause License
++#
++# Copyright 2018 Luca Boccassi <bl...@debian.org>
++#
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions are met:
++#
++# * Redistributions of source code must retain the above copyright notice, this
++#   list of conditions and the following disclaimer.
++#
++# * Redistributions in binary form must reproduce the above copyright notice,
++#   this list of conditions and the following disclaimer in the documentation
++#   and/or other materials provided with the distribution.
++#
++# * Neither the name of the copyright holder nor the names of its
++#   contributors may be used to endorse or promote products derived from
++#   this software without specific prior written permission.
++#
++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
++# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
++# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
++# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++systemd_pc = dependency('systemd')
++service_dir = systemd_pc.get_pkgconfig_variable('systemdsystemunitdir')
++
++if service_dir == ''
++	service_dir = joint_paths('/', 'usr', 'lib', 'systemd', 'system')
++endif
++
++install_data(files('vio4wd_core_scheduler.service', 'virtio-forwarder.service'),
++	install_dir: service_dir)
+--- a/startup/virtioforwarder
++++ b/startup/virtioforwarder
+@@ -116,7 +116,7 @@
+ VIRTIOFWD_SOCKET_FNAME_PATTERN=
+ 
+ # Path to virtio-forwarder binary (debugging knob).
+-VIRTIOFWD_BINARY=__BINDIR__/virtio-forwarder
++VIRTIOFWD_BINARY=@BINDIR@/virtio-forwarder
+ 
+ # CPU to use as the master lcore. Blank defaults to CPU0
+ VIRTIOFWD_MASTER_LCORE=
+--- a/vrelay_version.h.in
++++ b/vrelay_version.h.in
+@@ -42,11 +42,11 @@
+ #include <string.h>
+ #include <stdio.h>
+ 
+-#define VIRTIO_FWD_VERSION_MAJOR 0 // Autogenerated from Makefile
+-#define VIRTIO_FWD_VERSION_MINOR 0 // Autogenerated from Makefile
+-#define VIRTIO_FWD_VERSION_PATCH 0 // Autogenerated from Makefile
+-#define VIRTIO_FWD_VERSION_BUILD 0 // Autogenerated from Makefile
+-#define VIRTIO_FWD_VERSION_SHASH "" // Autogenerated from Makefile
++#define VIRTIO_FWD_VERSION_MAJOR @MAJOR@ // Autogenerated from Makefile
++#define VIRTIO_FWD_VERSION_MINOR @MINOR@ // Autogenerated from Makefile
++#define VIRTIO_FWD_VERSION_PATCH @PATCH@ // Autogenerated from Makefile
++#define VIRTIO_FWD_VERSION_BUILD @BUILD@ // Autogenerated from Makefile
++#define VIRTIO_FWD_VERSION_SHASH "@SHASH@" // Autogenerated from Makefile
+ 
+ /**
+  * @brief Return virtio-forwarder version number string.
diff -Nru virtio-forwarder-1.1.99.13/debian/patches/series virtio-forwarder-1.1.99.13/debian/patches/series
--- virtio-forwarder-1.1.99.13/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ virtio-forwarder-1.1.99.13/debian/patches/series	2018-12-13 19:59:51.000000000 +0000
@@ -0,0 +1,2 @@
+dpdk_1811.patch
+meson.patch
diff -Nru virtio-forwarder-1.1.99.13/debian/rules virtio-forwarder-1.1.99.13/debian/rules
--- virtio-forwarder-1.1.99.13/debian/rules	2018-06-11 13:02:44.000000000 +0100
+++ virtio-forwarder-1.1.99.13/debian/rules	2018-12-13 20:34:59.000000000 +0000
@@ -4,15 +4,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
 
 %:
-	ARCH=$(DEB_HOST_GNU_CPU) dh $@
-
-override_dh_auto_install:
-	$(MAKE) DESTDIR=$$(pwd)/debian/virtio-forwarder prefix=/usr \
-	unitdir=/lib/systemd/system ARCH=$(DEB_HOST_GNU_CPU) install
-
-override_dh_auto_clean:
-	$(MAKE) DESTDIR=$$(pwd)/debian/virtio-forwarder \
-	ARCH=$(DEB_HOST_GNU_CPU) clean
+	dh $@ --buildsystem=meson

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to