Source: redland-bindings
Severity: wishlist
Tags: patch

Dear Maintainer,

It would be nice to have python3 compatible packages for librdf.

There's only a few minor changes to the build process to build the library.

Diane Trout



-- System Information:
Debian Release: 8.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable'), (100, 
'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff --git a/debian/control b/debian/control
index 41fe042..1c5840d 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: redland-bindings
 Section: devel
 Priority: optional
 Maintainer: Dave Beckett <daj...@debian.org>
-Build-Depends: debhelper (>= 5.0.37.2), autotools-dev, libtool (>= 1.5), perl  (>= 5.8.1-2), python-all-dev (>= 2.6.6-3~), ruby2.1, ruby2.1-dev, librdf0-dev (>= 1.0.14), swig (>= 2.0.0), php5-cli, php5-dev
+Build-Depends: debhelper (>= 5.0.37.2), autotools-dev, libtool (>= 1.5), perl  (>= 5.8.1-2), python-all-dev (>= 2.6.6-3~), python3-all-dev (>= 3.2), ruby2.1, ruby2.1-dev, librdf0-dev (>= 1.0.14), swig (>= 2.0.0), php5-cli, php5-dev
 X-Python-Version: >= 2.6
 Standards-Version: 3.9.5
 Homepage: http://librdf.org/
@@ -22,9 +22,23 @@ Architecture: any
 Section: python
 Depends: ${misc:Depends}, ${shlibs:Depends}, ${python:Depends}
 Provides: ${python:Provides}
-Description: Python language bindings for the Redland RDF library
+Description: Python 2 language bindings for the Redland RDF library
  This package contains the files needed to use the Redland Resource
  Description Framework (RDF) library in Python programs.
+ .
+ This contains the Python 2 version.
+Homepage: http://librdf.org/docs/python.html
+
+Package: python3-librdf
+Architecture: any
+Section: python
+Depends: ${misc:Depends}, ${shlibs:Depends}, ${python:Depends}
+Provides: ${python:Provides}
+Description: Python 3 language bindings for the Redland RDF library
+ This package contains the files needed to use the Redland Resource
+ Description Framework (RDF) library in Python programs.
+ .
+ This contains the Python 3 version.
 Homepage: http://librdf.org/docs/python.html
 
 Package: librdf-ruby
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index e69de29..0000000
diff --git a/debian/rules b/debian/rules
index 5ad2d1c..1ee3186 100755
--- a/debian/rules
+++ b/debian/rules
@@ -44,8 +44,10 @@ export PHP_CONFIG
 
 # Python versions from constraints in X-Python-Version in debian/control
 PYVERS= $(shell pyversions -r)
+PY3VERS= $(shell py3versions -r)
 # Default python
 PYDEF= $(shell pyversions -d)
+PY3DEF= $(shell py3versions -d)
 
 # Perl vendorarch gets dynamic with 5.20
 PERL_ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')
@@ -97,6 +99,7 @@ clean1:
 
 	-cd python && $(MAKE) clean
 	-cd python && rm -f Redland_wrap.c Redland.py
+	-cd python && rm -rf __pycache__
 
 	-cd ruby && $(MAKE) clean
 	-cd ruby && rm -f redland_wrap.c
@@ -126,6 +129,17 @@ install: build
 	done
 	find $(CURDIR)/debian/python-librdf/usr -name "*.py[co]" -exec rm -f {} \;
 
+	cd python; \
+	for python in $(PY3VERS); do \
+	  pylib=$$($$python -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())'); \
+	  pyext=$$($$python -c 'from distutils import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))'); \
+          PYTHON=$$(echo $$python | sed "s/$(PY3DEF)/python3/"); \
+	  PYTHON=$$PYTHON make install DESTDIR=$(CURDIR)/debian/python3-librdf pythondir=$$pylib PYTHON_INCLUDES=-I/usr/include/$$python PYTHON_LIBEXT=$$pyext; \
+	  $(MAKE) clean >/dev/null 2>&1; \
+	done
+	find $(CURDIR)/debian/python-librdf/usr -name "*.py[co]" -exec rm -f {} \;
+
+
 	cd ruby ; \
 	$(MAKE) install DESTDIR=$(CURDIR)/debian/librdf-ruby
 
@@ -154,6 +168,7 @@ binary-arch: build install
 	dh_makeshlibs
 	dh_perl
 	dh_python2 -ppython-librdf
+	dh_python3 -ppython3-librdf
 	dh_installdeb
 	dh_shlibdeps
 	echo "php:Depends=phpapi-$(shell $(PHP_CONFIG) --phpapi)" >> \

Reply via email to