Blob Blame History Raw
# LibreOffice doesn't provide arch-independent extension directory, although
# Grammalecte extension is arch-independant. See also item 6 on
%global debug_package %{nil}

%global _description %{expand:Grammalecte is a grammar checker for the French language, derived from
Lightproof. Grammalecte helps writing a proper French, without distracting users
with false positives. This grammar checker follows the principle: the less false
positives, the better; if it cannot know with a good chance that a dubious
expression is wrong, it keeps silent.}
%global _description_fr %{expand:Grammalecte est un correcteur grammatical dédié à la langue française, dérivé de
Lightproof. Grammalecte essaie d'apporter une aide à l'écriture du français sans
parasiter l'attention des utilisateurs avec de fausses alertes. Ce correcteur
suit donc le principe suivant : le moins de « faux positifs » possible ; s'il
n'est pas possible de déterminer avec de fortes chances qu'une suite de mots
douteuse est erronée, le correcteur ne signalera rien.}

Name:           grammalecte
Version:        2.1.2
Release:        1%{?dist}
Summary:        French grammar checker
Summary(fr):    Correcteur grammatical dédié à la langue française

# Source code is GPLv3. Language resources in
# gc_lang/fr/oxt/Dictionnaires/dictionaries/ are:
# - MPLv2.0 for dictionaries (*.dic) and affix files (*.aff)
# - LGPLv2+ for French thesaurus (thes_fr.*) and hyphenation rules (*.tex)
# See ./gc_lang/fr/oxt/Dictionnaires/dictionaries/README*.txt
License:        GPLv3 and MPLv2.0 and LGPLv2+
Source0:        %{name}-%{version}.tar.xz
# The source for this package was pulled from upstream's VCS. Use the
# following script to generate the tarball (fossil is required):
Source1:        %{name}
Source2:        libreoffice-%{name}.metainfo.xml

BuildRequires:  libappstream-glib
BuildRequires:  python3-devel
BuildRequires:  %{py3_dist bottle}
BuildRequires:  %{py3_dist setuptools}


%description -l fr

%package -n libreoffice-%{name}
Summary:        French grammar checker for LibreOffice Writer
Summary(fr):    Correcteur grammatical dédié à la langue française pour LibreOffice Writer
Requires:       %{py3_dist grammalecte-fr}
Requires:       libreoffice-langpack-fr
Requires:       libreoffice-pyuno
Requires:       libreoffice-writer

%description -n libreoffice-%{name}

This package provides the LibreOffice Writer extension.

%description -l fr -n libreoffice-%{name}

Ce paquet fournit l'extension pour LibreOffice Writer.

%package -n python3-%{name}
Summary:        French grammar checker
Summary(fr):    Correcteur grammatical dédié à la langue française
Requires:       %{py3_dist bottle}
Provides:       %{name} = %{version}-%{release}
%py_provides python3-%{name}
BuildArch:      noarch

%description -n python3-%{name}

This package provides the command line interface, along with a server and a
Python library.

%description -l fr -n python3-%{name}

Ce paquet fournit l'interface en ligne de commande ainsi qu'un serveur et une
bibliothèque Python.


# Use system bottle library for build
ln -sf %{python3_sitelib}/ 3rd/

# Build LibreOffice extension and Python module ZIP
%{__python3} -b -d fr

# Build Python module
mkdir python/
unzip _build/Grammalecte-fr-v%{version}.zip -d python/
pushd python/
rm -rf *.egg-info

# Install LibreOffice extension
install -dm 0755 $RPM_BUILD_ROOT%{_libdir}/libreoffice/share/extensions/%{name}/
unzip _build/Grammalecte-fr-v%{version}.oxt \
    -d $RPM_BUILD_ROOT%{_libdir}/libreoffice/share/extensions/%{name}/ \
    -x "pythonpath/%{name}" \
    -x "pythonpath/%{name}/*"
# Fix permissions
find $RPM_BUILD_ROOT%{_libdir}/libreoffice/share/extensions/%{name}/ -type f | xargs chmod 0644

# Install Python module
pushd python/

# Unbundle bottle library
ln -sf %{python3_sitelib}/ $RPM_BUILD_ROOT%{python3_sitelib}/%{name}/

# Avoid code duplication accross subpackages
ln -s %{_bindir}/%{name} $RPM_BUILD_ROOT%{_libdir}/libreoffice/share/extensions/%{name}/pythonpath/
ln -s %{python3_sitelib}/%{name} $RPM_BUILD_ROOT%{_libdir}/libreoffice/share/extensions/%{name}/pythonpath/

install -Dpm 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_metainfodir}/%{name}.appdata.xml

%{__python3} ./ fr -t

pushd python/
PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitelib}/ %{__python3} test

appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_metainfodir}/%{name}.appdata.xml

%files -n libreoffice-%{name}
%doc README.txt
%license LICENSE.txt ./gc_lang/fr/oxt/Dictionnaires/dictionaries/README*.txt

%files -n python3-%{name}
%doc python/README.txt
%license python/{LICENSE.txt,}

* Sun Mar 21 2021 Mohamed El Morabity - 2.1.2-1
- Update to 2.1.2

* Thu Feb 25 2021 Mohamed El Morabity <> - 2.1.1-1
- Update to 2.1.1

* Mon Feb 15 2021 Mohamed El Morabity <> - 2.1.0-1
- Update to 2.1.0

* Tue Jan 26 2021 Fedora Release Engineering <> - 2.0.0-2
- Rebuilt for

* Fri Dec 25 2020 Mohamed El Morabity <> - 2.0.0-1
- Update to 2.0.0

* Sat Nov 28 2020 Mohamed El Morabity <> - 1.12.2-3
- Fix Python >= 3.10 detection

* Tue Oct 06 2020 Mohamed El Morabity <> - 1.12.2-2
- Add BuildRequires on python3-setuptools

* Wed Sep 02 2020 Mohamed El Morabity <> - 1.12.2-1
- Initial RPM release