Control: tags -1 + patch

Hello,

Please see attached patch with my naive attempt at porting libhdate
to build python3 bindings instead of python2.

This seems to work with the patch I'm about to post to the only
reverse build-dependency bsdmainutils in #936244 but you should
probably review it carefully anyway since I'm not really sure
what I'm doing here.

Regards,
Andreas Henriksson
diff -Nru libhdate-1.6.02/debian/changelog libhdate-1.6.02/debian/changelog
--- libhdate-1.6.02/debian/changelog    2018-07-30 05:49:11.000000000 +0200
+++ libhdate-1.6.02/debian/changelog    2019-10-24 21:52:59.000000000 +0200
@@ -1,3 +1,13 @@
+libhdate (1.6.02-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add debian/patches/python3.patch
+    - make configure.in check for python3 instead of python(2)
+  * debian/control: switch build-deps to python3 variants
+  * debian/rules: switch to python3 debhelper extension
+
+ -- Andreas Henriksson <andr...@fatal.se>  Thu, 24 Oct 2019 21:52:59 +0200
+
 libhdate (1.6.02-2) unstable; urgency=medium
 
   * Update maintainer address (Closes: #899576)
diff -Nru libhdate-1.6.02/debian/control libhdate-1.6.02/debian/control
--- libhdate-1.6.02/debian/control      2018-07-30 05:41:00.000000000 +0200
+++ libhdate-1.6.02/debian/control      2019-10-24 21:52:59.000000000 +0200
@@ -7,7 +7,7 @@
 Vcs-Git: https://salsa.debian.org/hebrew-team/libhdate.git
 Build-Depends: debhelper (>= 9),
  swig,
- python-dev (>= 2.6.6-3~),
+ python3-dev,
  dh-python,
  dh-autoreconf,
 Standards-Version: 3.9.8
@@ -26,11 +26,11 @@
  This package contains headers and support files required
  to build new applications with libhdate.
 
-Package: python-hdate
+Package: python3-hdate
 Section: python
 Architecture: any
-Provides: ${python:Provides}
-Depends: libhdate1 (= ${binary:Version}), ${python:Depends}, 
${shlibs:Depends}, ${misc:Depends}
+Provides: ${python3:Provides}
+Depends: libhdate1 (= ${binary:Version}), ${python3:Depends}, 
${shlibs:Depends}, ${misc:Depends}
 Description: Provides a library that help use Hebrew dates (Python bindings)
  LibHdate is a small C,C++ library for Hebrew dates,
  holidays, and reading sequence (parasha). It is using 
diff -Nru libhdate-1.6.02/debian/patches/python3.patch 
libhdate-1.6.02/debian/patches/python3.patch
--- libhdate-1.6.02/debian/patches/python3.patch        1970-01-01 
01:00:00.000000000 +0100
+++ libhdate-1.6.02/debian/patches/python3.patch        2019-10-24 
21:52:59.000000000 +0200
@@ -0,0 +1,22 @@
+--- a/configure.in
++++ b/configure.in
+@@ -83,7 +83,7 @@
+ 
+ dnl 
=======================================================================================
+ 
+-AC_CHECK_PROG(have_python, "python", yes, no)
++AC_CHECK_PROG(have_python, "python3", yes, no)
+ 
+ build_python=$have_python
+ 
+@@ -97,8 +97,8 @@
+   [path to python site lib])])
+ 
+ if test "$have_python" = "yes"; then
+-        PY_PREFIX=`python -c 'import sys ; print sys.prefix'`
+-        PY_VERSION=`python -c 'import sys ; print sys.version[[0:3]]'`
++        PY_PREFIX=`python3 -c 'import sys ; print(sys.prefix)'`
++        PY_VERSION=`python3 -c 'import sys ; print(sys.version[[0:3]])'`
+         AC_MSG_CHECKING(for $PY_PREFIX/include/python$PY_VERSION/Python.h)
+         if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
+                 AC_MSG_RESULT(yes)
diff -Nru libhdate-1.6.02/debian/patches/series 
libhdate-1.6.02/debian/patches/series
--- libhdate-1.6.02/debian/patches/series       2018-07-30 05:28:32.000000000 
+0200
+++ libhdate-1.6.02/debian/patches/series       2019-10-24 21:49:28.000000000 
+0200
@@ -6,3 +6,4 @@
 duplicate_gnu_source.patch
 size_t.patch
 clang.patch
+python3.patch
diff -Nru libhdate-1.6.02/debian/python3-hdate.install 
libhdate-1.6.02/debian/python3-hdate.install
--- libhdate-1.6.02/debian/python3-hdate.install        1970-01-01 
01:00:00.000000000 +0100
+++ libhdate-1.6.02/debian/python3-hdate.install        2018-07-30 
05:28:32.000000000 +0200
@@ -0,0 +1 @@
+usr/lib/python*/*
diff -Nru libhdate-1.6.02/debian/python-hdate.install 
libhdate-1.6.02/debian/python-hdate.install
--- libhdate-1.6.02/debian/python-hdate.install 2018-07-30 05:28:32.000000000 
+0200
+++ libhdate-1.6.02/debian/python-hdate.install 1970-01-01 01:00:00.000000000 
+0100
@@ -1 +0,0 @@
-usr/lib/python*/*
diff -Nru libhdate-1.6.02/debian/rules libhdate-1.6.02/debian/rules
--- libhdate-1.6.02/debian/rules        2018-07-30 05:28:32.000000000 +0200
+++ libhdate-1.6.02/debian/rules        2019-10-24 21:52:59.000000000 +0200
@@ -3,10 +3,10 @@
 ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')
 
 %:
-       dh $* --with python2,autoreconf
+       dh $* --with python3,autoreconf
 
 override_dh_auto_configure:
        dh_auto_configure -- --with-perl-sitelib-dir=$(ARCHLIB)
 
-override_dh_python2:
-       dh_python2 -s --no-guessing-versions
+override_dh_python3:
+       dh_python3 -s

Reply via email to