From patchwork Tue Jun 19 21:46:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Leblond X-Patchwork-Id: 931863 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=regit.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 419M5l4kx2z9s3R for ; Wed, 20 Jun 2018 07:48:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967398AbeFSVsJ (ORCPT ); Tue, 19 Jun 2018 17:48:09 -0400 Received: from home.regit.org ([37.187.126.138]:53308 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967309AbeFSVrW (ORCPT ); Tue, 19 Jun 2018 17:47:22 -0400 Received: from [2a01:e35:2fb6:1160:a115:3711:d77b:3dea] (helo=localhost.localdomain) by home.regit.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1fVOT2-00014i-KG; Tue, 19 Jun 2018 23:47:19 +0200 From: Eric Leblond To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org, Phil Sutter , Eric Leblond Subject: [PATCH nft v2 1/7] configure.ac: better message when a2x is missing Date: Tue, 19 Jun 2018 23:46:50 +0200 Message-Id: <20180619214656.25636-2-eric@regit.org> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180619214656.25636-1-eric@regit.org> References: <9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org> <20180619214656.25636-1-eric@regit.org> Reply-To: 9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org X-Spam-Score: -1.0 (-) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3c5ba4d..5705702 100644 --- a/configure.ac +++ b/configure.ac @@ -82,7 +82,7 @@ AM_COND_IF([BUILD_PDF], [ AS_IF([test "$need_a2x" = "yes"], [ AC_CHECK_PROG(A2X, [a2x], [found], [no]) AS_IF([test "$A2X" != "found"], - [AC_MSG_ERROR([a2x not found])]) + [AC_MSG_ERROR([a2x not found, please install asciidoc])]) ]) PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3]) From patchwork Tue Jun 19 21:46:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Leblond X-Patchwork-Id: 931864 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=regit.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 419M5q4Bhlz9s3R for ; Wed, 20 Jun 2018 07:48:15 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967396AbeFSVsJ (ORCPT ); Tue, 19 Jun 2018 17:48:09 -0400 Received: from home.regit.org ([37.187.126.138]:53314 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967310AbeFSVrW (ORCPT ); Tue, 19 Jun 2018 17:47:22 -0400 Received: from [2a01:e35:2fb6:1160:a115:3711:d77b:3dea] (helo=localhost.localdomain) by home.regit.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1fVOTA-00014i-32; Tue, 19 Jun 2018 23:47:20 +0200 From: Eric Leblond To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org, Phil Sutter , Eric Leblond Subject: [PATCH nft v2 2/7] configure.ac: remove useless braces in messages Date: Tue, 19 Jun 2018 23:46:51 +0200 Message-Id: <20180619214656.25636-3-eric@regit.org> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180619214656.25636-1-eric@regit.org> References: <9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org> <20180619214656.25636-1-eric@regit.org> Reply-To: 9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org X-Spam-Score: -1.0 (-) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 5705702..4d21cb4 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,7 @@ AC_SUBST(with_cli) AM_CONDITIONAL([BUILD_CLI], [test "x$with_cli" != xno]) AC_ARG_WITH([xtables], [AS_HELP_STRING([--with-xtables], - [Use libxtables for iptables interaction)])], + [Use libxtables for iptables interaction])], [with_libxtables=$withval], [with_libxtables=no]) AS_IF([test "x$with_libxtables" != xno], [ PKG_CHECK_MODULES([XTABLES], [xtables >= 1.6.1]) @@ -118,7 +118,7 @@ AC_SUBST(with_libxtables) AM_CONDITIONAL([BUILD_XTABLES], [test "x$with_libxtables" == xyes]) AC_ARG_WITH([json], [AS_HELP_STRING([--with-json], - [Enable JSON output support)])], + [Enable JSON output support])], [], [with_json=no]) AS_IF([test "x$with_json" != xno], [ AC_CHECK_LIB([jansson], [json_object], , From patchwork Tue Jun 19 21:46:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Leblond X-Patchwork-Id: 931865 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=regit.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 419M5z1YVlz9s3R for ; Wed, 20 Jun 2018 07:48:23 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967385AbeFSVsI (ORCPT ); Tue, 19 Jun 2018 17:48:08 -0400 Received: from home.regit.org ([37.187.126.138]:53322 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967312AbeFSVrW (ORCPT ); Tue, 19 Jun 2018 17:47:22 -0400 Received: from [2a01:e35:2fb6:1160:a115:3711:d77b:3dea] (helo=localhost.localdomain) by home.regit.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1fVOTA-00014i-Mp; Tue, 19 Jun 2018 23:47:21 +0200 From: Eric Leblond To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org, Phil Sutter , Eric Leblond Subject: [PATCH nft v2 3/7] configure.ac: docbook2man invalid syntax error Date: Tue, 19 Jun 2018 23:46:52 +0200 Message-Id: <20180619214656.25636-4-eric@regit.org> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180619214656.25636-1-eric@regit.org> References: <9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org> <20180619214656.25636-1-eric@regit.org> Reply-To: 9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org X-Spam-Score: -1.0 (-) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org docbook2man can not be used with the same option so let's remove it from the alternative. Fedora and debian seems to be fine with that. --- configure.ac | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 4d21cb4..9f5d0f9 100644 --- a/configure.ac +++ b/configure.ac @@ -56,14 +56,11 @@ AM_PROG_LIBTOOL AM_COND_IF([BUILD_MAN], [ AC_CHECK_PROG(DOCBOOK2X_MAN, [docbook2x-man], [docbook2x-man], [no]) - AC_CHECK_PROG(DOCBOOK2MAN, [docbook2man], [docbook2man], [no]) AC_CHECK_PROG(DB2X_DOCBOOK2MAN, [db2x_docbook2man], [db2x_docbook2man], [no]) AS_IF([test "$DOCBOOK2X_MAN" != "no"], [DB2MAN="$DOCBOOK2X_MAN"], - [AS_IF([test "$DOCBOOK2MAN" != "no"], [DB2MAN="$DOCBOOK2MAN"], - [AS_IF([test "$DB2X_DOCBOOK2MAN" != "no"], - [DB2MAN="$DB2X_DOCBOOK2MAN"], - [AC_MSG_ERROR([docbook2x-man/db2x_docbook2man not found, required for building man pages])] - )] + [AS_IF([test "$DB2X_DOCBOOK2MAN" != "no"], + [DB2MAN="$DB2X_DOCBOOK2MAN --xinclude"], + [AC_MSG_ERROR([docbook2x-man/db2x_docbook2man not found, required for building man pages])] )] ) AC_SUBST(DB2MAN) From patchwork Tue Jun 19 21:46:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Leblond X-Patchwork-Id: 931860 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=regit.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 419M5Y3bGBz9s3R for ; Wed, 20 Jun 2018 07:48:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755490AbeFSVr7 (ORCPT ); Tue, 19 Jun 2018 17:47:59 -0400 Received: from home.regit.org ([37.187.126.138]:53334 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967332AbeFSVrY (ORCPT ); Tue, 19 Jun 2018 17:47:24 -0400 Received: from [2a01:e35:2fb6:1160:a115:3711:d77b:3dea] (helo=localhost.localdomain) by home.regit.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1fVOTB-00014i-Ay; Tue, 19 Jun 2018 23:47:22 +0200 From: Eric Leblond To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org, Phil Sutter , Eric Leblond Subject: [PATCH nft v2 4/7] python: installation of binding via make install Date: Tue, 19 Jun 2018 23:46:53 +0200 Message-Id: <20180619214656.25636-5-eric@regit.org> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180619214656.25636-1-eric@regit.org> References: <9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org> <20180619214656.25636-1-eric@regit.org> Reply-To: 9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org X-Spam-Score: -1.0 (-) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org setup.py is used to build and install the python binding. Call to setup.py are done in Makefile to proceed to build and installation. --- Makefile.am | 3 ++- configure.ac | 24 ++++++++++++++++++++++++ py/.gitignore | 4 ++++ py/Makefile.am | 31 +++++++++++++++++++++++++++++++ py/__init__.py | 1 + py/nftables.py | 2 ++ py/setup.py | 23 +++++++++++++++++++++++ 7 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 py/Makefile.am create mode 100644 py/__init__.py create mode 100755 py/setup.py diff --git a/Makefile.am b/Makefile.am index 09664c3..e567d32 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,8 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src \ include \ files \ - doc + doc \ + py EXTRA_DIST = tests \ files diff --git a/configure.ac b/configure.ac index 9f5d0f9..b1a790d 100644 --- a/configure.ac +++ b/configure.ac @@ -125,6 +125,22 @@ AC_DEFINE([HAVE_LIBJANSSON], [1], [Define if you have libjansson]) AC_SUBST(with_json) AM_CONDITIONAL([BUILD_JSON], [test "x$with_json" != xno]) +AC_ARG_ENABLE(python, + AS_HELP_STRING([--enable-python], [Enable python]),,[enable_python=check] + ) + +AC_ARG_WITH([python_bin], + [AS_HELP_STRING([--with-python-bin], [Specify Python binary to use])], + [PYTHON_BIN="$withval"], [AC_PATH_PROGS(PYTHON_BIN, python python2 python2.7)] + ) + +AS_IF([test "x$PYTHON_BIN" == "x"], [ + AS_IF([test "x$enable_python" == "xyes"], [AC_MSG_ERROR([Python asked but not found])]) + AS_IF([test "x$enable_python" == "xcheck"], [AC_MSG_WARN([Python not found, continuing anyway])]) + ]) + +AM_CONDITIONAL([HAVE_PYTHON], [test "x$PYTHON_BIN" != "x"]) + AC_CONFIG_FILES([ \ Makefile \ libnftables.pc \ @@ -140,6 +156,7 @@ AC_CONFIG_FILES([ \ files/Makefile \ files/nftables/Makefile \ doc/Makefile \ + py/Makefile \ ]) AC_OUTPUT @@ -152,3 +169,10 @@ nft configuration: enable pdf documentation: ${enable_pdf_doc} libxtables support: ${with_libxtables} json output support: ${with_json}" + +AS_IF([test "x$PYTHON_BIN" != "x"], [ + echo " enable Python: yes (with $PYTHON_BIN)" + ], [ + echo " enable Python: no" + ] + ) diff --git a/py/.gitignore b/py/.gitignore index 0d20b64..09c1e62 100644 --- a/py/.gitignore +++ b/py/.gitignore @@ -1 +1,5 @@ *.pyc +build/ +dist/ +lib.*/ +nftables.egg-info/ diff --git a/py/Makefile.am b/py/Makefile.am new file mode 100644 index 0000000..0963535 --- /dev/null +++ b/py/Makefile.am @@ -0,0 +1,31 @@ +EXTRA_DIST = setup.py __init__.py nftables.py + +if HAVE_PYTHON + +all-local: + cd $(srcdir) && \ + $(PYTHON_BIN) setup.py build --build-base $(abs_builddir) + +install-exec-local: + cd $(srcdir) && \ + $(PYTHON_BIN) setup.py build --build-base $(abs_builddir) \ + install --prefix $(DESTDIR)$(prefix) + +uninstall-local: + rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/nftables + rm -rf $(DESTDIR)$(prefix)/lib*/python*/dist-packages/nftables + rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/nftables-[0-9]*.egg-info + rm -rf $(DESTDIR)$(prefix)/lib*/python*/dist-packages/nftables-[0-9]*.egg-info + rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/nftables-[0-9]*.egg + rm -rf $(DESTDIR)$(prefix)/lib*/python*/dist-packages/nftables-[0-9]*.egg + +clean-local: + cd $(srcdir) && \ + $(PYTHON_BIN) setup.py clean \ + --build-base $(abs_builddir) + rm -rf scripts-* lib* build dist bdist.* nftables.egg-info + find . -name \*.pyc -print0 | xargs -0 rm -f + +distclean-local: + rm -f version +endif diff --git a/py/__init__.py b/py/__init__.py new file mode 100644 index 0000000..7567f09 --- /dev/null +++ b/py/__init__.py @@ -0,0 +1 @@ +from .nftables import * diff --git a/py/nftables.py b/py/nftables.py index e6e66fb..d613505 100644 --- a/py/nftables.py +++ b/py/nftables.py @@ -2,6 +2,8 @@ import json from ctypes import * import sys +NFTABLES_VERSION = "0.1" + class Nftables: """A class representing libnftables interface""" diff --git a/py/setup.py b/py/setup.py new file mode 100755 index 0000000..ef143c4 --- /dev/null +++ b/py/setup.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +from distutils.core import setup +from nftables import NFTABLES_VERSION + +setup(name='nftables', + version=NFTABLES_VERSION, + description='Libnftables binding', + author='Netfilter project', + author_email='coreteam@netfilter.org', + url='https://netfilter.org/projects/nftables/index.html', + packages=['nftables'], + provides=['nftables'], + package_dir={'nftables':'.'}, + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python', + 'Topic :: System :: Networking :: Firewalls', + ], + ) From patchwork Tue Jun 19 21:46:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Leblond X-Patchwork-Id: 931861 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=regit.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 419M5b4567z9s47 for ; Wed, 20 Jun 2018 07:48:03 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967384AbeFSVr6 (ORCPT ); Tue, 19 Jun 2018 17:47:58 -0400 Received: from home.regit.org ([37.187.126.138]:53344 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964888AbeFSVrZ (ORCPT ); Tue, 19 Jun 2018 17:47:25 -0400 Received: from [2a01:e35:2fb6:1160:a115:3711:d77b:3dea] (helo=localhost.localdomain) by home.regit.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1fVOTC-00014i-Ha; Tue, 19 Jun 2018 23:47:23 +0200 From: Eric Leblond To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org, Phil Sutter , Eric Leblond Subject: [PATCH nft v2 5/7] python: set license and author in nftables.py Date: Tue, 19 Jun 2018 23:46:54 +0200 Message-Id: <20180619214656.25636-6-eric@regit.org> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180619214656.25636-1-eric@regit.org> References: <9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org> <20180619214656.25636-1-eric@regit.org> Reply-To: 9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org X-Spam-Score: -1.0 (-) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org It will be distributed separately so this worth setting things correctly. --- py/nftables.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/py/nftables.py b/py/nftables.py index d613505..e725c56 100644 --- a/py/nftables.py +++ b/py/nftables.py @@ -1,3 +1,19 @@ +#!/usr/bin/python +# Copyright(C) 2018 Phil Sutter + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + import json from ctypes import * import sys From patchwork Tue Jun 19 21:46:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Leblond X-Patchwork-Id: 931862 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=regit.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 419M5c4nwVz9s47 for ; Wed, 20 Jun 2018 07:48:04 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967271AbeFSVr6 (ORCPT ); Tue, 19 Jun 2018 17:47:58 -0400 Received: from home.regit.org ([37.187.126.138]:53356 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967337AbeFSVrZ (ORCPT ); Tue, 19 Jun 2018 17:47:25 -0400 Received: from [2a01:e35:2fb6:1160:a115:3711:d77b:3dea] (helo=localhost.localdomain) by home.regit.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1fVOTD-00014i-Bl; Tue, 19 Jun 2018 23:47:23 +0200 From: Eric Leblond To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org, Phil Sutter , Eric Leblond Subject: [PATCH nft v2 6/7] doc: fix make distcheck Date: Tue, 19 Jun 2018 23:46:55 +0200 Message-Id: <20180619214656.25636-7-eric@regit.org> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180619214656.25636-1-eric@regit.org> References: <9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org> <20180619214656.25636-1-eric@regit.org> Reply-To: 9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org X-Spam-Score: -1.0 (-) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org --- doc/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 9796d34..1ec3b3e 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -9,19 +9,19 @@ endif pdfdir=${docdir}/pdf .xml.pdf: - ${AM_V_GEN}dblatex -q -t pdf -o $@ $< + ${AM_V_GEN}dblatex -q -t pdf -o ${builddir}/$@ $< .xml.8: ${AM_V_GEN}${DB2MAN} --xinclude $< .adoc.pdf: - a2x --doctype manpage --format pdf $< + a2x --doctype manpage --format pdf -D ${builddir} $< .adoc.3: - a2x --doctype manpage --format manpage $< + a2x --doctype manpage --format manpage -D ${builddir} $< .adoc.5: - a2x --doctype manpage --format manpage $< + a2x --doctype manpage --format manpage -D ${builddir} $< EXTRA_DIST = nft.xml libnftables-json.adoc libnftables.adoc From patchwork Tue Jun 19 21:46:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Leblond X-Patchwork-Id: 931859 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=regit.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 419M5N5lZWz9s3R for ; Wed, 20 Jun 2018 07:47:52 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967205AbeFSVru (ORCPT ); Tue, 19 Jun 2018 17:47:50 -0400 Received: from home.regit.org ([37.187.126.138]:53362 "EHLO home.regit.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967338AbeFSVr0 (ORCPT ); Tue, 19 Jun 2018 17:47:26 -0400 Received: from [2a01:e35:2fb6:1160:a115:3711:d77b:3dea] (helo=localhost.localdomain) by home.regit.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1fVOTD-00014i-Vc; Tue, 19 Jun 2018 23:47:24 +0200 From: Eric Leblond To: pablo@netfilter.org Cc: netfilter-devel@vger.kernel.org, Phil Sutter , Eric Leblond Subject: [PATCH nft v2 7/7] tests/py: minor cleaning Date: Tue, 19 Jun 2018 23:46:56 +0200 Message-Id: <20180619214656.25636-8-eric@regit.org> X-Mailer: git-send-email 2.18.0.rc2 In-Reply-To: <20180619214656.25636-1-eric@regit.org> References: <9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org> <20180619214656.25636-1-eric@regit.org> Reply-To: 9fdfaa849a662a7a1e31d9887a9168992913083a.camel@regit.org X-Spam-Score: -1.0 (-) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Move import and use explicit parameter in object creation. Acked-by: Phil Sutter :) --- tests/py/nft-test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py index c02294a..fdc1cd5 100755 --- a/tests/py/nft-test.py +++ b/tests/py/nft-test.py @@ -19,6 +19,10 @@ import argparse import signal import json +sys.path.insert(0,'../../py/') + +from nftables import Nftables + TESTS_PATH = os.path.dirname(os.path.abspath(__file__)) TESTS_DIRECTORY = ["any", "arp", "bridge", "inet", "ip", "ip6"] LOGFILE = "/tmp/nftables-test.log" @@ -1329,7 +1333,6 @@ def main(): os.chdir(TESTS_PATH + "/../..") sys.path.append('py/') - from nftables import Nftables if not os.path.exists('src/.libs/libnftables.so'): print "The nftables library does not exist. " \ @@ -1337,7 +1340,7 @@ def main(): return global nftables - nftables = Nftables('src/.libs/libnftables.so') + nftables = Nftables(sofile = 'src/.libs/libnftables.so') test_files = files_ok = run_total = 0 tests = passed = warnings = errors = 0