]> git.pld-linux.org Git - packages/python-pyopenfst.git/blame - python-pyopenfst.spec
- release 4 (by relup.sh)
[packages/python-pyopenfst.git] / python-pyopenfst.spec
CommitLineData
be17d6f7
JB
1#
2# Conditional build:
3%bcond_without tests # unit tests
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
58f40fa5 7%define rel 4
54a6b6a9 8
be17d6f7
JB
9Summary: PyOpenFST - Python 2 bindings to OpenFTS library
10Summary(pl.UTF-8): PyOpenFST - wiązania Pythona 2 do biblioteki OpenFST
11Name: python-pyopenfst
12Version: 0.4
13%define snap 20141029
14%define gitref eb0c0f9af57bb597f9511e1cc69cbbefe50ff507
54a6b6a9 15Release: 0.%{snap}.%{rel}
be17d6f7
JB
16License: Apache v2.0
17Group: Libraries/Python
18Source0: https://github.com/tmbdev/pyopenfst/archive/%{gitref}/pyopenfst-%{snap}.tar.gz
19# Source0-md5: 39e3516a6d80cd2604d9dc76de48a9a5
20Patch0: pyopenfst-update.patch
21Patch1: pyopenfst-tests.patch
22Patch2: pyopenfst-python3.patch
23URL: https://github.com/tmbdev/pyopenfst
24BuildRequires: libstdc++-devel >= 6:4.7
25BuildRequires: openfst-devel
26BuildRequires: rpm-pythonprov
27BuildRequires: rpmbuild(macros) >= 1.714
28BuildRequires: swig-python >= 2
29%if %{with python2}
30BuildRequires: python-devel >= 2.0
31%endif
32%if %{with python3}
33BuildRequires: python3-devel >= 1:3.2
34%endif
35Requires: python-libs >= 2.0
36BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38%description
39The OpenFST library implements algorithms on weighted finite state
40transducers. The PyOpenFST project contains bindings for the library.
41
42%description -l pl.UTF-8
43Biblioteka OpenFST implementuje algorytmy na automatach skończonych z
44wyjściem i wagami. Projekt PyOpenFST zawiera wiązania Pythona do
45biblioteki.
46
47%package -n python3-pyopenfst
48Summary: PyOpenFST - Python 3 bindings to OpenFTS library
49Summary(pl.UTF-8): PyOpenFST - wiązania Pythona 3 do biblioteki OpenFST
50Group: Libraries/Python
51Requires: python3-libs >= 1:3.2
52
53%description -n python3-pyopenfst
54The OpenFST library implements algorithms on weighted finite state
55transducers. The PyOpenFST project contains bindings for the library.
56
57%description -n python3-pyopenfst -l pl.UTF-8
58Biblioteka OpenFST implementuje algorytmy na automatach skończonych z
59wyjściem i wagami. Projekt PyOpenFST zawiera wiązania Pythona do
60biblioteki.
61
62%prep
63%setup -q -n pyopenfst-%{gitref}
64%patch0 -p1
65%patch1 -p1
66%patch2 -p1
67
68%build
69# setup.py uses CFLAGS for C++; openfst requires C++11
70CFLAGS="%{rpmcxxflags} -std=c++11"
71
72%if %{with python2}
73%py_build
74
75%if %{with tests}
76PYTHONPATH=$(echo build-2/lib.*) \
77%{__python} -munittest test-openfst test-openfst0 test-openfst1
78%endif
79%endif
80
81%if %{with python3}
82%py3_build
83
84%if %{with tests}
85PYTHONPATH=$(echo build-3/lib.*) \
86%{__python3} -munittest test-*.py
87%endif
88%endif
89
90%install
91rm -rf $RPM_BUILD_ROOT
92
93%if %{with python2}
94%py_install
95%py_postclean
96%endif
97
98%if %{with python3}
99%py3_install
100%endif
101
102%if %{with python2}
103install -d $RPM_BUILD_ROOT%{_examplesdir}/python-pyopenfst-%{version}
104cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-pyopenfst-%{version}
3e045e64
JR
105%{__sed} -E -i -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python}\1,' \
106 $RPM_BUILD_ROOT%{_examplesdir}/python-pyopenfst-%{version}/*
be17d6f7
JB
107%endif
108%if %{with python3}
109install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-pyopenfst-%{version}
110cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-pyopenfst-%{version}
3e045e64
JR
111%{__sed} -E -i -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python3}\1,' \
112 $RPM_BUILD_ROOT%{_examplesdir}/python3-pyopenfst-%{version}/*
be17d6f7
JB
113%endif
114
115%clean
116rm -rf $RPM_BUILD_ROOT
117
118%if %{with python2}
119%files
120%defattr(644,root,root,755)
121%doc README.md
122%{py_sitedir}/openfst.py[co]
123%attr(755,root,root) %{py_sitedir}/_openfst.so
124%{py_sitedir}/openfst-%{version}-py*.egg-info
125%dir %{_examplesdir}/%{name}-%{version}
126%attr(755,root,root) %{_examplesdir}/%{name}-%{version}/dict2linefst
127%attr(755,root,root) %{_examplesdir}/%{name}-%{version}/lines2linefst
128%attr(755,root,root) %{_examplesdir}/%{name}-%{version}/pyfst-*
129%attr(755,root,root) %{_examplesdir}/%{name}-%{version}/test-ngraph
130%attr(755,root,root) %{_examplesdir}/%{name}-%{version}/text2ngraphfst
131%attr(755,root,root) %{_examplesdir}/%{name}-%{version}/wdict2wordfst
132%{_examplesdir}/%{name}-%{version}/dict-*
133%endif
134
135%if %{with python3}
136%files -n python3-pyopenfst
137%defattr(644,root,root,755)
138%doc README.md
139%{py3_sitedir}/openfst.py
140%attr(755,root,root) %{py3_sitedir}/_openfst.cpython-*.so
141%{py3_sitedir}/__pycache__/openfst.cpython-*.py[co]
142%{py3_sitedir}/openfst-%{version}-py*.egg-info
143%dir %{_examplesdir}/python3-pyopenfst-%{version}
144%attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/dict2linefst
145%attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/lines2linefst
146%attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/pyfst-*
147%attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/test-ngraph
148%attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/text2ngraphfst
149%attr(755,root,root) %{_examplesdir}/python3-pyopenfst-%{version}/wdict2wordfst
150%{_examplesdir}/python3-pyopenfst-%{version}/dict-*
151%endif
This page took 0.184407 seconds and 4 git commands to generate.