3 %bcond_with doc # don't build doc
4 %bcond_with tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define module hunspell
9 Summary: Pyhunspell is a set of Python bindings for the Hunspell spellchecker engine
10 Summary(pl.UTF-8): Moduł interfejsu do słownika Hunspell
11 # Name must match the python module/package name (as in 'import' statement)
12 Name: python-%{module}
16 Group: Libraries/Python
17 # https://pypi.python.org/packages/source/h/hunspell/hunspell-0.2.1.tar.gz#md5=a228fbbedad209fb7691abe6d46add53
18 Source0: https://pypi.python.org/packages/source/h/hunspell/hunspell-%{version}.tar.gz
19 # Source0-md5: 85d57a3bc056e3b302141c37378bfdf1
20 Patch0: %{name}-lib_fix.patch
21 URL: http://github.com/blatinier/pyhunspell
22 BuildRequires: hunspell-devel
23 BuildRequires: rpm-pythonprov
24 BuildRequires: rpmbuild(macros) >= 1.219
26 BuildRequires: python-devel
27 BuildRequires: python-distribute
30 BuildRequires: python3-devel
31 BuildRequires: python3-distribute
32 BuildRequires: python3-modules
34 Requires: python-modules
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Pyhunspell is a set of Python bindings for the Hunspell spellchecker
39 engine. It lets developers load Hunspell dictionaries, check words,
40 get suggestions, add new words, etc. It also provides some basic
41 morphological analysis related methods
43 %description -l pl.UTF-8
44 Moduł interfejsu do słownika Hunspell. Pozwala załadować słowniki,
45 sprawdzać pisownie, uzyskać sugestie, dodawać słowa itp. Daje dostęp
46 do podstawowywch metod analizy morfologicznej.
48 %package -n python3-%{module}
49 Summary: Pyhunspell is a set of Python bindings for the Hunspell spellchecker engine
50 Summary(pl.UTF-8): Moduł interfejsu do słownika Hunspell
51 Group: Libraries/Python
53 %description -n python3-%{module}
54 Pyhunspell is a set of Python bindings for the Hunspell spellchecker
55 engine. It lets developers load Hunspell dictionaries, check words,
56 get suggestions, add new words, etc. It also provides some basic
57 morphological analysis related methods
59 %description -n python3-%{module} -l pl.UTF-8
60 Moduł interfejsu do słownika Hunspell. Pozwala załadować słowniki,
61 sprawdzać pisownie, uzyskać sugestie, dodawać słowa itp. Daje dostęp
62 do podstawowywch metod analizy morfologicznej.
65 Summary: %{module} API documentation
66 Summary(pl.UTF-8): Dokumentacja API %{module}
70 API documentation for %{module}.
72 %description apidocs -l pl.UTF-8
73 Dokumentacja API %{module}.
76 %setup -q -n %{module}-%{version}
78 # fix #!%{_bindir}/env python -> #!%{__python}:
79 #%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
83 # CC/CFLAGS is only for arch packages - remove on noarch packages
85 CFLAGS="%{rpmcflags}" \
86 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
90 # CC/CFLAGS is only for arch packages - remove on noarch packages
92 CFLAGS="%{rpmcflags}" \
93 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
99 # rm -rf _build/html/_sources
103 rm -rf $RPM_BUILD_ROOT
106 %{__python} setup.py \
107 build --build-base build-2 \
108 install --skip-build \
110 --root=$RPM_BUILD_ROOT
116 %{__python3} setup.py \
117 build --build-base build-3 \
118 install --skip-build \
120 --root=$RPM_BUILD_ROOT
123 # in case there are examples provided
125 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
126 #cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
129 #install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
130 #cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
131 #find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
132 # | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
135 # when files are installed in other way that standard 'setup.py
136 # they need to be (re-)compiled
137 ## change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
138 #%%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
139 #%%py_comp $RPM_BUILD_ROOT%{py_sitedir}
143 rm -rf $RPM_BUILD_ROOT
147 %defattr(644,root,root,755)
149 %attr(755,root,root) %{py_sitedir}/*.so
150 %if "%{py_ver}" > "2.4"
151 %{py_sitedir}/%{module}-*.egg-info
153 # %{_examplesdir}/%{name}-%{version}
157 %files -n python3-%{module}
158 %defattr(644,root,root,755)
159 #%%doc AUTHORS CHANGES LICENSE
160 %attr(755,root,root) %{py3_sitedir}/*.so
161 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
162 # %{_examplesdir}/python3-%{module}-%{version}
167 %defattr(644,root,root,755)
168 # %doc docs/_build/html/*