]> git.pld-linux.org Git - packages/python-hunspell.git/blob - python-hunspell.spec
Killed #md5= part in Source.
[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_with     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.2.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:  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
25
26
27
28 %if %{with python2}
29 BuildRequires:  python-devel
30 BuildRequires:  python-distribute
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-devel
34 BuildRequires:  python3-distribute
35 BuildRequires:  python3-modules
36 %endif
37 Requires:       python-modules
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
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
45
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.
50
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
55
56 %description -n python3-%{module}
57
58 %description -n python3-%{module} -l pl.UTF-8
59
60 %package apidocs
61 Summary:        %{module} API documentation
62 Summary(pl.UTF-8):      Dokumentacja API %{module}
63 Group:          Documentation
64
65 %description apidocs
66 API documentation for %{module}.
67
68 %description apidocs -l pl.UTF-8
69 Dokumentacja API %{module}.
70
71 %prep
72 %setup -q -n %{module}-%{version}
73 %patch0 -p1
74 # fix #!%{_bindir}/env python -> #!%{_bindir}/python:
75 #%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
76
77 %build
78 %if %{with python2}
79 # CC/CFLAGS is only for arch packages - remove on noarch packages
80 CC="%{__cc}" \
81 CFLAGS="%{rpmcflags}" \
82 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
83 %endif
84
85 %if %{with python3}
86 # CC/CFLAGS is only for arch packages - remove on noarch packages
87 CC="%{__cc}" \
88 CFLAGS="%{rpmcflags}" \
89 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
90 %endif
91
92 # %if %{with doc}
93 # cd docs
94 # %{__make} -j1 html
95 # rm -rf _build/html/_sources
96 # %endif
97
98 %install
99 rm -rf $RPM_BUILD_ROOT
100
101 %if %{with python2}
102 %{__python} setup.py \
103         build --build-base build-2 \
104         install --skip-build \
105         --optimize=2 \
106         --root=$RPM_BUILD_ROOT
107
108 %py_postclean
109 %endif
110
111 %if %{with python3}
112 %{__python3} setup.py \
113         build --build-base build-3 \
114         install --skip-build \
115         --optimize=2 \
116         --root=$RPM_BUILD_ROOT
117 %endif
118
119 # in case there are examples provided
120 #%if %{with python2}
121 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
122 #cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
123 #%endif
124 #%if %{with python3}
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}|'
129 #%endif
130
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}
136 #%%py_postclean
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141 %if %{with python2}
142 %files
143 %defattr(644,root,root,755)
144 %doc README
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
150 %endif
151 # %{_examplesdir}/%{name}-%{version}
152 %endif
153
154 %if %{with python3}
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}
161 %endif
162
163 %if %{with doc}
164 %files apidocs
165 %defattr(644,root,root,755)
166 # %doc docs/_build/html/*
167 %endif
This page took 0.043598 seconds and 4 git commands to generate.