]> git.pld-linux.org Git - packages/python-scandir.git/blame - python-scandir.spec
- release 6 (by relup.sh)
[packages/python-scandir.git] / python-scandir.spec
CommitLineData
db7f2496 1#
2bef8222 2# Conditional build:
db7f2496 3%bcond_without tests # unit tests
2bef8222 4%bcond_without python2 # CPython 2.x module
6f393d6e 5%bcond_without python3 # CPython 3.x module
2bef8222 6
2c856c10
JP
7%if "%{_ver_ge '%{py3_ver}' '3.9'}" == "1"
8%undefine with_python3
9%endif
10
2bef8222
ER
11%define module scandir
12%define egg_name scandir
45efccd0
JB
13Summary: A better directory iterator and faster os.walk() for Python 2
14Summary(pl.UTF-8): Lepszy iterator po katalogach i szybsze os.walk() dla Pythona 2
2bef8222 15Name: python-%{module}
8e00432f 16Version: 1.10.0
5dc16492 17Release: 6
2bef8222
ER
18License: BSD
19Group: Libraries/Python
20Source0: https://github.com/benhoyt/scandir/archive/v%{version}/%{module}-%{version}.tar.gz
8e00432f 21# Source0-md5: 6357f342d776a2ce056e1731e67631ae
2928c4fd 22Patch0: %{name}-linux.patch
2bef8222 23URL: https://github.com/benhoyt/scandir
db7f2496 24%if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
45efccd0
JB
25BuildRequires: glibc-localedb-all
26%endif
2bef8222 27%if %{with python2}
8e00432f 28BuildRequires: python-modules >= 1:2.7
2bef8222
ER
29BuildRequires: python-setuptools
30%endif
31%if %{with python3}
db7f2496 32BuildRequires: python3-modules >= 1:3.4
2bef8222
ER
33BuildRequires: python3-setuptools
34%endif
45efccd0 35BuildRequires: rpm-pythonprov
2c856c10 36BuildRequires: rpmbuild(macros) >= 1.750
8e00432f 37Requires: python-modules >= 1:2.7
2bef8222
ER
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%description
41scandir() is a directory iteration function like os.listdir(), except
42that instead of returning a list of bare filenames, it yields DirEntry
43objects that include file type and stat information along with the
44name. Using scandir() increases the speed of os.walk() by 2-20 times
45(depending on the platform and file system) by avoiding unnecessary
46calls to os.stat() in most cases. scandir is included in the Python
473.5+ standard library.
48
45efccd0
JB
49%description -l pl.UTF-8
50scandir() to funkcja iterująca po katalogu podobna do os.listdir(),
51ale zamiast zwracania listy samych nazw plików, przekazująca przez
52yield obiekty DirEntry, zawierające poza nazwą typ pliku oraz
53informacje stat. Użycie scandir() przyspiesza os.walk() 2-20 razy (w
54zależności od platformy i systemu plików), zapobiegając w większości
55przypadków niepotrzebnym wywołaniom os.stat(). scandir jest zawarte w
56bibliotece standardowej Pythona 3.5+.
57
2bef8222 58%package -n python3-%{module}
45efccd0
JB
59Summary: A better directory iterator and faster os.walk() for Python 3 < 3.5
60Summary(pl.UTF-8): Lepszy iterator po katalogach i szybsze os.walk() dla Pythona 3 < 3.5
2bef8222 61Group: Libraries/Python
db7f2496 62Requires: python3-modules >= 1:3.4
2bef8222
ER
63
64%description -n python3-%{module}
65scandir() is a directory iteration function like os.listdir(), except
66that instead of returning a list of bare filenames, it yields DirEntry
67objects that include file type and stat information along with the
68name. Using scandir() increases the speed of os.walk() by 2-20 times
69(depending on the platform and file system) by avoiding unnecessary
70calls to os.stat() in most cases. scandir is included in the Python
713.5+ standard library.
72
45efccd0
JB
73%description -n python3-%{module} -l pl.UTF-8
74scandir() to funkcja iterująca po katalogu podobna do os.listdir(),
75ale zamiast zwracania listy samych nazw plików, przekazująca przez
76yield obiekty DirEntry, zawierające poza nazwą typ pliku oraz
77informacje stat. Użycie scandir() przyspiesza os.walk() 2-20 razy (w
78zależności od platformy i systemu plików), zapobiegając w większości
79przypadków niepotrzebnym wywołaniom os.stat(). scandir jest zawarte w
80bibliotece standardowej Pythona 3.5+.
81
2bef8222
ER
82%prep
83%setup -q -n %{module}-%{version}
2928c4fd 84%patch0 -p1
2bef8222
ER
85
86%build
87%if %{with python2}
88%py_build
89
90%if %{with tests}
91rm -rf test/testdir
92# Tests fail if unicode is not supported
45efccd0 93LC_ALL=C.UTF-8 \
2928c4fd 94PYTHONPATH=$(pwd)/$(echo build-2/lib.linux-*) \
2bef8222
ER
95%{__python} test/run_tests.py
96%endif
2bef8222
ER
97%endif
98
99%if %{with python3}
100%py3_build
101
102%if %{with tests}
103rm -rf test/testdir
104# Tests fail if unicode is not supported
45efccd0 105LC_ALL=C.UTF-8 \
2928c4fd 106PYTHONPATH=$(pwd)/$(echo build-3/lib.linux-*) \
2bef8222
ER
107%{__python3} test/run_tests.py
108%endif
2bef8222
ER
109%endif
110
111%install
112rm -rf $RPM_BUILD_ROOT
113%if %{with python2}
114%py_install
115%py_postclean
116%endif
117
118%if %{with python3}
119%py3_install
120%endif
121
122%clean
123rm -rf $RPM_BUILD_ROOT
124
125%if %{with python2}
126%files
127%defattr(644,root,root,755)
45efccd0
JB
128%doc LICENSE.txt README.rst
129%{py_sitedir}/scandir.py[co]
130%attr(755,root,root) %{py_sitedir}/_scandir.so
2bef8222
ER
131%{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
132%endif
133
134%if %{with python3}
135%files -n python3-%{module}
136%defattr(644,root,root,755)
45efccd0
JB
137%doc LICENSE.txt README.rst
138%{py3_sitedir}/scandir.py
139%{py3_sitedir}/__pycache__/scandir.cpython-*.pyc
140%attr(755,root,root) %{py3_sitedir}/_scandir.cpython-*.so
2bef8222
ER
141%{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info
142%endif
This page took 0.138396 seconds and 4 git commands to generate.