Package: owfs / 3.2p3+dfsg1-2

deb-specific-python-install.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Description: Debian compile python modules for all supported python versions
--- a/module/ownet/python/Makefile.am
+++ b/module/ownet/python/Makefile.am
@@ -4,7 +4,11 @@
 #	OpenSUSE is buggy and install libraries at /usr/local.
 #	Need to add call "install_lib --install-dir" or call "install --install-lib"
 #	$(PYTHON) setup.py install_lib --install-dir="/$(DESTDIR)$(PYSITEDIR)"
-	$(PYTHON) setup.py install --install-lib="$(DESTDIR)$(PYSITEDIR)"
+	set -e ; set -x ; for p in \
+			$$(pyversions -r ../../../debian/control) \
+			$$(py3versions -r ../../../debian/control) ; do \
+		$$p setup.py install --install-layout=deb --root=$(DESTDIR) ; \
+	done
 # Other options are (but not needed): --install-data="/$(DESTDIR)$(PYSITEDIR)" --install-script="/$(DESTDIR)$(PYSITEDIR)" --install-header=
 
 clean-local:
--- a/module/swig/python/Makefile.am
+++ b/module/swig/python/Makefile.am
@@ -9,13 +9,22 @@
 	$(SWIG) -python -o $@ ../ow.i
 
 OW.py: ow_wrap.c setup.py $(LIBOW)
+# build is done at install time, for all supported python versions
+	echo skipping \
 	CFLAGS="@LIBUSB_CFLAGS@ @LIBAVAHI_CFLAGS@" $(PYTHON) setup.py build
 
 install-data-local:
 #	OpenSUSE is buggy and install libraries at /usr/local.
 #	Need to add call "install_lib --install-dir" or call "install --install-lib"
 #	$(PYTHON) setup.py install_lib --install-dir="/$(DESTDIR)$(PYSITEDIR)"
-	$(PYTHON) setup.py install --install-lib="$(DESTDIR)$(PYSITEDIR)"
+	set -e ; set -x ; for p in \
+			$$(py3versions -r ../../../debian/control) \
+			$$(pyversions -r ../../../debian/control) ; do \
+		LDFLAGS="$$($$p-config --ldflags)" \
+		CFLAGS="$$($$p-config --cflags) @LIBUSB_CFLAGS@ @LIBAVAHI_CFLAGS@" $$p setup.py build ; \
+		$$p setup.py install --install-layout=deb --root=$(DESTDIR) ; \
+		$$p setup.py clean ; \
+	done
 # Other options are (but not needed): --install-data="/$(DESTDIR)$(PYSITEDIR)" --install-script="/$(DESTDIR)$(PYSITEDIR)" --install-header=
 
 clean-local: