summaryrefslogtreecommitdiffstats
path: root/libreoffice-grammalecte.spec
blob: 352b174073f250568556e07017a0381ca6095dbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# remirepo/fedora spec file for libreoffice-grammalecte
#
# Copyright (c) 2016-2017 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%global   extname grammalecte
# data-only package
%global   debug_package %{nil}
# to ensure bytecompile use the right version
%global   __python %{_bindir}/python3

# NOTE: this package is not noarch because LibreOffice has no
# arch-independent extension location

Name:          libreoffice-%{extname}
Version:       0.5.16
Release:       1%{?dist}
Summary:       French grammar corrector
Summary(fr):   Correcteur grammatical Français
Group:         System Environment/Libraries

# *.py from Lightproof are MPLv2.0, extension is GPLv3 and later
License:       GPLv3+ and MPLv2.0
URL:           http://www.dicollecte.org/grammalecte/
Source0:       http://www.dicollecte.org/grammalecte/oxt/Grammalecte-v%{version}.7z
Source1:       %{name}.metainfo.xml

BuildRequires: p7zip
BuildRequires: python3-devel
BuildRequires: libappstream-glib
%if 0%{?fedora} >= 24
BuildRequires: glibc-langpack-fr
%endif

Supplements:   libreoffice-langpack-fr

Requires:      libreoffice-writer
Requires:      libreoffice-langpack-fr
Requires:      libreoffice-pyuno


%description
Grammalecte is a open source grammar corrector dedicated to French,
for Writer (LibreOffice, OpenOffice) and Firefox.
It is based on Lightproof, which was written for Hungarian.

Grammalecte is under development.

This package provides the LibreOffice Writer extension.


%description -l fr
Grammalecte est un correcteur grammatical open source dédié à la langue
française, pour Writer (LibreOffice, OpenOffice) et Firefox.
Il est dérivé de Lightproof, qui a été écrit pour le hongrois.

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.

Grammalecte est en cours de développement.

Ce paquet fournit l'extension pour LibreOffice Writer.


%prep
%setup -qcT
7za x %{SOURCE0}

for file in $(find . -name \*.py)
do
  sed -e '/#!python3/d' -e 's/\r//' -i $file
done


%build
export LANG=fr_FR.UTF-8
%{__python} ./make.py -b fr


%install
install -d -m 0755 %{buildroot}%{_libdir}/libreoffice/share/extensions/%{extname}
unzip -d %{buildroot}%{_libdir}/libreoffice/share/extensions/%{extname} _build/Grammalecte-fr-v%{version}.oxt
chmod -R +rX %{buildroot}%{_libdir}/libreoffice/share/extensions/%{extname}

DESTDIR=%{buildroot} appstream-util install %{SOURCE1}


%check
appstream-util validate-relax -v %{buildroot}%{_datadir}/appdata/%{name}.metainfo.xml

export LANG=fr_FR.UTF-8
%{__python} ./make.py -t fr



%files
%license README.txt LICENSE.*
%{_libdir}/libreoffice/share/extensions/%{extname}
%{_datadir}/appdata/%{name}.metainfo.xml


%changelog
* Thu Apr 27 2017 Remi Collet <remi@remirepo.net> - 0.5.16-1
- update to 0.5.16

* Mon Feb 13 2017 Remi Collet <remi@remirepo.net> - 0.5.15-1
- update to 0.5.15
- run upstream tests during the build
- drop patch merged upstream

* Thu Dec 29 2016 Remi Collet <remi@fedoraproject.org> - 0.5.14-5
- build from sources

* Sun Dec 25 2016 Remi Collet <remi@fedoraproject.org> - 0.5.14-4
- Add Appstream metadata

* Fri Dec 23 2016 Remi Collet <remi@fedoraproject.org> - 0.5.14-3
- add Supplements libreoffice-langpack-fr

* Fri Dec 23 2016 Remi Collet <remi@fedoraproject.org> - 0.5.14-2
- add dependencies on libreoffice-langpack-fr and libreoffice-pyuno
- enable byte compile

* Thu Dec 22 2016 Remi Collet <remi@fedoraproject.org> - 0.5.14-1
- initial package