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_with 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#md5=a228fbbedad209fb7691abe6d46add53
19 # Source0-md5: a228fbbedad209fb7691abe6d46add53
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
29 BuildRequires: python-devel
30 BuildRequires: python-distribute
33 BuildRequires: python3-devel
34 BuildRequires: python3-distribute
35 BuildRequires: python3-modules
37 Requires: python-modules
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 Pyhunspell is a set of Python bindings for the Hunspell spellchecker
42 engine. It lets developers load Hunspell dictionaries, check words,
43 get suggestions, add new words, etc. It also provides some basic
44 morphological analysis related methods
46 %description -l pl.UTF-8
47 Moduł interfejsu do słownika Hunspell. Pozwala załadować słowniki,
48 sprawdzać pisownie, uzyskać sugestie, dodawać słowa itp. Daje dostęp
49 do podstawowywch metod analizy morfologicznej.
51 %package -n python3-%{module}
52 Summary: Pyhunspell is a set of Python bindings for the Hunspell spellchecker engine
53 Summary(pl.UTF-8): Moduł interfejsu do słownika Hunspell
54 Group: Libraries/Python
56 %description -n python3-%{module}
58 %description -n python3-%{module} -l pl.UTF-8
61 Summary: %{module} API documentation
62 Summary(pl.UTF-8): Dokumentacja API %{module}
66 API documentation for %{module}.
68 %description apidocs -l pl.UTF-8
69 Dokumentacja API %{module}.
72 %setup -q -n %{module}-%{version}
74 # fix #!%{_bindir}/env python -> #!%{_bindir}/python:
75 #%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
79 # CC/CFLAGS is only for arch packages - remove on noarch packages
81 CFLAGS="%{rpmcflags}" \
82 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
86 # CC/CFLAGS is only for arch packages - remove on noarch packages
88 CFLAGS="%{rpmcflags}" \
89 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
95 # rm -rf _build/html/_sources
99 rm -rf $RPM_BUILD_ROOT
102 %{__python} setup.py \
103 build --build-base build-2 \
104 install --skip-build \
106 --root=$RPM_BUILD_ROOT
112 %{__python3} setup.py \
113 build --build-base build-3 \
114 install --skip-build \
116 --root=$RPM_BUILD_ROOT
119 # in case there are examples provided
121 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
122 #cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
125 #install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
126 #cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
127 #find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
128 # | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
131 # when files are installed in other way that standard 'setup.py
132 # they need to be (re-)compiled
133 ## change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
134 #%%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
135 #%%py_comp $RPM_BUILD_ROOT%{py_sitedir}
139 rm -rf $RPM_BUILD_ROOT
143 %defattr(644,root,root,755)
145 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
146 # %{py_sitedir}/*.py[co]
147 %attr(755,root,root) %{py_sitedir}/*.so
148 %if "%{py_ver}" > "2.4"
149 %{py_sitedir}/%{module}-*.egg-info
151 # %{_examplesdir}/%{name}-%{version}
155 %files -n python3-%{module}
156 %defattr(644,root,root,755)
157 %doc AUTHORS CHANGES LICENSE
158 %{py3_sitescriptdir}/%{module}
159 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
160 # %{_examplesdir}/python3-%{module}-%{version}
165 %defattr(644,root,root,755)
166 # %doc docs/_build/html/*