[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#936128: Bug #936128: apr: Python2 removal in sid/bullseye



Control: tags -1 + patches

Please find the attached patch to make apr build with python3. I've also created a
pull request on salsa repository with the same content:
https://salsa.debian.org/apache-team/apr/merge_requests/2

Regards,
Aron
From 0ba955bab778cdc63530ed1ce0cb1e0cca75d77f Mon Sep 17 00:00:00 2001
From: Aron Xu <happyaron.xu@gmail.com>
Date: Sun, 19 Jan 2020 03:01:46 +0000
Subject: [PATCH] Add patch to make the package use python3 (Closes: #936128)

---
 debian/control                       |  4 +-
 debian/patches/port-to-python3.patch | 63 ++++++++++++++++++++++++++++
 debian/patches/series                |  1 +
 3 files changed, 66 insertions(+), 2 deletions(-)
 create mode 100644 debian/patches/port-to-python3.patch

diff --git a/debian/control b/debian/control
index 0e97170..6f0cbe5 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: libs
 Priority: optional
 Maintainer: Debian Apache Maintainers <debian-apache@lists.debian.org>
 Uploaders: Stefan Fritsch <sf@debian.org>
-Build-Depends: debhelper (>= 11), autoconf, mawk, uuid-dev, doxygen, netbase, net-tools, libtool (>= 2), python:any, libsctp-dev [linux-any]
+Build-Depends: debhelper (>= 11), autoconf, mawk, uuid-dev, doxygen, netbase, net-tools, libtool (>= 2), python3:any, libsctp-dev [linux-any]
 Standards-Version: 4.2.1
 Vcs-Browser: https://salsa.debian.org/apache-team/apr
 Vcs-Git: https://salsa.debian.org/apache-team/apr.git
@@ -24,7 +24,7 @@ Package: libapr1-dev
 Architecture: any
 Section: libdevel
 Depends: libapr1 (= ${binary:Version}), uuid-dev, ${misc:Depends}, libsctp-dev [linux-any]
-Suggests: python
+Suggests: python3
 Conflicts: libapr1.0-dev, libapr0-dev
 Description: Apache Portable Runtime Library - Development Headers
  APR is Apache's Portable Runtime Library, designed to be a support library 
diff --git a/debian/patches/port-to-python3.patch b/debian/patches/port-to-python3.patch
new file mode 100644
index 0000000..651fd86
--- /dev/null
+++ b/debian/patches/port-to-python3.patch
@@ -0,0 +1,63 @@
+From: Aron Xu <aron@debian.org>
+Date: Sun, 19 Jan 2020 02:59:41 +0000
+Subject: Port to use Python3
+
+===================================================================
+---
+ build/buildcheck.sh | 10 +++++-----
+ build/gen-build.py  |  6 +++---
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/build/buildcheck.sh b/build/buildcheck.sh
+index 9fb2b2a..7edc405 100755
+--- a/build/buildcheck.sh
++++ b/build/buildcheck.sh
+@@ -4,15 +4,15 @@ echo "buildconf: checking installation..."
+ res=0
+ 
+ # any python
+-python=`build/PrintPath python`
++python=`build/PrintPath python3`
+ if test -z "$python"; then
+-  echo "buildconf: python not found."
+-  echo "           You need python installed"
++  echo "buildconf: python3 not found."
++  echo "           You need python3 installed"
+   echo "           to build APR from SVN."
+   res=1
+ else
+-  py_version=`python -c 'import sys; print sys.version' 2>&1|sed 's/ .*//;q'`
+-  echo "buildconf: python version $py_version (ok)"
++  py_version=`python3 -c 'import sys; print(sys.version)' 2>&1|sed 's/ .*//;q'`
++  echo "buildconf: python3 version $py_version (ok)"
+ fi
+ 
+ # autoconf 2.59 or newer
+diff --git a/build/gen-build.py b/build/gen-build.py
+index aa94c33..31ed574 100755
+--- a/build/gen-build.py
++++ b/build/gen-build.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # USAGE: gen-build.py TYPE
+ #
+@@ -10,7 +10,7 @@
+ 
+ 
+ import os
+-import ConfigParser
++import configparser
+ import getopt
+ import string
+ import glob
+@@ -36,7 +36,7 @@ MAKE_PLATFORMS = [
+ 
+ 
+ def main():
+-  parser = ConfigParser.ConfigParser()
++  parser = configparser.ConfigParser()
+   parser.read('build.conf')
+ 
+   if parser.has_option('options', 'dsp'):
diff --git a/debian/patches/series b/debian/patches/series
index d1e5fdc..6631e11 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ libtoolize_check.patch
 debug_testpoll_failure.patch
 use_fcntl_locking.patch
 cross.patch
+port-to-python3.patch
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature


Reply to: