]>
Commit | Line | Data |
---|---|---|
fee79ac8 JB |
1 | # |
2 | # Conditional build: | |
8fe469ce | 3 | %bcond_without python3 # Python 3 binding |
f19640b3 | 4 | %bcond_without readline # readline in interactive programs |
fee79ac8 | 5 | # |
ca7f1440 JB |
6 | Summary: Helsinki Finite-State Transducer (library and application suite) |
7 | Summary(pl.UTF-8): Helsinki Finite-State Transducer (biblioteka i zestaw aplikacji) | |
8 | Name: hfst | |
8fe469ce | 9 | Version: 3.9.0 |
5f76d0fc | 10 | Release: 2 |
fee79ac8 | 11 | License: GPL v3 |
ca7f1440 JB |
12 | Group: Applications/Text |
13 | Source0: http://downloads.sourceforge.net/hfst/%{name}-%{version}.tar.gz | |
8fe469ce | 14 | # Source0-md5: b1fb133e5ef27bb059bb15cdd558f17d |
fee79ac8 | 15 | Patch0: %{name}-pc.patch |
ca7f1440 | 16 | URL: http://www.ling.helsinki.fi/kieliteknologia/tutkimus/hfst/ |
8fe469ce JB |
17 | # bundled library is used |
18 | #BuildRequires: SFST-devel | |
fee79ac8 JB |
19 | BuildRequires: autoconf >= 2.62 |
20 | BuildRequires: automake >= 1:1.11 | |
ca7f1440 JB |
21 | BuildRequires: bison |
22 | BuildRequires: flex >= 2.5.35 | |
f19640b3 | 23 | BuildRequires: glib2-devel >= 1:2.16 |
ca7f1440 | 24 | BuildRequires: libstdc++-devel |
f19640b3 | 25 | BuildRequires: libtool >= 2:2.2 |
8fe469ce | 26 | # disabled in sources |
f19640b3 JB |
27 | #BuildRequires: libxml2-devel >= 2 |
28 | BuildRequires: ncurses-devel | |
8fe469ce JB |
29 | # bundled library is used |
30 | #BuildRequires: openfst-devel | |
f19640b3 | 31 | BuildRequires: pkgconfig >= 1:0.14 |
8fe469ce JB |
32 | BuildRequires: python >= 1:2.4 |
33 | %{?with_python3:BuildRequires: python3 >= 1:3.2} | |
f19640b3 | 34 | %{?with_readline:BuildRequires: readline-devel} |
8fe469ce JB |
35 | BuildRequires: rpm-pythonprov |
36 | BuildRequires: rpmbuild(macros) >= 1.714 | |
37 | %{?with_python3:BuildRequires: swig-python} | |
d788e1f5 | 38 | BuildRequires: zlib-devel |
f19640b3 | 39 | Requires: glib2 >= 1:2.16 |
ca7f1440 JB |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
41 | ||
42 | %description | |
43 | The Helsinki Finite-State Transducer software is intended for the | |
44 | implementation of morphological analysers and other tools which are | |
45 | based on weighted and unweigted finite-state transducer technology. | |
46 | ||
47 | %description -l pl.UTF-8 | |
48 | Pakiet HFST (Helsinki Finite-State Transducer) to oprogramowanie | |
49 | służące do implementacji analizatorów morfologicznych i innych | |
50 | narzędzi opartych na technice przetwarzania ze skończoną liczbą | |
51 | stanów z wagami lub bez. | |
52 | ||
8fe469ce JB |
53 | %package tagger |
54 | Summary: HFST Tagger scripts | |
55 | Summary(pl.UTF-8): Skrypty HFST Tagger | |
56 | Group: Applications/Text | |
57 | Requires: %{name} = %{version}-%{release} | |
58 | ||
59 | %description tagger | |
60 | HFST Tagger scripts written in Python. | |
61 | ||
62 | %description tagger -l pl.UTF-8 | |
63 | Skrypty HFST Tagger napisane w Pythonie. | |
64 | ||
ca7f1440 JB |
65 | %package devel |
66 | Summary: Header files for HFST library | |
67 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki HFST | |
68 | Group: Development/Libraries | |
69 | Requires: %{name} = %{version}-%{release} | |
8fe469ce | 70 | #Requires: SFST-devel |
f19640b3 | 71 | Requires: glib2-devel >= 1:2.16 |
ca7f1440 | 72 | Requires: libstdc++-devel |
8fe469ce JB |
73 | #Requires: openfst-devel |
74 | Requires: readline-devel | |
ca7f1440 JB |
75 | |
76 | %description devel | |
77 | Header files for HFST library. | |
78 | ||
79 | %description devel -l pl.UTF-8 | |
80 | Pliki nagłówkowe biblioteki HFST. | |
81 | ||
82 | %package static | |
83 | Summary: Static HFST library | |
84 | Summary(pl.UTF-8): Statyczna biblioteka HFST | |
85 | Group: Development/Libraries | |
86 | Requires: %{name}-devel = %{version}-%{release} | |
87 | ||
88 | %description static | |
89 | Static HFST library. | |
90 | ||
91 | %description static -l pl.UTF-8 | |
92 | Statyczna biblioteka HFST. | |
93 | ||
8fe469ce JB |
94 | %package -n python3-hfst |
95 | Summary: Python 3 binding for HFST library | |
96 | Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki HFST | |
97 | Group: Libraries/Python | |
98 | Requires: %{name} = %{version}-%{release} | |
99 | ||
100 | %description -n python3-hfst | |
101 | Python 3 binding for HFST library. | |
102 | ||
103 | %description -n python3-hfst -l pl.UTF-8 | |
104 | Wiązanie Pythona 3 do biblioteki HFST. | |
105 | ||
ca7f1440 JB |
106 | %prep |
107 | %setup -q | |
108 | %patch0 -p1 | |
ca7f1440 JB |
109 | |
110 | %build | |
ca7f1440 JB |
111 | %{__libtoolize} |
112 | %{__aclocal} | |
113 | %{__autoconf} | |
114 | %{__autoheader} | |
115 | %{__automake} | |
ca7f1440 | 116 | %configure \ |
8fe469ce JB |
117 | --enable-calculate \ |
118 | --enable-foma-wrapper \ | |
942c090f | 119 | --enable-lexc \ |
8fe469ce | 120 | --enable-lexc-wrapper \ |
5f76d0fc | 121 | --enable-proc \ |
fee79ac8 | 122 | --disable-silent-rules \ |
8fe469ce JB |
123 | --enable-tagger \ |
124 | --enable-xfst \ | |
f19640b3 | 125 | %{?with_readline:--with-readline} \ |
9d1cebdc | 126 | --with-unicode-handler=glib |
ca7f1440 | 127 | |
575da813 JB |
128 | # parallel build is broken with foma backend |
129 | %{__make} -j1 | |
ca7f1440 | 130 | |
8fe469ce JB |
131 | %if %{with python3} |
132 | cd python | |
133 | %py3_build | |
134 | %endif | |
135 | ||
ca7f1440 JB |
136 | %install |
137 | rm -rf $RPM_BUILD_ROOT | |
8fe469ce | 138 | install -d $RPM_BUILD_ROOT%{_bindir} |
ca7f1440 JB |
139 | |
140 | %{__make} install \ | |
141 | DESTDIR=$RPM_BUILD_ROOT | |
142 | ||
8fe469ce | 143 | %py_postclean |
fee79ac8 JB |
144 | # obsoleted by pkgconfig |
145 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libhfst.la | |
146 | ||
7cf9be20 JB |
147 | # for transducer data |
148 | install -d $RPM_BUILD_ROOT%{_datadir}/hfst | |
149 | ||
8fe469ce JB |
150 | %if %{with python3} |
151 | cd python | |
152 | %py3_install | |
153 | %endif | |
154 | ||
ca7f1440 JB |
155 | %clean |
156 | rm -rf $RPM_BUILD_ROOT | |
157 | ||
158 | %post -p /sbin/ldconfig | |
159 | %postun -p /sbin/ldconfig | |
160 | ||
161 | %files | |
162 | %defattr(644,root,root,755) | |
01963880 | 163 | %doc AUTHORS NEWS README THANKS |
ca7f1440 | 164 | %attr(755,root,root) %{_bindir}/hfst-* |
9d1cebdc | 165 | %attr(755,root,root) %{_bindir}/hfst_foma |
ca7f1440 | 166 | %attr(755,root,root) %{_bindir}/htwolcpre* |
ca7f1440 | 167 | %attr(755,root,root) %{_libdir}/libhfst.so.*.*.* |
8fe469ce | 168 | %attr(755,root,root) %ghost %{_libdir}/libhfst.so.42 |
7cf9be20 | 169 | %dir %{_datadir}/hfst |
ca7f1440 | 170 | %{_mandir}/man1/hfst-*.1* |
8fe469ce JB |
171 | %{_mandir}/man1/htwolcpre?.1* |
172 | ||
173 | %files tagger | |
174 | %defattr(644,root,root,755) | |
175 | %attr(755,root,root) %{_bindir}/hfst_tagger_compute_data_statistics.py | |
176 | %{py_sitescriptdir}/hfst_tagger_compute_data_statistics.py[co] | |
177 | %{py_sitescriptdir}/tagger_aux.py[co] | |
178 | %{_mandir}/man1/hfst_tagger_compute_data_statistics.py.1* | |
ca7f1440 JB |
179 | |
180 | %files devel | |
181 | %defattr(644,root,root,755) | |
182 | %attr(755,root,root) %{_libdir}/libhfst.so | |
fee79ac8 | 183 | %{_includedir}/hfst |
d788e1f5 | 184 | %{_aclocaldir}/hfst.m4 |
ca7f1440 JB |
185 | %{_pkgconfigdir}/hfst.pc |
186 | ||
187 | %files static | |
188 | %defattr(644,root,root,755) | |
189 | %{_libdir}/libhfst.a | |
8fe469ce JB |
190 | |
191 | %if %{with python3} | |
192 | %files -n python3-hfst | |
193 | %defattr(644,root,root,755) | |
194 | %attr(755,root,root) %{py3_sitedir}/_libhfst.cpython-*.so | |
195 | %{py3_sitedir}/libhfst.py | |
196 | %{py3_sitedir}/__pycache__/libhfst.cpython-*.py[co] | |
197 | %{py3_sitedir}/libhfst_swig-%{version}_beta-py*.egg-info | |
198 | %endif |