From 203547c537168c7785df5238bbe92fe7b088e233 Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 11 Feb 2020 19:03:12 -0500 Subject: [PATCH] apply @edmonds patch to use pybuild, yay! --- debian/python3-notcurses.install | 1 - debian/python3-notcurses.postinst | 11 ----------- debian/python3-notcurses.prerm | 11 ----------- debian/rules | 10 +++++----- 4 files changed, 5 insertions(+), 28 deletions(-) delete mode 100644 debian/python3-notcurses.install delete mode 100755 debian/python3-notcurses.postinst delete mode 100755 debian/python3-notcurses.prerm diff --git a/debian/python3-notcurses.install b/debian/python3-notcurses.install deleted file mode 100644 index 3272cd653..000000000 --- a/debian/python3-notcurses.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/python3/dist-packages/* diff --git a/debian/python3-notcurses.postinst b/debian/python3-notcurses.postinst deleted file mode 100755 index afdc3ef03..000000000 --- a/debian/python3-notcurses.postinst +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -set -e - -# --------------------- copied from dh-python 4.20191017 --------- -if which py3compile >/dev/null 2>&1; then - py3compile -p python3-notcurses -fi -if which pypy3compile >/dev/null 2>&1; then - pypy3compile -p python3-notcurses || true -fi -# --------------------- end material copied from dh-python ------- diff --git a/debian/python3-notcurses.prerm b/debian/python3-notcurses.prerm deleted file mode 100755 index 8559630e2..000000000 --- a/debian/python3-notcurses.prerm +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -set -e - -# --------------------- copied from dh-python 4.20191017 --------- -if which py3clean >/dev/null 2>&1; then - py3clean -p python3-notcurses -else - dpkg -L python3-notcurses | perl -ne 's,/([^/]*)\.py$,/__pycache__/\1.*, or next; unlink $_ or die $! foreach glob($_)' - find /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir -fi -# --------------------- end material copied from dh-python ------- diff --git a/debian/rules b/debian/rules index ce1a27a8f..3bf377894 100755 --- a/debian/rules +++ b/debian/rules @@ -3,8 +3,9 @@ DEB_HOST_MULTIARCH?=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) export DEB_BUILD_MAINT_OPTIONS=hardening=+all - export PYBUILD_NAME=notcurses +export PYBUILD_DIR=python +export PYBUILD_DESTDIR=debian/python3-notcurses CFLAGS += -ffile-prefix-map=$(CURDIR)=/ @@ -16,10 +17,9 @@ override_dh_auto_configure: override_dh_auto_build: dh_auto_build - cd python && python3 setup.py build_ext -L../obj-$(DEB_HOST_MULTIARCH) -I../include - cd python && python3 setup.py build_py + CFLAGS="$(CFLAGS) -I$(CURDIR)/include" LDFLAGS="$(LDFLAGS) \ + -L$(CURDIR)/obj-$(DEB_HOST_MULTIARCH)" pybuild --build override_dh_auto_install: dh_auto_install -B $(BUILDDIR) - cd python && python3 setup.py install --prefix=/usr --skip-build --root=../debian/tmp --install-layout=deb --single-version-externally-managed - rm -rf debian/tmp/usr/lib/python3/dist-packages/__pycache__ + pybuild --install