Hello community,

here is the log from the commit of package sbl for openSUSE:Factory checked in 
at 2017-12-04 12:15:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sbl (Old)
 and      /work/SRC/openSUSE:Factory/.sbl.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "sbl"

Mon Dec  4 12:15:43 2017 rev:42 rq:548022 version:3.5.0.20130317.git7a75bc29

Changes:
--------
--- /work/SRC/openSUSE:Factory/sbl/sbl.changes  2016-12-16 11:53:44.172862829 
+0100
+++ /work/SRC/openSUSE:Factory/.sbl.new/sbl.changes     2017-12-04 
12:15:47.617859346 +0100
@@ -1,0 +2,9 @@
+Sat Dec  2 10:41:38 UTC 2017 - [email protected]
+
+- Migrate orca plugin to python3: orca has been a python3
+  application since version 3.7, released in 2013:
+  + Add python3-base BuildRequires.
+  + Add sbl-orca-python3.patch: convert brlapi.py and
+    python/Makefile to python3.
+
+-------------------------------------------------------------------

New:
----
  sbl-orca-python3.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sbl.spec ++++++
--- /var/tmp/diff_new_pack.6MiPpf/_old  2017-12-04 12:15:48.377831753 +0100
+++ /var/tmp/diff_new_pack.6MiPpf/_new  2017-12-04 12:15:48.381831608 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package sbl
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -31,10 +31,12 @@
 Patch4:         sbl-libdir.patch
 Patch5:         sbl-init-scripts.patch
 Patch6:         sbl-sppkdev.patch
+Patch7:         sbl-orca-python3.patch
 BuildRequires:  bluez-devel
 BuildRequires:  gcc-c++
 BuildRequires:  libusb-devel
 BuildRequires:  orca
+BuildRequires:  python3-base
 BuildRequires:  speechd-devel
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %if 0%{?suse_version} > 1310
@@ -57,7 +59,6 @@
 License:        GPL-2.0 and GPL-2.0+
 Group:          Productivity/Multimedia/Sound/Utilities
 Requires:       orca
-%py_requires
 
 %description orca
 this python module enables orca to use brld for braille output
@@ -72,6 +73,7 @@
 %endif
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 %build
 make %{?_smp_mflags} CFLAGS="%{optflags} -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE" 
LIB_CFLAGS="%{optflags} -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -fPIC 
-I%{_includedir}/speech-dispatcher"
@@ -147,7 +149,7 @@
 
 %files orca
 %defattr (-,root,root,755)
-%dir %{python_sitearch}/orca
-%{python_sitearch}/orca/brlapi.py*
+%dir %{python3_sitearch}/orca
+%{python3_sitearch}/orca/brlapi.py*
 
 %changelog

++++++ sbl-orca-python3.patch ++++++
Index: sbl-3.5.0.20130317.git7a75bc29/python/Makefile
===================================================================
--- sbl-3.5.0.20130317.git7a75bc29.orig/python/Makefile
+++ sbl-3.5.0.20130317.git7a75bc29/python/Makefile
@@ -2,12 +2,11 @@
 ### Author: Marco Skambraks <[email protected]>
 include ../make.config
 
