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