]> git.pld-linux.org Git - packages/python-scandir.git/blame - python-scandir.spec
new, version 1.2
[packages/python-scandir.git] / python-scandir.spec
CommitLineData
2bef8222
ER
1#
2# Conditional build:
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
7
8%define module scandir
9%define egg_name scandir
10Summary: A better directory iterator and faster os.walk() for Python
11Name: python-%{module}
12Version: 1.2
13Release: 1
14License: BSD
15Group: Libraries/Python
16Source0: https://github.com/benhoyt/scandir/archive/v%{version}/%{module}-%{version}.tar.gz
17# Source0-md5: aaf700930492f9595eb15bbb0b0c9695
18URL: https://github.com/benhoyt/scandir
19BuildRequires: rpm-pythonprov
20BuildRequires: rpmbuild(macros) >= 1.714
21%if %{with python2}
22BuildRequires: python-modules
23BuildRequires: python-setuptools
24%endif
25%if %{with python3}
26BuildRequires: python3-modules
27BuildRequires: python3-setuptools
28%endif
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%description
32scandir() is a directory iteration function like os.listdir(), except
33that instead of returning a list of bare filenames, it yields DirEntry
34objects that include file type and stat information along with the
35name. Using scandir() increases the speed of os.walk() by 2-20 times
36(depending on the platform and file system) by avoiding unnecessary
37calls to os.stat() in most cases. scandir is included in the Python
383.5+ standard library.
39
40%package -n python3-%{module}
41Summary: A better directory iterator and faster os.walk() for Python
42Group: Libraries/Python
43
44%description -n python3-%{module}
45scandir() is a directory iteration function like os.listdir(), except
46that instead of returning a list of bare filenames, it yields DirEntry
47objects that include file type and stat information along with the
48name. Using scandir() increases the speed of os.walk() by 2-20 times
49(depending on the platform and file system) by avoiding unnecessary
50calls to os.stat() in most cases. scandir is included in the Python
513.5+ standard library.
52
53%prep
54%setup -q -n %{module}-%{version}
55
56%build
57%if %{with python2}
58%py_build
59
60%if %{with tests}
61rm -rf test/testdir
62# Tests fail if unicode is not supported
63LC_ALL=en_US.utf8 \
64%{__python} test/run_tests.py
65%endif
66
67%endif
68
69%if %{with python3}
70%py3_build
71
72%if %{with tests}
73rm -rf test/testdir
74# Tests fail if unicode is not supported
75LC_ALL=en_US.utf8 \
76%{__python3} test/run_tests.py
77%endif
78
79%endif
80
81%install
82rm -rf $RPM_BUILD_ROOT
83%if %{with python2}
84%py_install
85%py_postclean
86%endif
87
88%if %{with python3}
89%py3_install
90%endif
91
92%clean
93rm -rf $RPM_BUILD_ROOT
94
95%if %{with python2}
96%files
97%defattr(644,root,root,755)
98%doc README* LICENSE*
99%{py_sitedir}/%{module}.py[co]
100%attr(755,root,root) %{py_sitedir}/_%{module}.so
101%{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
102%endif
103
104%if %{with python3}
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
112%endif
This page took 0.069542 seconds and 4 git commands to generate.