From 97faa6f3b8867daa69a19aba94757524ec23cb87 Mon Sep 17 00:00:00 2001
From: Sandro Tosi <morph@debian.org>
Date: Tue, 17 Mar 2020 12:24:27 -0400
Subject: [PATCH] Drop python2 support; Closes: #938107

---
 debian/changelog                            |  6 +++++
 debian/control                              | 30 ++-------------------
 debian/rules                                |  4 +--
 debian/tests/run-testsuite-if-attrs-enabled |  4 ---
 debian/tests/simple                         |  2 --
 5 files changed, 9 insertions(+), 37 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7089bbc..f972697 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-pyxattr (0.6.1-2) UNRELEASED; urgency=medium
+
+  * Drop python2 support; Closes: #938107
+
+ -- Sandro Tosi <morph@debian.org>  Tue, 17 Mar 2020 11:56:32 -0400
+
 python-pyxattr (0.6.1-1) unstable; urgency=medium
 
   * New upstream release, with two changes that affect Linux and Debian:
diff --git a/debian/control b/debian/control
index 12edce2..12c8367 100644
--- a/debian/control
+++ b/debian/control
@@ -3,41 +3,15 @@ Section: python
 Priority: optional
 Maintainer: Iustin Pop <iustin@debian.org>
 Build-Depends: debhelper (>= 11~), dh-python,
- python (>= 2.6.6-3~), python-all-dev (>= 2.6.6-3~), python-all-dbg,
  python3-all, python3-all-dev, python3-all-dbg,
- python-setuptools, python3-setuptools,
- python-sphinx (>= 1.0.7+dfsg) | python3-sphinx
+ python3-setuptools,
+ python3-sphinx
 Standards-Version: 4.2.1
 Homepage: https://pyxattr.k1024.org/
 Vcs-Browser: https://salsa.debian.org/debian/python-pyxattr
 Vcs-Git: https://salsa.debian.org/debian/python-pyxattr.git
 Rules-Requires-Root: no
 
-Package: python-pyxattr
-Architecture: any
-Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
-Provides: ${python:Provides}
-Suggests: python-pyxattr-dbg, python-pyxattr-doc
-Description: module for manipulating filesystem extended attributes
- pyxattr is a Python interface to the libattr library. It allows
- manipulation of the filesystem extended attributes present in some
- operating systems (GNU/Linux included).
- .
- This package contains the library for Python 2.
-
-Package: python-pyxattr-dbg
-Section: debug
-Architecture: any
-Depends: python-pyxattr (= ${binary:Version}), python-dbg, ${shlibs:Depends},
- ${misc:Depends}, ${python:Depends}
-Provides: ${python:Provides}
-Description: module for manipulating filesystem extended attributes (debug extension)
- pyxattr is a Python interface to the libattr library. It allows
- manipulation of the filesystem extended attributes present in some
- operating systems (GNU/Linux included).
- .
- This package contains the library for the Python 2 debug interpreter.
-
 Package: python3-pyxattr
 Architecture: any
 Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}
diff --git a/debian/rules b/debian/rules
index 0efa0b6..e3d1e8d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,7 +14,7 @@ DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 
 %:
-	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
+	dh $@ --with python3,sphinxdoc --buildsystem=pybuild
 
 # Also build the documentation
 override_dh_auto_build:
@@ -27,11 +27,9 @@ override_dh_auto_clean:
 	$(MAKE) clean
 
 override_dh_strip:
-	dh_strip -ppython-pyxattr --dbg-package=python-pyxattr-dbg
 	dh_strip -ppython3-pyxattr --dbg-package=python3-pyxattr-dbg
 
 override_dh_installdocs:
-	dh_installdocs --link-doc=python-pyxattr -ppython-pyxattr-dbg
 	dh_installdocs --link-doc=python3-pyxattr -ppython3-pyxattr-dbg
 	dh_installdocs -A --remaining-packages README.rst
 
diff --git a/debian/tests/run-testsuite-if-attrs-enabled b/debian/tests/run-testsuite-if-attrs-enabled
index 11d51cc..c61b529 100755
--- a/debian/tests/run-testsuite-if-attrs-enabled
+++ b/debian/tests/run-testsuite-if-attrs-enabled
@@ -7,10 +7,6 @@ touch "$TESTFILE"
 if setfattr -n user.foo -v bar "$TESTFILE"; then
   echo "Temporary directory '$ADTTMP' has extended attributes, running tests"
   export TEST_DIR="$ADTTMP"
-  echo "* testing Python 2"
-  python2 test/test_xattr.py
-  echo "* testing Python 2 debug package"
-  python2-dbg test/test_xattr.py
   echo "* testing Python 3"
   python3 test/test_xattr.py
   echo "* testing Python 3 debug package"
diff --git a/debian/tests/simple b/debian/tests/simple
index a68a0b9..fe741aa 100755
--- a/debian/tests/simple
+++ b/debian/tests/simple
@@ -6,7 +6,5 @@
 cd "$ADTTMP/"
 
 # and now simply import the modules:
-python2 -c 'import xattr; print xattr; print xattr.__version__'
-python2-dbg -c 'import xattr; print xattr; print xattr.__version__'
 python3 -c 'import xattr; print(xattr); print(xattr.__version__)'
 python3-dbg -c 'import xattr; print(xattr); print(xattr.__version__)'
-- 
2.39.5