-PYVER=$(shell python --version 2>&1|cut -c 8-|cut -c 1-3)
-ORCA_DIR=$(DESTDIR)$(LIBDIR)/python$(PYVER)/site-packages/orca
+ORCA_DIR=$(DESTDIR)$(shell python3 -c "import site; 
print(site.getsitepackages()[0])")/orca
 
 all: brlapi.py
        @echo -n Generating byte code... 
-       @python -c 'import brlapi' && echo ok || @echo failed
+       @python3 -c 'import brlapi' && echo ok || @echo failed
 
 clean:
        rm -f *~ xyz jj.jj *.pyc
@@ -15,7 +14,7 @@ clean:
 install: all
        @if [ -d $(ORCA_DIR) ] || [ ! -z "$(DESTDIR)" ]; then \
             install --directory $(ORCA_DIR) ; \
-            install -m 644 brlapi.py brlapi.pyc $(ORCA_DIR) ; \
+            install -m 644 brlapi.py* $(ORCA_DIR) ; \
        else \
             echo please make sure that orca is installed in: ; \
             echo $(ORCA_DIR) ; \
Index: sbl-3.5.0.20130317.git7a75bc29/python/brlapi.py
===================================================================
--- sbl-3.5.0.20130317.git7a75bc29.orig/python/brlapi.py
+++ sbl-3.5.0.20130317.git7a75bc29/python/brlapi.py
@@ -42,7 +42,7 @@ class getconf:
         try:
             conffile = open("/etc/sbl.conf",'r')
         except:
-            print "cannot open /etc/sbl.conf"
+            print("cannot open /etc/sbl.conf")
             return None
 
         for i in conffile.readlines():
@@ -99,7 +99,7 @@ class getconf:
             try:
                 kmfile = open("/etc/sbl/keymap/" + brlname + ".map", 'r')
             except:
-                print "no keymap found for ", brlname
+                print("no keymap found for ", brlname)
                 return False
 
         for i in kmfile.readlines():
@@ -167,32 +167,32 @@ class Connection:
             if self.brld == None:
                 self.brld = CDLL("libbrld.so.1")
         except:
-            print "cannot open libbrld.so.1"
+            print("cannot open libbrld.so.1")
             return None
 
         self.conf = getconf()
         self.fileDescriptor = self.brld.brld_open("localhost", 
self.conf.brldport())
 
         if self.fileDescriptor < 0:
-            print "brld: connection failed"
+            print("brld: connection failed")
             raise IoError
 
         tmpstr = create_string_buffer('\000' * 128)
         tmpstr.value = self.conf.brldauth()
         if self.brld.brld_reg(2, tmpstr.value) < 0:
-            print "brld: reg failed"
+            print("brld: reg failed")
         else:
             if self.brld.brld_seteventmode() <0:
-                print "brld: eventmode setfailed"
+                print("brld: eventmode setfailed")
                 return None
 
             if self.brld.brld_getxy(byref(self.x),byref(self.y)) <0:
-                print "brld: error getting Displaysize"
+                print("brld: error getting Displaysize")
                 return None
                 
             self.displaySize = (self.x.value, self.y.value)
             if self.brld.brld_getalias(byref(tmpstr)) <0:
-                print "brld: error getting brlname"
+                print("brld: error getting brlname")
                 return None
             self.brlname = tmpstr.value
             self.conf.loadkeymap(self.brlname)
@@ -208,7 +208,7 @@ class Connection:
         s.value = text.decode("UTF-8").encode("iso8859-1")
         
         if self.brld.brld_write(cursor, s, "") <0:
-            print "brld: writeText error"
+            print("brld: writeText error")
             return False
         
         return True
@@ -220,7 +220,7 @@ class Connection:
 
         len_diff = 0
         add_spaces = ""
-        s.value = writestruct.text.replace(u"\u2022", "*").encode("iso8859-1")
+        s.value = writestruct.text.replace("\u2022", "*").encode("iso8859-1")
         if len(writestruct.attrOr) < len(writestruct.text):
             len_diff = len(writestruct.text) - len(writestruct.attrOr)
             add_spaces = ' ' * len_diff
@@ -228,8 +228,8 @@ class Connection:
         a.value = writestruct.attrOr.replace('\x00',' ') + add_spaces
 
         if self.brld.brld_write(writestruct.cursor-1, s.value, a.value) <0:
-            print "brld: write err"
-            print "brlline= ", writestruct.text
+            print("brld: write err")
+            print("brlline= ", writestruct.text)
             return False
 
         return True
@@ -239,7 +239,7 @@ class Connection:
         pressed = c_int()
         key = self.brld.brld_getkey(byref(pressed))
         if key == -4:
-            print "brld: getkey no connection"
+            print("brld: getkey no connection")
             raise IoError
 
         if key <= 0:
@@ -319,8 +319,8 @@ class Connection:
         return True
 
     def enterTtyMode(self, tty=7, driver=None):
-        print "brld: enterTtyMode"
-        print tty, driver
+        print("brld: enterTtyMode")
+        print(tty, driver)
 
 
     def leaveTtyMode(self):

Reply via email to