Spec cleanup

This commit is contained in:
Andrey Bondrov 2017-01-17 13:15:48 +10:00
parent 8f081d28f3
commit bd4eea1ac8
2 changed files with 72 additions and 80 deletions

View file

@ -1,9 +1,2 @@
removed_sources:
urllib3-1.10.4.tar.gz: 9e631ca7f850d0d57a7f027d9ff593a80b0f5c96
urllib3-1.4.tar.gz: d4f498ccda19ed2bb7673bd0fede14f1d1b8d8b7
urllib3-1.7.1.tar.gz: 2defd91cf718c3be3301fb754d9e3acc9f6e5851
urllib3-1.8.2.tar.gz: a53fa7b7abff9adf3d977d7205ef4f042f5273df
urllib3-1.8.3.tar.gz: 00c92b0c3b0756ae3c4e6262d5bc80023dfe9ca3
urllib3-1.9.tar.gz: 9522197efb2a2b49ce804de3a515f06d97b6602f
sources:
urllib3-1.13.1.tar.gz: 1309e9536c74cdad6d5ab089c83235a687b6d7e6

View file

@ -1,31 +1,23 @@
%define module urllib3
Summary: Python HTTP library with thread-safe connection pooling, file post, and more
Name: python-%{module}
Version: 1.13.1
Release: 2
Source0: https://pypi.python.org/packages/source/u/%{module}/%{module}-%{version}.tar.gz
Source1: ssl_match_hostname_py3.py
License: MIT
Group: Development/Python
Url: http://urllib3.readthedocs.org/
BuildArch: noarch
BuildRequires: pkgconfig(python)
BuildRequires: python-setuptools
Requires: rootcerts
Requires: python-six
#Requires: python-backports-ssl_match_hostname
# For unittests
BuildRequires: python3-nose
BuildRequires: python3-mock
BuildRequires: python3-tornado
BuildRequires: python-tornado
BuildRequires: python-nose
BuildRequires: python-mock
#BuildRequires: python-backports-ssl_match_hostname
BuildRequires: python-six
BuildRequires: python3-six
Summary: Python HTTP library with thread-safe connection pooling, file post, and more
Name: python-%{module}
Version: 1.13.1
Release: 3
License: MIT
Group: Development/Python
Url: http://urllib3.readthedocs.org/
Source0: https://pypi.python.org/packages/source/u/%{module}/%{module}-%{version}.tar.gz
Source1: ssl_match_hostname_py3.py
BuildRequires: python-setuptools
BuildRequires: python-six
BuildRequires: pkgconfig(python)
BuildRequires: python-mock
BuildRequires: python-nose
BuildRequires: python-tornado
Requires: python-six
Requires: rootcerts
BuildArch: noarch
%description
There are two critical features missing from the Python standard
@ -38,14 +30,40 @@ with each other. They were designed to be independent and standalone,
each solving a different scope of problems, and urllib3 follows in a
similar vein.
%files
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
%{py_puresitedir}/*
%pretrans -p <lua>
path = "%{py_puresitedir}/urllib3/packages/ssl_match_hostname"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
#----------------------------------------------------------------------------
%package -n python3-%{module}
Summary: Python 3 HTTP library with thread-safe connection pooling, file post, and more
Group: Development/Python
BuildRequires: pkgconfig(python3)
BuildRequires: python3-setuptools
BuildRequires: python3-six
Requires: rootcerts
Requires: python3-six
Summary: Python 3 HTTP library with thread-safe connection pooling, file post, and more
Group: Development/Python
BuildRequires: python3-setuptools
BuildRequires: python3-six
BuildRequires: pkgconfig(python3)
# For unittests
BuildRequires: python3-mock
BuildRequires: python3-nose
BuildRequires: python3-six
BuildRequires: python3-tornado
Requires: python3-six
Requires: rootcerts
%description -n python3-%{module}
There are two critical features missing from the Python standard
@ -58,6 +76,27 @@ with each other. They were designed to be independent and standalone,
each solving a different scope of problems, and urllib3 follows in a
similar vein.
%files -n python3-%{module}
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
%{py3_puresitedir}/*
%pretrans -p <lua> -n python3-%{module}
path = "%{py3_puresitedir}/urllib3/packages/ssl_match_hostname"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
#----------------------------------------------------------------------------
%prep
%setup -q -n %{module}-%{version}
@ -104,43 +143,3 @@ cp %{SOURCE1} %{buildroot}/%{py3_puresitedir}/urllib3/packages/ssl_match_hostnam
popd
%pretrans -p <lua>
path = "%{py_puresitedir}/urllib3/packages/ssl_match_hostname"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
%pretrans -p <lua> -n python3-%{module}
path = "%{py3_puresitedir}/urllib3/packages/ssl_match_hostname"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
%files
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
%{py_puresitedir}/*
%files -n python3-%{module}
%doc CHANGES.rst README.rst CONTRIBUTORS.txt
%{py3_puresitedir}/*