3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
9 Summary: PyOpenFST - Python 2 bindings to OpenFTS library
10 Summary(pl.UTF-8): PyOpenFST - wiązania Pythona 2 do biblioteki OpenFST
11 Name: python-pyopenfst
14 %define gitref eb0c0f9af57bb597f9511e1cc69cbbefe50ff507
15 Release: 0.%{snap}.%{rel}
17 Group: Libraries/Python
18 Source0: https://github.com/tmbdev/pyopenfst/archive/%{gitref}/pyopenfst-%{snap}.tar.gz
19 # Source0-md5: 39e3516a6d80cd2604d9dc76de48a9a5
20 Patch0: pyopenfst-update.patch
21 Patch1: pyopenfst-tests.patch
22 Patch2: pyopenfst-python3.patch
23 URL: https://github.com/tmbdev/pyopenfst
24 BuildRequires: libstdc++-devel >= 6:4.7
25 BuildRequires: openfst-devel
26 BuildRequires: rpm-pythonprov
27 BuildRequires: rpmbuild(macros) >= 1.714
28 BuildRequires: swig-python >= 2
30 BuildRequires: python-devel >= 2.0
33 BuildRequires: python3-devel >= 1:3.2
35 Requires: python-libs >= 2.0
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 The OpenFST library implements algorithms on weighted finite state
40 transducers. The PyOpenFST project contains bindings for the library.
42 %description -l pl.UTF-8
43 Biblioteka OpenFST implementuje algorytmy na automatach skończonych z
44 wyjściem i wagami. Projekt PyOpenFST zawiera wiązania Pythona do
47 %package -n python3-pyopenfst
48 Summary: PyOpenFST - Python 3 bindings to OpenFTS library
49 Summary(pl.UTF-8): PyOpenFST - wiązania Pythona 3 do biblioteki OpenFST
50 Group: Libraries/Python
51 Requires: python3-libs >= 1:3.2
53 %description -n python3-pyopenfst
54 The OpenFST library implements algorithms on weighted finite state
55 transducers. The PyOpenFST project contains bindings for the library.
57 %description -n python3-pyopenfst -l pl.UTF-8
58 Biblioteka OpenFST implementuje algorytmy na automatach skończonych z
59 wyjściem i wagami. Projekt PyOpenFST zawiera wiązania Pythona do
63 %setup -q -n pyopenfst-%{gitref}
69 # setup.py uses CFLAGS for C++; openfst requires C++11
70 CFLAGS="%{rpmcxxflags} -std=c++11"
76 PYTHONPATH=$(echo build-2/lib.*) \
77 %{__python} -munittest test-openfst test-openfst0 test-openfst1
85 PYTHONPATH=$(echo build-3/lib.*) \
86 %{__python3} -munittest test-*.py
91 rm -rf $RPM_BUILD_ROOT
103 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-pyopenfst-%{version}
104 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-pyopenfst-%{version}
107 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-pyopenfst-%{version}
108 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-pyopenfst-%{version}
112 rm -rf $RPM_BUILD_ROOT
116 %defattr(644,root,root,755)
118 %{py_sitedir}/openfst.py[co]
119 %attr(755,root,root) %{py_sitedir}/_openfst.so
120 %{py_sitedir}/openfst-%{version}-py*.egg-info
121 %dir %{_examplesdir}/%{name}-%{version}
122 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/dict2linefst
123 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/lines2linefst
124 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/pyfst-*
125 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/test-ngraph
126 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/text2ngraphfst
127 %attr(755,root,root) %{_examplesdir}/%{name}-%{version}/wdict2wordfst
128 %{_examplesdir}/%{name}-%{version}/dict-*
132 %files -n python3-pyopenfst
133 %defattr(644,root,root,755)
135 %{py3_sitedir}/openfst.py
136 %attr(755,root,root) %{py3_sitedir}/_openfst.cpython-*.so
137 %{py3_sitedir}/__pycache__/openfst.cpython-*.py[co]
138 %{py3_sitedir}/openfst-%{version}-py*.egg-info
139 %dir %{_examplesdir}/python3-pyopenfst-%{version}
140 %attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/dict2linefst
141 %attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/lines2linefst
142 %attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/pyfst-*
143 %attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/test-ngraph
144 %attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/text2ngraphfst
145 %attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/wdict2wordfst
146 %{_examplesdir}/python3-pyopenfst-%{version}/dict-*