3 %bcond_without doc # don't build doc
4 %bcond_without tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
9 %define egg_name scandir
10 Summary: A better directory iterator and faster os.walk() for Python
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://github.com/benhoyt/scandir/archive/v%{version}/%{module}-%{version}.tar.gz
17 # Source0-md5: aaf700930492f9595eb15bbb0b0c9695
18 URL: https://github.com/benhoyt/scandir
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: python-modules
23 BuildRequires: python-setuptools
26 BuildRequires: python3-modules
27 BuildRequires: python3-setuptools
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 scandir() is a directory iteration function like os.listdir(), except
33 that instead of returning a list of bare filenames, it yields DirEntry
34 objects that include file type and stat information along with the
35 name. Using scandir() increases the speed of os.walk() by 2-20 times
36 (depending on the platform and file system) by avoiding unnecessary
37 calls to os.stat() in most cases. scandir is included in the Python
38 3.5+ standard library.
40 %package -n python3-%{module}
41 Summary: A better directory iterator and faster os.walk() for Python
42 Group: Libraries/Python
44 %description -n python3-%{module}
45 scandir() is a directory iteration function like os.listdir(), except
46 that instead of returning a list of bare filenames, it yields DirEntry
47 objects that include file type and stat information along with the
48 name. Using scandir() increases the speed of os.walk() by 2-20 times
49 (depending on the platform and file system) by avoiding unnecessary
50 calls to os.stat() in most cases. scandir is included in the Python
51 3.5+ standard library.
54 %setup -q -n %{module}-%{version}
62 # Tests fail if unicode is not supported
64 %{__python} test/run_tests.py
74 # Tests fail if unicode is not supported
76 %{__python3} test/run_tests.py
82 rm -rf $RPM_BUILD_ROOT
93 rm -rf $RPM_BUILD_ROOT
97 %defattr(644,root,root,755)
99 %{py_sitedir}/%{module}.py[co]
100 %attr(755,root,root) %{py_sitedir}/_%{module}.so
101 %{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
105 %files -n python3-%{module}
106 %defattr(644,root,root,755)
107 %doc README* LICENSE*
108 %{py3_sitedir}/%{module}.py
109 %{py3_sitedir}/__pycache__/%{module}.*.pyc
110 %attr(755,root,root) %{py3_sitedir}/_%{module}.*.so
111 %{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info