File liblouis.spec of Package liblouis

#
# spec file for package liblouis
#
# Copyright (c) 2016 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
# 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 http://bugs.opensuse.org/
#


%define         build_core_not_python 1
%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:           liblouis
%define _name   liblouis
Version:        2.6.4
Release:        0
Summary:        Braille Translator and Back-Translator
License:        LGPL-3.0+
Group:          Productivity/Other
Url:            http://liblouis.org/
Source0:        https://github.com/liblouis/liblouis/releases/download/v2.6.4/liblouis-2.6.4.tar.gz
%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
License:        LGPL-3.0+
Group:          System/Libraries
# We used to have a package named liblouis, until 2.4.1.
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
License:        LGPL-3.0+
Group:          System/Libraries
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
License:        GPL-3.0+
Group:          Productivity/Other

%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
License:        LGPL-3.0+
Group:          Documentation/Other

%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
License:        LGPL-3.0+
Group:          Development/Libraries/C and C++
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}

%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 COPYING.LESSER NEWS README
%{_libdir}/*.so.*

%files data
%defattr(-, root, root)
%{_datadir}/liblouis/

%files tools
%defattr(-, root, root)
%doc 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
openSUSE Build Service is sponsored by