%bcond_without java # Java bindings
%bcond_without ocaml # OCaml bindings
%bcond_without python # Python bindings
+%bcond_without python3 # Python 3.x bindings
%bcond_without tcl # Tcl bindings
%bcond_without x # X11-based utilities
%bcond_without gpm # mouse tracking via GPM
%bcond_with swift # Swift synthesizer driver [commercial, from Cepstral]
%bcond_with theta # Theta synthesizer driver [commercial, from Cepstral]
%bcond_with viavoice # IBM ViaVoice synthesizer driver [commercial]
-%bcond_without at_spi # AtSpi screen driver
+%bcond_with at_spi # AtSpi screen driver
%bcond_without at_spi2 # AtSpi2 screen driver
-#
-%define brlapi_ver 0.6.1
-#
+
+%define brlapi_ver 0.6.5
%include /usr/lib/rpm/macros.java
Summary: Braille display driver for Linux/Unix
Summary(pl.UTF-8): Sterownik do wyświetlaczy Braille'a
Name: brltty
-Version: 5.0
-Release: 1
-Group: Daemons
+Version: 5.4
+Release: 6
License: GPL v2+ (brltty and drivers), LGPL v2.1+ (APIs)
+Group: Daemons
Source0: http://mielke.cc/brltty/archive/%{name}-%{version}.tar.xz
-# Source0-md5: 44c71a973424658557b931f703017481
-Patch0: %{name}-format.patch
-Patch1: %{name}-java.patch
-Patch2: %{name}-speech-dispatcher.patch
-Patch3: %{name}-python.patch
+# Source0-md5: cfedd365e6237d762ad8c35b4f6fb361
+Patch1: %{name}-speech-dispatcher.patch
+Patch2: %{name}-python.patch
+Patch3: make.patch
URL: http://mielke.cc/brltty/
BuildRequires: alsa-lib-devel
%{?with_at_spi:BuildRequires: at-spi-devel}
-BuildRequires: autoconf >= 2.62
+BuildRequires: autoconf >= 2.64
BuildRequires: automake
BuildRequires: bison
+BuildRequires: rpmbuild(macros) >= 1.710
# just headers
BuildRequires: bluez-libs-devel
%{?with_at_spi2:BuildRequires: dbus-devel >= 1.0}
%{?with_ocaml:BuildRequires: ocaml}
BuildRequires: pkgconfig
%{?with_python:BuildRequires: python-Cython}
+%{?with_python3:BuildRequires: python3-Cython}
%{?with_java:BuildRequires: rpm-javaprov}
%{?with_python:BuildRequires: rpm-pythonprov}
%{?with_speech_dispatcher:BuildRequires: speech-dispatcher-devel >= 0.8}
+BuildRequires: systemd-devel
BuildRequires: tar >= 1:1.22
%{?with_tcl:BuildRequires: tcl-devel >= 8.5}
%if %{with x}
BuildRequires: xorg-lib-libXt-devel
BuildRequires: xorg-lib-libXtst-devel
%endif
-BuildRequires: xz
#%{?with_mikropuhe:BuildRequires: Mikropuhe-devel (-lmikropuhe <mpwrfile.h>)}
#%{?with_swift:BuildRequires: Swift-devel (-lswift <swift.h>)}
#%{?with_theta:BuildRequires: Theta-devel (-ltheta <theta.h>)}
#%{?with_viavoice:BuildRequires: ViaVoice-devel (-libmeci50 <eci.h>)}
+BuildRequires: xz
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Summary: BrlAPI documentation
Summary(pl.UTF-8): Documentacja BrlAPI
Group: Documentation
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
%description -n brlapi-apidocs
-Documentation for BrlAPI in HTML format generated from brltty
-sources by doxygen.
+Documentation for BrlAPI in HTML format generated from brltty sources
+by doxygen.
%description -n brlapi-apidocs -l pl.UTF-8
-Dokumentacja BrlAPI w formacie HTML generowane ze
-źrodeł brltty przez doxygen.
+Dokumentacja BrlAPI w formacie HTML generowane ze źrodeł brltty przez
+doxygen.
%package -n java-brlapi
Summary: BrlAPI library for Java
Wiązania OCamla do BrlAPI - pliki programistyczne.
%package -n python-brlapi
-Summary: Python interface to BrlAPI
-Summary(pl.UTF-8): Pythonowy interfejs do BrlAPI
+Summary: Python 2.x interface to BrlAPI
+Summary(pl.UTF-8): Interfejs Pythona 2.x do BrlAPI
License: LGPL v2.1+
Group: Libraries
Requires: brlapi = %{version}-%{release}
%description -n python-brlapi
-Python interface to BrlAPI.
+Python 2.x interface to BrlAPI.
%description -n python-brlapi -l pl.UTF-8
-Pythonowy interfejs do BrlAPI.
+Interfejs Pythona 2.x do BrlAPI.
+
+%package -n python3-brlapi
+Summary: Python 3.x interface to BrlAPI
+Summary(pl.UTF-8): Interfejs Pythona 3.x do BrlAPI
+License: LGPL v2.1+
+Group: Libraries
+Requires: brlapi = %{version}-%{release}
+
+%description -n python3-brlapi
+Python 3.x interface to BrlAPI.
+
+%description -n python3-brlapi -l pl.UTF-8
+Interfejs Pythona 3.x do BrlAPI.
%package -n brlapi-tcl
Summary: BrlAPI library for Tcl
%prep
%setup -q
-%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%{__make} -j1
-directory="doc"
-mkdir -p "$directory"
-for file in `find . \( -path "./$directory" -o -path ./Documents \) -prune -o \( -name 'README*' -o -name '*.txt' -o -name '*.html' -o -name '*.sgml' -o \( -path "./Bootdisks/*" -type f -perm +ugo=x \) \) -print`
-do
- mkdir -p "$directory/${file%/*}"
- cp -rp "$file" "$directory/$file"
-done
+%if %{with python}
+cd Bindings/Python
+%py_build
+cd ../..
+%endif
+
+%if %{with python3}
+cd Bindings/Python
+%py3_build
+cd ../..
+%endif
%install
rm -rf $RPM_BUILD_ROOT
%{__make} -j1 install \
OCAML_INSTALL_TARGET=install-without-findlib
+# findlib-specific, useless in rpm
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/dllbrlapi_stubs.so.owner
+
+%if %{with python}
+cd Bindings/Python
+%py_install
+cd ../..
+%endif
+
+%if %{with python3}
+cd Bindings/Python
+%py3_install
+cd ../..
+%endif
+
%if %{_lib} != "lib"
# Fix java plugin install path on 64-bit archs
install -d $RPM_BUILD_ROOT%{_libdir}/java
d /var/run/brltty 0755 root root -
EOF
+# no sign in source wheter it is zh_CN or zh_TW so just remove it
+%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/zh
+
%find_lang %{name}
%clean
%files -f %{name}.lang
%defattr(644,root,root,755)
%doc Documents/{Manual-BRLTTY/English/BRLTTY*,ChangeLog,HISTORY,TODO}
-%doc doc/{Bindings,Bootdisks,Drivers,Patches,Tables,README,nsistrings.txt}
%attr(755,root,root) %{_bindir}/brltty
+%attr(755,root,root) %{_bindir}/brltty-atb
%attr(755,root,root) %{_bindir}/brltty-config
%attr(755,root,root) %{_bindir}/brltty-ctb
-%attr(755,root,root) %{_bindir}/brltty-install
+%attr(755,root,root) %{_bindir}/brltty-ktb
%attr(755,root,root) %{_bindir}/brltty-trtxt
%attr(755,root,root) %{_bindir}/brltty-ttb
+%attr(755,root,root) %{_bindir}/brltty-tune
%attr(755,root,root) %{_bindir}/eutp
%attr(755,root,root) %{_bindir}/vstp
%{?with_x:%attr(755,root,root) %{_bindir}/xbrlapi}
%attr(755,root,root) %{_libdir}/brltty/libbrlttybba.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybbc.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybbd.so
+%attr(755,root,root) %{_libdir}/brltty/libbrlttybbg.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybbl.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybbm.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybbn.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybec.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybeu.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybfs.so
+%attr(755,root,root) %{_libdir}/brltty/libbrlttybhd.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybhm.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybht.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttybhw.so
%attr(755,root,root) %{_libdir}/brltty/libbrlttyxsc.so
%{_sysconfdir}/brltty
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/brltty.conf
-/usr/lib/tmpfiles.d/brltty.conf
+%{systemdtmpfilesdir}/brltty.conf
%dir /var/lib/BrlAPI
%dir /var/run/brltty
%{_mandir}/man1/brltty.1*
%files -n ocaml-brlapi
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/ocaml/stublibs/dllbrlapi_stubs.so
-%{_libdir}/ocaml/stublibs/dllbrlapi_stubs.so.owner
%files -n ocaml-brlapi-devel
%defattr(644,root,root,755)
%defattr(644,root,root,755)
%attr(755,root,root) %{py_sitedir}/brlapi.so
%{py_sitedir}/Brlapi-%{brlapi_ver}-py*.egg-info
+
+%if %{with python3}
+%files -n python3-brlapi
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/brlapi.cpython-*.so
+%{py3_sitedir}/Brlapi-%{brlapi_ver}-py*.egg-info
+%endif
%endif
%if %{with tcl}