File python-louis.spec of Package liblouis.28498
#
# spec file for package python-louis
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define build_core_not_python 0
%define build_py3 0
%if %build_py3
%define py_suffix 3
%define __python python3
%define py_requires %{nil}
%else
%define py_suffix %{nil}
%endif
Name: python-louis
%define _name liblouis
Version: 2.6.4
Release: 0
Summary: Braille Translator and Back-Translator - Python Bindings
License: LGPL-3.0-or-later
Group: Development/Languages/Python
URL: http://liblouis.org/
Source0: https://github.com/liblouis/liblouis/releases/download/v2.6.4/liblouis-2.6.4.tar.gz
# PATCH-FIX-UPSTREAM 0001-Fix-possible-out-of-bounds-write-from-a-followed-by-.patch CVE-2017-13738 CVE-2017-13744 bsc#1056088 bsc#1016105 mgorse@suse.com -- fix possible buffer underrun when reading a table with two newlines preceded by a backslash.
Patch0: 0001-Fix-possible-out-of-bounds-write-from-a-followed-by-.patch
# PATCH-FIX-UPSTREAM 0002-resolveSubtable-Fix-buffer-overflow-parsing-a-malfor.patch CVE-2017-13739 CVE-2017-13740 CVE-2017-13742 CVE-2017-13743 bsc#1056090 bsc#1056093 bsc#1056097 bsc#1056101 mgorse@suse.com -- allocate sufficient space in a buffer.
Patch1: 0002-resolveSubtable-Fix-buffer-overflow-parsing-a-malfor.patch
# PATCH-FIX-UPSTREAM 0003-Fix-possible-use-after-free-when-calling-compileBrai.patch CVE-2017-13741 bsc#1056095 mgorse@suse.com -- fix possible use after free when compiling a table.
Patch2: 0003-Fix-possible-use-after-free-when-calling-compileBrai.patch
# PATCH-FIX-UPSTREAM CVE-2018-11440.patch bsc#1095189 mgorse@suse.com -- fix another buffer overflow in table parsing.
Patch3: CVE-2018-11440.patch
# PATCH-FIX-UPSTREAM CVE-2018-11577.patch bsc#1095945 mgorse@suse.com -- fix yet another buffer overflow in the braille table parser.
Patch4: CVE-2018-11577.patch
# PATCH-FIX-UPSTREAM CVE-2018-11683.patch bsc#1095827 mgorse@suse.com -- fix yet another buffer overflow in the braille table parser.
Patch5: CVE-2018-11683.patch
# PATCH-FIX-UPSTREAM CVE-2018-11684.patch bsc#1095826 mgorse@suse.com -- fix yet another buffer overflow in the braille table parser.
Patch6: CVE-2018-11684.patch
# PATCH-FIX-UPSTREAM CVE-2018-11685.patch bsc#1095825 mgorse@suse.com -- fix yet another buffer overflow in the braille table parser.
Patch7: CVE-2018-11685.patch
# PATCH-FIX-UPSTREAM CVE-2018-12085.patch bsc#1097103 mgorse@suse.com -- check index before writing to result->chars.
Patch8: CVE-2018-12085.patch
# PATCH-FIX-UPSTREAM CVE-2018-17294.patch bsc#1109319 mgorse@suse.com -- fix a buffer overflow.
Patch9: CVE-2018-17294.patch
# PATCH-FIX-UPSTREAM liblouis-CVE-2023-26767.patch CVE-2023-26767 bsc#1209429 qzhao@suse.com -- Check the length of path before copying into dataPath.
Patch10: liblouis-CVE-2023-26767.patch
# PATCH-FIX-UPSTREAM liblouis-CVE-2023-26769.patch CVE-2023-26769 bsc#1209432 qzhao@suse.com -- Check the path length before copying into tableFile.
Patch11: liblouis-CVE-2023-26769.patch
%if %build_core_not_python
BuildRequires: pkg-config
PreReq: %install_info_prereq
BuildRequires: fdupes
%else
BuildRequires: liblouis-devel
BuildRequires: python%{py_suffix}
Requires: liblouis9 = %{version}
%py_requires
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Liblouis is an open-source braille translator and back-translator.
It features support for computer and literary braille, supports
contracted and uncontracted translation for many, many languages
and has support for hyphenation. New languages can easily be added
through tables that support a rule- or dictionary based approach.
Liblouis also supports math braille (Nemeth and Marburg). The
formatting of braille is provided by the companion project
liblouisxml.
Liblouis is based on the translation routines in the BRLTTY
screenreader for Linux. It has, however, gone far beyond these
routines. It is named in honor of Louis Braille.
Included are also tools for testing and debugging tables.
%if %build_core_not_python
%package -n liblouis9
Summary: Braille Translator and Back-Translator - Python Bindings
# We used to have a package named liblouis, until 2.4.1.
License: LGPL-3.0-or-later
Group: Development/Languages/Python
Requires: %{name}-data >= %{version}
Provides: %{name} = %{version}
Obsoletes: %{name} < %{version}
%description -n liblouis9
Liblouis is an open-source braille translator and back-translator.
It features support for computer and literary braille, supports
contracted and uncontracted translation for many, many languages
and has support for hyphenation. New languages can easily be added
through tables that support a rule- or dictionary based approach.
Liblouis also supports math braille (Nemeth and Marburg). The
formatting of braille is provided by the companion project
liblouisxml.
Liblouis is based on the translation routines in the BRLTTY
screenreader for Linux. It has, however, gone far beyond these
routines. It is named in honor of Louis Braille.
%package data
Summary: Data files for Braille Translator and Back-Translator - Python Bindings
License: LGPL-3.0-or-later
Group: Development/Languages/Python
Conflicts: liblouis2 < 2.6.4
%description data
Liblouis is an open-source braille translator and back-translator.
It features support for computer and literary braille, supports
contracted and uncontracted translation for many, many languages
and has support for hyphenation. New languages can easily be added
through tables that support a rule- or dictionary based approach.
Liblouis also supports math braille (Nemeth and Marburg). The
formatting of braille is provided by the companion project
liblouisxml.
Liblouis is based on the translation routines in the BRLTTY
screenreader for Linux. It has, however, gone far beyond these
routines. It is named in honor of Louis Braille.
This package contains data required by main package.
%package tools
Summary: Braille Translator and Back-Translator - Tools - Python Bindings
License: GPL-3.0-or-later
Group: Development/Languages/Python
%description tools
Liblouis is an open-source braille translator and back-translator.
It features support for computer and literary braille, supports
contracted and uncontracted translation for many, many languages
and has support for hyphenation. New languages can easily be added
through tables that support a rule- or dictionary based approach.
Liblouis also supports math braille (Nemeth and Marburg). The
formatting of braille is provided by the companion project
liblouisxml.
Liblouis is based on the translation routines in the BRLTTY
screenreader for Linux. It has, however, gone far beyond these
routines. It is named in honor of Louis Braille.
%package doc
Summary: Braille Translator and Back-Translator - Documentation - Python Bindings
License: LGPL-3.0-or-later
Group: Development/Languages/Python
%description doc
Liblouis is an open-source braille translator and back-translator.
It features support for computer and literary braille, supports
contracted and uncontracted translation for many, many languages
and has support for hyphenation. New languages can easily be added
through tables that support a rule- or dictionary based approach.
Liblouis also supports math braille (Nemeth and Marburg). The
formatting of braille is provided by the companion project
liblouisxml.
Liblouis is based on the translation routines in the BRLTTY
screenreader for Linux. It has, however, gone far beyond these
routines. It is named in honor of Louis Braille.
%package devel
Summary: Braille Translator and Back-Translator - Development Files - Python Bindings
License: LGPL-3.0-or-later
Group: Development/Languages/Python
Requires: liblouis9 = %{version}
%description devel
Liblouis is an open-source braille translator and back-translator.
It features support for computer and literary braille, supports
contracted and uncontracted translation for many, many languages
and has support for hyphenation. New languages can easily be added
through tables that support a rule- or dictionary based approach.
Liblouis also supports math braille (Nemeth and Marburg). The
formatting of braille is provided by the companion project
liblouisxml.
Liblouis is based on the translation routines in the BRLTTY
screenreader for Linux. It has, however, gone far beyond these
routines. It is named in honor of Louis Braille.
%endif
%prep
%setup -q -n %{_name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%build
%configure --disable-static
make %{?_smp_mflags}
%if !%build_core_not_python
pushd python
%{__python} setup.py build
popd
%endif
%install
%if %build_core_not_python
%make_install
# doc is only auto-installed when makeinfo is present
%make_install -C doc
find %{buildroot} -type f -name "*.la" -delete -print
# We'll package them as rpm docs
%{__rm} -f %{buildroot}%{_datadir}/doc/liblouis/liblouis.{html,txt}
%fdupes %{buildroot}%{_datadir}
%fdupes %{buildroot}%{_libdir}
%else
pushd python
%{__python} setup.py install --skip-build --root="%{buildroot}" --prefix="%{_prefix}"
popd
%endif
%if %build_core_not_python
%post doc
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%preun doc
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%post -n liblouis9 -p /sbin/ldconfig
%postun -n liblouis9 -p /sbin/ldconfig
%files -n liblouis9
%defattr(-, root, root)
%doc AUTHORS ChangeLog NEWS README
%license COPYING.LESSER
%{_libdir}/*.so.*
%files data
%defattr(-, root, root)
%{_datadir}/liblouis/
%files tools
%defattr(-, root, root)
%license COPYING
%{_bindir}/lou_*
%files doc
%defattr(-, root, root)
%doc doc/liblouis.html doc/liblouis.txt
%{_infodir}/%{name}.info.gz
%files devel
%defattr(-, root, root)
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/liblouis
%else
%files
%defattr(-, root, root)
%{python_sitelib}/louis*.egg-info
%{python_sitelib}/louis
%endif
%changelog