diff --git a/.gitignore b/.gitignore index 5e327c0..7e25217 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ urlgrabber-3.9.1.tar.gz /urlgrabber-3.10.tar.gz /urlgrabber-3.10.1.tar.gz +/urlgrabber-4.0.0.tar.gz diff --git a/BZ-1051554-speed-on-404-mirror.patch b/BZ-1051554-speed-on-404-mirror.patch deleted file mode 100644 index b587c3d..0000000 --- a/BZ-1051554-speed-on-404-mirror.patch +++ /dev/null @@ -1,18 +0,0 @@ -commit fbc995805e9d860366c67819effc3bc7d5d8a8b2 -Author: Zdenek Pavlas -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 diff --git a/python-urlgrabber.spec b/python-urlgrabber.spec index 986cd77..c538843 100644 --- a/python-urlgrabber.spec +++ b/python-urlgrabber.spec @@ -1,51 +1,105 @@ -Summary: A high-level cross-protocol url-grabber -Name: python-urlgrabber -Version: 3.10.1 -Release: 17%{?dist} -Source0: http://urlgrabber.baseurl.org/download/urlgrabber-%{version}.tar.gz -Patch1: urlgrabber-HEAD.patch -Patch2: BZ-1051554-speed-on-404-mirror.patch - -License: LGPLv2+ -BuildArch: noarch -BuildRequires: python2-devel, python2-pycurl -Url: http://urlgrabber.baseurl.org/ +%{?python_enable_dependency_generator} + +%global pypi_name urlgrabber +%global majorver 4 +%global minorver 0 +%global patchver 0 +%global dashversion %{majorver}-%{minorver}-%{patchver} + +# Tests require internet access +%bcond_with check + +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\ A high-level cross-protocol url-grabber for python supporting HTTP, FTP\ and file locations. Features include keepalive, byte ranges, throttling,\ 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 -Summary: %summary -Provides: urlgrabber = %{version}-%{release} -Requires: python2-pycurl -%{?python_provide:%python_provide python2-urlgrabber} +%description -n python2-%{pypi_name} %{_description} -%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 -%setup -q -n urlgrabber-%{version} -%patch1 -p1 -%patch2 -p1 +%autosetup -n %{pypi_name}-%{version} -p1 %build %py2_build +%py3_build %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 -%doc ChangeLog README TODO -%{python2_sitelib}/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 +* Mon Feb 25 2019 Neal Gompa - 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 - 3.10.1-17 - 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 2.9.3-0 - first package for fc3 - named python-urlgrabber for naming guideline compliance - diff --git a/sources b/sources index 350d00c..34a9f89 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1f5dc63805623cc473e06204fd240bb2 urlgrabber-3.10.1.tar.gz +SHA512 (urlgrabber-4.0.0.tar.gz) = 01579281b1548c71737166daa6dfb7eaafceaf4afd9703f8e5e3193c33613750cb4291e3c7939065e995a173925965a16e656c43324f3b599f9c83d9e479e8c1 diff --git a/urlgrabber-HEAD.patch b/urlgrabber-HEAD.patch deleted file mode 100644 index e69de29..0000000