]> git.pld-linux.org Git - packages/python-scandir.git/blob - python-scandir.spec
new, version 1.2
[packages/python-scandir.git] / python-scandir.spec
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
10 Summary:        A better directory iterator and faster os.walk() for Python
11 Name:           python-%{module}
12 Version:        1.2
13 Release:        1
14 License:        BSD
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
21 %if %{with python2}
22 BuildRequires:  python-modules
23 BuildRequires:  python-setuptools
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-modules
27 BuildRequires:  python3-setuptools
28 %endif
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
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.
39
40 %package -n python3-%{module}
41 Summary:        A better directory iterator and faster os.walk() for Python
42 Group:          Libraries/Python
43
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.
52
53 %prep
54 %setup -q -n %{module}-%{version}
55
56 %build
57 %if %{with python2}
58 %py_build
59
60 %if %{with tests}
61 rm -rf test/testdir
62 # Tests fail if unicode is not supported
63 LC_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}
73 rm -rf test/testdir
74 # Tests fail if unicode is not supported
75 LC_ALL=en_US.utf8 \
76 %{__python3} test/run_tests.py
77 %endif
78
79 %endif
80
81 %install
82 rm -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
93 rm -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.047207 seconds and 3 git commands to generate.