]>
Commit | Line | Data |
---|---|---|
d9afd364 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module langdetect | |
8 | %define egg_name langdetect | |
9 | %define pypi_name langdetect | |
10 | Summary: Language detection library ported from Google's language-detection | |
11 | Name: python-%{pypi_name} | |
12 | Version: 1.0.7 | |
0b3a9bb6 | 13 | Release: 5 |
d9afd364 ER |
14 | License: ASL-2.0 |
15 | Group: Libraries/Python | |
16 | Source0: https://files.pythonhosted.org/packages/source/l/%{pypi_name}/%{pypi_name}-%{version}.zip | |
17 | # Source0-md5: 6675db2d8abccb97246372767270e912 | |
18 | URL: https://github.com/Mimino666/langdetect | |
19 | BuildRequires: rpm-pythonprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
22 | BuildRequires: python-devel | |
23 | BuildRequires: python-setuptools | |
24 | BuildRequires: python-six | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-devel | |
28 | BuildRequires: python3-setuptools | |
29 | BuildRequires: python3-six | |
30 | %endif | |
31 | BuildArch: noarch | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
ea4ad5db | 35 | Port of Google's language-detection library to Python. |
d9afd364 ER |
36 | |
37 | %package -n python3-%{pypi_name} | |
38 | Summary: Language detection library ported from Google's language-detection | |
39 | Group: Libraries/Python | |
40 | ||
41 | %description -n python3-%{pypi_name} | |
ea4ad5db | 42 | Port of Google's language-detection library to Python. |
d9afd364 ER |
43 | |
44 | %prep | |
45 | %setup -q -n %{pypi_name}-%{version} | |
46 | ||
47 | # Remove bundled egg-info | |
48 | %{__rm} -r %{egg_name}.egg-info | |
49 | ||
50 | %build | |
51 | %if %{with python2} | |
52 | %py_build %{?with_tests:test} | |
53 | %endif | |
54 | ||
55 | %if %{with python3} | |
56 | %py3_build %{?with_tests:test} | |
57 | %endif | |
58 | ||
59 | %install | |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | %if %{with python2} | |
62 | %py_install | |
63 | %py_postclean | |
64 | %endif | |
65 | ||
66 | %if %{with python3} | |
67 | %py3_install | |
68 | %endif | |
69 | ||
70 | %clean | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %if %{with python2} | |
74 | %files | |
75 | %defattr(644,root,root,755) | |
76 | %doc README.md | |
77 | %{py_sitescriptdir}/%{module} | |
78 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
82 | %files -n python3-%{pypi_name} | |
83 | %defattr(644,root,root,755) | |
84 | %doc README.md | |
85 | %{py3_sitescriptdir}/%{module} | |
86 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
87 | %endif |