]> git.pld-linux.org Git - packages/python-hunspell.git/blob - python-hunspell.spec
Version 0.3.1. Release 1. python3 supported.
[packages/python-hunspell.git] / python-hunspell.spec
1 #
2 # Conditional build:
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
7
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}
13 Version:        0.3.1
14 Release:        1
15 License:        GPL
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
25 %if %{with python2}
26 BuildRequires:  python-devel
27 BuildRequires:  python-distribute
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-devel
31 BuildRequires:  python3-distribute
32 BuildRequires:  python3-modules
33 %endif
34 Requires:       python-modules
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
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
42
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.
47
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
52
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
58
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.
63
64 %package apidocs
65 Summary:        %{module} API documentation
66 Summary(pl.UTF-8):      Dokumentacja API %{module}
67 Group:          Documentation
68
69 %description apidocs
70 API documentation for %{module}.
71
72 %description apidocs -l pl.UTF-8
73 Dokumentacja API %{module}.
74
75 %prep
76 %setup -q -n %{module}-%{version}
77 %patch0 -p1
78 # fix #!%{_bindir}/env python -> #!%{__python}:
79 #%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
80
81 %build
82 %if %{with python2}
83 # CC/CFLAGS is only for arch packages - remove on noarch packages
84 CC="%{__cc}" \
85 CFLAGS="%{rpmcflags}" \
86 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
87 %endif
88
89 %if %{with python3}
90 # CC/CFLAGS is only for arch packages - remove on noarch packages
91 CC="%{__cc}" \
92 CFLAGS="%{rpmcflags}" \
93 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
94 %endif
95
96 # %if %{with doc}
97 # cd docs
98 # %{__make} -j1 html
99 # rm -rf _build/html/_sources
100 # %endif
101
102 %install
103 rm -rf $RPM_BUILD_ROOT
104
105 %if %{with python2}
106 %{__python} setup.py \
107         build --build-base build-2 \
108         install --skip-build \
109         --optimize=2 \
110         --root=$RPM_BUILD_ROOT
111
112 %py_postclean
113 %endif
114
115 %if %{with python3}
116 %{__python3} setup.py \
117         build --build-base build-3 \
118         install --skip-build \
119         --optimize=2 \
120         --root=$RPM_BUILD_ROOT
121 %endif
122
123 # in case there are examples provided
124 #%if %{with python2}
125 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
126 #cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
127 #%endif
128 #%if %{with python3}
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}|'
133 #%endif
134
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}
140 #%%py_postclean
141
142 %clean
143 rm -rf $RPM_BUILD_ROOT
144
145 %if %{with python2}
146 %files
147 %defattr(644,root,root,755)
148 %doc README
149 %attr(755,root,root) %{py_sitedir}/*.so
150 %if "%{py_ver}" > "2.4"
151 %{py_sitedir}/%{module}-*.egg-info
152 %endif
153 # %{_examplesdir}/%{name}-%{version}
154 %endif
155
156 %if %{with python3}
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}
163 %endif
164
165 %if %{with doc}
166 %files apidocs
167 %defattr(644,root,root,755)
168 # %doc docs/_build/html/*
169 %endif
This page took 0.061031 seconds and 4 git commands to generate.