svn commit: r324776 - in head/www/py-urlgrabber: . files
Nicola Vitale
nivit at FreeBSD.org
Thu Aug 15 16:21:28 UTC 2013
Author: nivit
Date: Thu Aug 15 16:21:27 2013
New Revision: 324776
URL: http://svnweb.freebsd.org/changeset/ports/324776
Log:
- Add a patch from upstream, that fix value of SSL verify host with pycurl
(see http://goo.gl/KGnkXT ) [1], and so bump PORTREVISION
- Trim Makefile header
- Remove dead link from MASTER_SITES
- Remove leading, indefinite article from COMMENT
- Add LICENSE (LGPL21)
- Convert to the new options framework
- Fix WWW field in pkg-descr
Required by: Yuri <yuri at rawbw.com> (via private email) [1]
Build details: http://goo.gl/7arykr
Added:
head/www/py-urlgrabber/files/patch-urlgrabber__grabber.py (contents, props changed)
Deleted:
head/www/py-urlgrabber/files/patch-urlgrabber-grabber.py
Modified:
head/www/py-urlgrabber/Makefile
head/www/py-urlgrabber/files/patch-setup.py (contents, props changed)
head/www/py-urlgrabber/pkg-descr (contents, props changed)
Modified: head/www/py-urlgrabber/Makefile
==============================================================================
--- head/www/py-urlgrabber/Makefile Thu Aug 15 16:14:02 2013 (r324775)
+++ head/www/py-urlgrabber/Makefile Thu Aug 15 16:21:27 2013 (r324776)
@@ -1,20 +1,17 @@
-# New ports collection makefile for: py-urlgrabber
-# Date created: 2007-09-22
-# Whom: Nicola Vitale <nivit at FreeBSD.org>
-#
+# Created by: Nicola Vitale <nivit at FreeBSD.org>
# $FreeBSD$
-#
PORTNAME= urlgrabber
PORTVERSION= 3.9.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www python
-MASTER_SITES= http://urlgrabber.baseurl.org/download/ \
- http://nivi.interfree.it/distfiles/${PORTNAME}/
+MASTER_SITES= http://urlgrabber.baseurl.org/download/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= nivit at FreeBSD.org
-COMMENT= A high-level cross-protocol url-grabber
+COMMENT= High-level cross-protocol url-grabber
+
+LICENSE= LGPL21
BUILD_DEPENDS= ${PKGNAMEPREFIX}curl>=7.19.0_1:${PORTSDIR}/ftp/py-curl
RUN_DEPENDS= ${PKGNAMEPREFIX}curl>=7.19.0_1:${PORTSDIR}/ftp/py-curl
@@ -25,8 +22,13 @@ USE_PYDISTUTILS= yes
REINPLACE_ARGS= -i.bak -e 's,%%DOCSDIR%%,${DOCSDIR},'
DOCSDIR= ${PREFIX}/share/doc/${PYTHON_PKGNAMEPREFIX}${PORTNAME}
-.if defined(NOPORTDOCS)
-MAKE_ENV= NOPORTDOCS=${NOPORTDOCS}
+OPTIONSFILE?= ${PORT_DBDIR}/py-${PORTNAME}/options
+OPTIONS_DEFINE= DOCS
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDOCS}
+MAKE_ENV= INSTALL_DOCS=yes
.endif
post-patch:
Modified: head/www/py-urlgrabber/files/patch-setup.py
==============================================================================
--- head/www/py-urlgrabber/files/patch-setup.py Thu Aug 15 16:14:02 2013 (r324775)
+++ head/www/py-urlgrabber/files/patch-setup.py Thu Aug 15 16:21:27 2013 (r324776)
@@ -19,7 +19,7 @@
if k.startswith('_'): del config[k]
+ import os
-+ if not os.environ.has_key('NOPORTDOCS'):
++ if os.environ.has_key('INSTALL_DOCS'):
+ config.setdefault('data_files', [('%%DOCSDIR%%', ['README','LICENSE', 'TODO', 'ChangeLog'])])
+
from distutils.core import setup
Added: head/www/py-urlgrabber/files/patch-urlgrabber__grabber.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/py-urlgrabber/files/patch-urlgrabber__grabber.py Thu Aug 15 16:21:27 2013 (r324776)
@@ -0,0 +1,54 @@
+--- ./urlgrabber/grabber.py.orig 2009-09-25 18:19:50.000000000 +0200
++++ ./urlgrabber/grabber.py 2013-08-15 17:18:28.000000000 +0200
+@@ -1052,7 +1052,7 @@
+ self._reget_length = 0
+ self._prog_running = False
+ self._error = (None, None)
+- self.size = None
++ self.size = 0
+ self._do_open()
+
+
+@@ -1127,6 +1127,9 @@
+ if not opts:
+ opts = self.opts
+
++ # keepalives
++ if not opts.keepalive:
++ self.curl_obj.setopt(pycurl.FORBID_REUSE, 1)
+
+ # defaults we're always going to set
+ self.curl_obj.setopt(pycurl.NOPROGRESS, False)
+@@ -1158,7 +1161,8 @@
+ self.curl_obj.setopt(pycurl.CAPATH, opts.ssl_ca_cert)
+ self.curl_obj.setopt(pycurl.CAINFO, opts.ssl_ca_cert)
+ self.curl_obj.setopt(pycurl.SSL_VERIFYPEER, opts.ssl_verify_peer)
+- self.curl_obj.setopt(pycurl.SSL_VERIFYHOST, opts.ssl_verify_host)
++ if opts.ssl_verify_host: # 1 is meaningless to curl
++ self.curl_obj.setopt(pycurl.SSL_VERIFYHOST, 2)
+ if opts.ssl_key:
+ self.curl_obj.setopt(pycurl.SSLKEY, opts.ssl_key)
+ if opts.ssl_key_type:
+@@ -1299,6 +1303,12 @@
+ err.code = code
+ err.exception = e
+ raise err
++ else:
++ if self._error[1]:
++ msg = self._error[1]
++ err = URLGRabError(14, msg)
++ err.url = self.url
++ raise err
+
+ def _do_open(self):
+ self.curl_obj = _curl_cache
+@@ -1536,7 +1546,8 @@
+ if self.opts.size: # if we set an opts size use that, no matter what
+ max_size = self.opts.size
+ if not max_size: return False # if we have None for all of the Max then this is dumb
+- if cur > max_size + max_size*.10:
++
++ if cur > int(float(max_size) * 1.10):
+
+ msg = _("Downloaded more than max size for %s: %s > %s") \
+ % (self.url, cur, max_size)
Modified: head/www/py-urlgrabber/pkg-descr
==============================================================================
--- head/www/py-urlgrabber/pkg-descr Thu Aug 15 16:14:02 2013 (r324775)
+++ head/www/py-urlgrabber/pkg-descr Thu Aug 15 16:21:27 2013 (r324776)
@@ -6,5 +6,4 @@ a clean interface to protocol-independan
urlgrabber takes care of all those pesky file-fetching details, and
lets you focus on whatever it is that your program is written to do!
-Author: Michael D. Stenner, Ryan Tomayko
-WWW: http://urlgrabber.baseurl.org/
+WWW: http://urlgrabber.baseurl.org/
More information about the svn-ports-head
mailing list