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
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}
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
22 BuildRequires: python-devel
23 BuildRequires: python-setuptools
24 BuildRequires: python-six
27 BuildRequires: python3-devel
28 BuildRequires: python3-setuptools
29 BuildRequires: python3-six
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 Port of Google's language-detection library to Python.
37 %package -n python3-%{pypi_name}
38 Summary: Language detection library ported from Google's language-detection
39 Group: Libraries/Python
41 %description -n python3-%{pypi_name}
42 Port of Google's language-detection library to Python.
45 %setup -q -n %{pypi_name}-%{version}
47 # Remove bundled egg-info
48 %{__rm} -r %{egg_name}.egg-info
52 %py_build %{?with_tests:test}
56 %py3_build %{?with_tests:test}
60 rm -rf $RPM_BUILD_ROOT
71 rm -rf $RPM_BUILD_ROOT
75 %defattr(644,root,root,755)
77 %{py_sitescriptdir}/%{module}
78 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
82 %files -n python3-%{pypi_name}
83 %defattr(644,root,root,755)
85 %{py3_sitescriptdir}/%{module}
86 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info