Update to 4.0.0

- Add Python 3 subpackage and have binaries as Python 3
- Rework and clean up spec file
epel9
Neal Gompa 6 years ago
parent 30b3e3d0d9
commit 3624a6b8d2

1
.gitignore vendored

@ -1,3 +1,4 @@
urlgrabber-3.9.1.tar.gz urlgrabber-3.9.1.tar.gz
/urlgrabber-3.10.tar.gz /urlgrabber-3.10.tar.gz
/urlgrabber-3.10.1.tar.gz /urlgrabber-3.10.1.tar.gz
/urlgrabber-4.0.0.tar.gz

@ -1,18 +0,0 @@
commit fbc995805e9d860366c67819effc3bc7d5d8a8b2
Author: Zdenek Pavlas <zpavlas@redhat.com>
Date: Mon Jan 13 13:20:28 2014 +0100
Don't set speed=0 on a new mirror that 404'd. BZ 1051554
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index ef18d6a..04f1179 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -2418,6 +2418,7 @@ class _TH:
speed = (k1 * speed + k2 * dl_size / dl_time) / (k1 + k2)
fail = 0
elif getattr(ug_err, 'code', None) == 404:
+ if not ts: return # 1st update, avoid speed=0
fail = 0 # alive, at least
else:
fail += 1 # seems dead

@ -1,51 +1,105 @@
Summary: A high-level cross-protocol url-grabber %{?python_enable_dependency_generator}
Name: python-urlgrabber
Version: 3.10.1 %global pypi_name urlgrabber
Release: 17%{?dist} %global majorver 4
Source0: http://urlgrabber.baseurl.org/download/urlgrabber-%{version}.tar.gz %global minorver 0
Patch1: urlgrabber-HEAD.patch %global patchver 0
Patch2: BZ-1051554-speed-on-404-mirror.patch %global dashversion %{majorver}-%{minorver}-%{patchver}
License: LGPLv2+ # Tests require internet access
BuildArch: noarch %bcond_with check
BuildRequires: python2-devel, python2-pycurl
Url: http://urlgrabber.baseurl.org/ Name: python-%{pypi_name}
Version: %{majorver}.%{minorver}.%{patchver}
Release: 1%{?dist}
Summary: A high-level cross-protocol url-grabber
License: LGPLv2+
URL: http://urlgrabber.baseurl.org/
# Not uploaded there yet...
#Source0: https://files.pythonhosted.org/packages/source/u/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
#Source0: http://urlgrabber.baseurl.org/download/urlgrabber-%{version}.tar.gz
Source0: https://github.com/rpm-software-management/urlgrabber/releases/download/urlgrabber-%{dashversion}/urlgrabber-%{version}.tar.gz
BuildArch: noarch
%global _description\ %global _description\
A high-level cross-protocol url-grabber for python supporting HTTP, FTP\ A high-level cross-protocol url-grabber for python supporting HTTP, FTP\
and file locations. Features include keepalive, byte ranges, throttling,\ and file locations. Features include keepalive, byte ranges, throttling,\
authentication, proxies and more. authentication, proxies and more.
%description %_description %description %{_description}
%package -n python2-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{pypi_name}}
BuildRequires: python2-devel
BuildRequires: python2dist(setuptools)
BuildRequires: python2dist(pycurl)
BuildRequires: python2dist(six)
%package -n python2-urlgrabber %description -n python2-%{pypi_name} %{_description}
Summary: %summary
Provides: urlgrabber = %{version}-%{release}
Requires: python2-pycurl
%{?python_provide:%python_provide python2-urlgrabber}
%description -n python2-urlgrabber %_description This package provides the Python 2 version.
%package -n python3-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(pycurl)
BuildRequires: python3dist(six)
%description -n python3-%{pypi_name} %{_description}
This package provides the Python 3 version.
%prep %prep
%setup -q -n urlgrabber-%{version} %autosetup -n %{pypi_name}-%{version} -p1
%patch1 -p1
%patch2 -p1
%build %build
%py2_build %py2_build
%py3_build
%install %install
%py2_install %py2_install
rm -rf $RPM_BUILD_ROOT/%{_docdir}/urlgrabber-%{version} %py3_install
sed -e "s|/usr/bin/python|%{__python3}|" -i %{buildroot}%{_libexecdir}/*
rm -rf %{buildroot}%{_docdir}/urlgrabber-%{version}
%if %{with check}
%check
export PYTHONPATH=$PWD
cp scripts/urlgrabber-ext-down scripts/urlgrabber-ext-down-2
sed -e "s|/usr/bin/python|%{__python2}|" -i scripts/urlgrabber-ext-down-2
export URLGRABBER_EXT_DOWN="%{_builddir}/%{pypi_name}-%{version}/scripts/urlgrabber-ext-down-2"
%{__python2} test/runtests.py
cp scripts/urlgrabber-ext-down scripts/urlgrabber-ext-down-3
sed -e "s|/usr/bin/python|%{__python3}|" -i scripts/urlgrabber-ext-down-3
export URLGRABBER_EXT_DOWN="%{_builddir}/%{pypi_name}-%{version}/scripts/urlgrabber-ext-down-3"
%{__python3} test/runtests.py
%endif
%files -n python2-%{pypi_name}
%license LICENSE
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%files -n python2-urlgrabber %files -n python3-%{pypi_name}
%license LICENSE %license LICENSE
%doc ChangeLog README TODO
%{python2_sitelib}/urlgrabber*
%{_bindir}/urlgrabber %{_bindir}/urlgrabber
%attr(0755,root,root) %{_libexecdir}/urlgrabber-ext-down %{_libexecdir}/urlgrabber-ext-down
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%changelog %changelog
* Mon Feb 25 2019 Neal Gompa <ngompa13@gmail.com> - 4.0.0-1
- Update to 4.0.0
- Add Python 3 subpackage and have binaries as Python 3
- Rework and clean up spec file
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.1-17 * Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.1-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
@ -369,4 +423,3 @@ rm -rf $RPM_BUILD_ROOT/%{_docdir}/urlgrabber-%{version}
* Thu Feb 24 2005 Seth Vidal <skvidal@phy.duke.edu> 2.9.3-0 * Thu Feb 24 2005 Seth Vidal <skvidal@phy.duke.edu> 2.9.3-0
- first package for fc3 - first package for fc3
- named python-urlgrabber for naming guideline compliance - named python-urlgrabber for naming guideline compliance

@ -1 +1 @@
1f5dc63805623cc473e06204fd240bb2 urlgrabber-3.10.1.tar.gz SHA512 (urlgrabber-4.0.0.tar.gz) = 01579281b1548c71737166daa6dfb7eaafceaf4afd9703f8e5e3193c33613750cb4291e3c7939065e995a173925965a16e656c43324f3b599f9c83d9e479e8c1

Loading…
Cancel
Save