From be8a3bf0ac89b4c5717c89b622dac62ead9e94fe Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Mon, 6 May 2019 23:10:18 +0600 Subject: [PATCH 1/9] Build deb on CircleCI. --- .circleci/config.yml | 31 +++++++++++++++++++++++++++++++ debian/changelog | 6 ++++++ 2 files changed, 37 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..2aa3a51 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,31 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/python:3.6.8-stretch + steps: + - checkout + - run: + name: Install dependencies + command: | + sudo apt-get install -y gcc python3-dev pkg-config \ + nmap iptables devscripts ruby2.3-dev rubygems \ + build-essential:native python-setuptools python3-all python3-setuptools + - run: + name: Install PackageCloud + command: | + sudo gem install rake package_cloud + - run: + name: Build dpkg packages + command: | + debuild -i -us -uc -b + mkdir -p /tmp/deb + mv ../*.deb /tmp/deb + - deploy: + command: | + if [ "${CIRCLE_BRANCH}" == "master" ]; then + package_cloud push wott/agent/debian/stretch /tmp/deb/*.deb + package_cloud push wott/agent/raspbian/stretch /tmp/deb/*.deb + fi + - store_artifacts: + path: /tmp/deb diff --git a/debian/changelog b/debian/changelog index e8bab22..bb74536 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-iptables (0.14.0-dev) stable; urgency=medium + + * update debian changelog + + -- Artem Martynovich Mon, 06 May 2019 23:02:50 +0600 + python-iptables (0.12.0) xenial; urgency=low * update debian changelog From 98e6abbf414a64e37ad2db8a3524b318e19fc2e3 Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Mon, 6 May 2019 23:37:50 +0600 Subject: [PATCH 2/9] dummy update. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bb74536..c432745 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-iptables (0.14.0-dev) stable; urgency=medium +python-iptables (0.14.0) stable; urgency=medium * update debian changelog From 782f0245f5a550362cb5c8312665d8312d8fd057 Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Mon, 6 May 2019 23:46:27 +0600 Subject: [PATCH 3/9] Remove python2 support. --- debian/control | 34 ++++++++++------------------------ debian/rules | 16 ++-------------- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/debian/control b/debian/control index 2f82047..6c9fd04 100644 --- a/debian/control +++ b/debian/control @@ -2,34 +2,20 @@ Source: python-iptables Section: net Priority: extra Maintainer: Juliano Martinez -Build-depends: python-all-dev (>= 2.7), python-all-dbg (>= 2.7), python3-all-dev (>= 3.2), python3-all-dbg, debhelper (>= 7) -X-Python-Version: >= 2.7 -X-Python3-Version: >= 3.2 -Standards-Version: 3.8.4 -Homepage: https://github.com/ldx/python-iptables - -Package: python-iptables -Architecture: any -Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends} -Provides: ${python:Provides} -Description: Python bindings for iptables - Python-iptables is a Python project that provides bindings to the iptables C libraries in Linux. - Interoperability with iptables is achieved using the iptables C libraries (libiptc, libxtables, - and iptables extensions), not calling the iptables executable and parsing its output as most other - iptables wrapper libraries do; this makes python-iptables faster and not prone to parsing errors, - at the same time leveraging all available iptables match and target extensions without further work. - -Package: python-iptables-dbg -Section: debug Priority: extra -Architecture: any -Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-iptables (= ${binary:Version}) -Provides: ${python:Provides} -Description: Python bindings for iptables +Build-Depends: + debhelper (>= 8), + dh-python, + python-setuptools, + python3-all, + python3-setuptools +Standards-Version: 3.9.8 +X-Python3-Version: >= 3.5 +Homepage: https://github.com/ldx/python-iptables Package: python3-iptables Architecture: any -Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends} +Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}, python3-pkg-resources Description: Python3 bindings for iptables Package: python3-iptables-dbg diff --git a/debian/rules b/debian/rules index 4fd181a..f3a7867 100755 --- a/debian/rules +++ b/debian/rules @@ -4,10 +4,9 @@ # Thu, 14 Nov 2013 16:04:50 +0100 PY3VERS := $(shell py3versions -r) -PY2VERS := $(shell pyversions -r) %: - dh $@ --with python2,python3 --buildsystem=python_distutils + dh $@ --with python3 --buildsystem=python_distutils .PHONY: override_dh_clean override_dh_clean: @@ -27,22 +26,11 @@ override_dh_auto_install: set -e; \ mkdir -p $(CURDIR)/debian/python3-iptables/etc/ld.so.conf.d; \ echo "/usr/lib/python3/dist-packages" > $(CURDIR)/debian/python3-iptables/etc/ld.so.conf.d/python3-dist-packages.conf - - set -e; \ - for py in $(PY2VERS); do \ - $$py -B setup.py install --root debian/python-iptables --install-layout deb; \ - $$py-dbg -B setup.py install --root debian/python-iptables-dbg --install-layout deb; \ - done .PHONY: override_dh_strip override_dh_strip: set -e; \ - dh_strip -ppython-ev --dbg-package=python-iptables-dbg; \ - dh_strip -ppython3-ev --dbg-package=python3-iptables-dbg; - -override_dh_python2: - dh_python2 -ppython-iptables - dh_python2 -ppython-iptables-dbg + dh_strip -ppython3-ev --dbg-package=python3-iptables-dbg; override_dh_python3: dh_python3 -ppython3-iptables From 453a5ff8ad26a21de3ce1ed1c775d07c0a383869 Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Mon, 6 May 2019 23:48:37 +0600 Subject: [PATCH 4/9] Typo. --- debian/control | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/control b/debian/control index 6c9fd04..37c4e10 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,6 @@ Source: python-iptables Section: net Priority: extra Maintainer: Juliano Martinez -Priority: extra Build-Depends: debhelper (>= 8), dh-python, From 7cbb517de215984e529cd04f7f347947417308c0 Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Mon, 6 May 2019 23:56:46 +0600 Subject: [PATCH 5/9] python3-dbg build dependency. --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 37c4e10..dae8bed 100644 --- a/debian/control +++ b/debian/control @@ -5,6 +5,7 @@ Maintainer: Juliano Martinez Build-Depends: debhelper (>= 8), dh-python, + python3-dbg, python-setuptools, python3-all, python3-setuptools From db4d67f0b3db673adeeaecf693b8fc77560e0f23 Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Mon, 6 May 2019 23:58:39 +0600 Subject: [PATCH 6/9] python3-dbg build dependency. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2aa3a51..e478248 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ jobs: - run: name: Install dependencies command: | - sudo apt-get install -y gcc python3-dev pkg-config \ + sudo apt-get install -y gcc python3-dev python3-dbg pkg-config \ nmap iptables devscripts ruby2.3-dev rubygems \ build-essential:native python-setuptools python3-all python3-setuptools - run: From 81813de3cd2976c951f052269c0bc6dc3fd87ccd Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Tue, 7 May 2019 02:08:15 +0600 Subject: [PATCH 7/9] Name package on PackageCloud accordingly. --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e478248..42f70bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,8 +24,8 @@ jobs: - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - package_cloud push wott/agent/debian/stretch /tmp/deb/*.deb - package_cloud push wott/agent/raspbian/stretch /tmp/deb/*.deb + package_cloud push wott/python-iptables/debian/stretch /tmp/deb/*.deb + package_cloud push wott/python-iptables/raspbian/stretch /tmp/deb/*.deb fi - store_artifacts: path: /tmp/deb From 80c3ca30050392041db1cb76a0d5e503cec610bf Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Tue, 7 May 2019 12:53:49 +0600 Subject: [PATCH 8/9] Add armhf deb arch. --- .circleci/config.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 42f70bc..21ff037 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,19 +8,30 @@ jobs: - run: name: Install dependencies command: | + sudo dpkg --add-architecture armhf + sudo dpkg --add-architecture i386 + sudo apt-get update sudo apt-get install -y gcc python3-dev python3-dbg pkg-config \ nmap iptables devscripts ruby2.3-dev rubygems \ - build-essential:native python-setuptools python3-all python3-setuptools + build-essential:native python-setuptools python3-all python3-setuptools \ + crossbuild-essential-armhf binutils-multiarch - run: name: Install PackageCloud command: | sudo gem install rake package_cloud - run: - name: Build dpkg packages + name: Build dpkg amd64 command: | debuild -i -us -uc -b mkdir -p /tmp/deb mv ../*.deb /tmp/deb + - run: + name: Build dpkg armhf + command: | + sudo apt-get install -y python3-all:armhf + debuild -aarmhf -i -us -uc -b + mkdir -p /tmp/deb + mv ../*.deb /tmp/deb - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then From 9f8652fe0be8e2d3c2596bf3e92861b1e772e9bb Mon Sep 17 00:00:00 2001 From: Artem Martynovich Date: Tue, 7 May 2019 13:14:37 +0600 Subject: [PATCH 9/9] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 21ff037..948f854 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: circleci/python:3.6.8-stretch + - image: circleci/stretch steps: - checkout - run: