Date: Sun, 16 Sep 2012 20:34:31 +1000 (EST) From: Kubilay Kocak <koobs.freebsd@gmail.com> To: FreeBSD-gnats-submit@FreeBSD.org Cc: lwhsu@FreeBSD.org Subject: ports/171682: [PATCH] ftp/py27-pyftpdlib: Add OPTIONSng, switch to setuptools, enable unittests Message-ID: <20120916103431.BEF0D39E76@freebsd-9-amd64.localdomain> Resent-Message-ID: <201209161040.q8GAe4Th006347@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 171682 >Category: ports >Synopsis: [PATCH] ftp/py27-pyftpdlib: Add OPTIONSng, switch to setuptools, enable unittests >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Sep 16 10:40:04 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Kubilay Kocak >Release: FreeBSD 9.0-RELEASE-p3 amd64 >Organization: >Environment: System: FreeBSD freebsd-9-amd64 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Sat Jul 7 21:26:56 EST >Description: - Tweak USE_PYTHON to -2.7 to match upstream compatibility - Switch from distutils to easy_install (update pkg_plist to suit) - Add OptionsNG for SENDFILE and OPENSSL support - Add test: target to run unit tests - Patch: setup.py --Add zip_safe=False to install egg uncompressed --Add test_suite for running unit tests via setup.py - Patch: test/test_* - add path hacks to test WRKSRC sources ==[QA]== portlint: looks fine. redports: https://redports.org/buildarchive/20120915093530-27676/ unittest: Ran 523 tests in 44.957s - FAILED (errors=52) errors: - test.test_contrib.TestWindowsAuthorizer (not Windows) - test.test_contrib.TestUnixAuthorizer (no spwd in lang/python*) - test.test_ftpd.TestIPv6MixedEnvironment fixed in trunk - https://code.google.com/p/pyftpdlib/issues/detail?id=131 ======= Added file(s): - files/patch-test__test_contrib.py - files/patch-test__test_ftpd.py Port maintainer (lwhsu@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: ports) >How-To-Repeat: >Fix: --- py27-pyftpdlib-0.7.0.patch begins here --- diff -ruN --exclude=CVS /usr/ports/ftp/py-pyftpdlib/Makefile ./Makefile --- /usr/ports/ftp/py-pyftpdlib/Makefile 2012-06-29 03:57:19.000000000 +1000 +++ ./Makefile 2012-09-16 20:28:43.000000000 +1000 @@ -16,8 +16,26 @@ LICENSE= MIT -USE_PYTHON= yes -USE_PYDISTUTILS= yes +USE_PYTHON= -2.7 +USE_PYDISTUTILS= easy_install + +OPTIONS_DEFINE= SENDFILE OPENSSL +OPTIONS_DEFAULT= SENDFILE OPENSSL +SENDFILE_DESC= Enable sendfile(2) support +OPENSSL_DESC= Enable FTP over SSL/TLS (RFC4217) + +# Workaround ports infrastructure bug +OPTIONSFILE= ${PORT_DBDIR}/py-${PORTNAME}/options + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MSENDFILE} +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}pysendfile>0:${PORTSDIR}/net/py-pysendfile +.endif + +.if ${PORT_OPTIONS:MOPENSSL} +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}openssl>0:${PORTSDIR}/security/py-openssl +.endif EXAMPLESDIR= ${PREFIX}/share/examples/py-${PORTNAME} @@ -27,4 +45,8 @@ ${CP} -R ${WRKSRC}/demo/ ${EXAMPLESDIR} .endif +test: build + ${TOUCH} ${WRKSRC}/test/__init__.py + cd ${WRKSRC} && ${PYTHON_CMD} ${PYSETUP} test + .include <bsd.port.mk> diff -ruN --exclude=CVS /usr/ports/ftp/py-pyftpdlib/files/patch-setup.py ./files/patch-setup.py --- /usr/ports/ftp/py-pyftpdlib/files/patch-setup.py 2012-06-29 03:57:19.000000000 +1000 +++ ./files/patch-setup.py 2012-09-15 01:25:57.000000000 +1000 @@ -1,14 +1,11 @@ ---- ./setup.py.orig 2012-06-15 22:18:19.000000000 +1000 -+++ ./setup.py 2012-06-15 22:18:34.000000000 +1000 -@@ -38,10 +38,7 @@ +--- ./setup.py.orig 2012-01-26 06:31:16.000000000 +1100 ++++ ./setup.py 2012-09-15 01:20:41.000000000 +1000 +@@ -83,6 +83,8 @@ + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + ], ++ test_suite='test', ++ zip_safe=False, + ) - import os - import sys --try: -- from setuptools import setup --except ImportError: -- from distutils.core import setup -+from distutils.core import setup - - name = 'pyftpdlib' - version = '0.7.0' + if os.name == 'posix': diff -ruN --exclude=CVS /usr/ports/ftp/py-pyftpdlib/files/patch-test__test_contrib.py ./files/patch-test__test_contrib.py --- /usr/ports/ftp/py-pyftpdlib/files/patch-test__test_contrib.py 1970-01-01 10:00:00.000000000 +1000 +++ ./files/patch-test__test_contrib.py 2012-09-15 01:25:57.000000000 +1000 @@ -0,0 +1,26 @@ +--- ./test/test_contrib.py.orig 2012-01-26 05:16:27.000000000 +1100 ++++ ./test/test_contrib.py 2012-09-15 01:25:10.000000000 +1000 +@@ -37,6 +37,7 @@ + import ftplib + import unittest + import os ++import sys + import random + import string + import warnings +@@ -56,10 +57,15 @@ + except ImportError: + pass + ++#Path hacks ++sys.path.insert(0, os.path.abspath('..')) + from pyftpdlib import ftpserver + from pyftpdlib.contrib import authorizers + from pyftpdlib.contrib import handlers + from pyftpdlib.contrib import filesystems ++ ++#More hacks ++sys.path.append('.') + from test_ftpd import * + + diff -ruN --exclude=CVS /usr/ports/ftp/py-pyftpdlib/files/patch-test__test_ftpd.py ./files/patch-test__test_ftpd.py --- /usr/ports/ftp/py-pyftpdlib/files/patch-test__test_ftpd.py 1970-01-01 10:00:00.000000000 +1000 +++ ./files/patch-test__test_ftpd.py 2012-09-15 01:25:57.000000000 +1000 @@ -0,0 +1,11 @@ +--- ./test/test_ftpd.py.orig 2012-01-26 05:16:27.000000000 +1100 ++++ ./test/test_ftpd.py 2012-09-15 01:25:53.000000000 +1000 +@@ -77,6 +77,8 @@ + except ImportError: + sendfile = None + ++#Path hacks ++sys.path.insert(0, os.path.abspath('..')) + from pyftpdlib import ftpserver + + diff -ruN --exclude=CVS /usr/ports/ftp/py-pyftpdlib/pkg-plist ./pkg-plist --- /usr/ports/ftp/py-pyftpdlib/pkg-plist 2012-06-29 03:57:19.000000000 +1000 +++ ./pkg-plist 2012-09-15 00:06:17.000000000 +1000 @@ -1,21 +1,26 @@ -%%PYTHON_SITELIBDIR%%/pyftpdlib/__init__.py -%%PYTHON_SITELIBDIR%%/pyftpdlib/__init__.pyc -%%PYTHON_SITELIBDIR%%/pyftpdlib/__init__.pyo -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/__init__.py -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/__init__.pyc -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/__init__.pyo -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/authorizers.py -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/authorizers.pyc -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/authorizers.pyo -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/filesystems.py -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/filesystems.pyc -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/filesystems.pyo -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/handlers.py -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/handlers.pyc -%%PYTHON_SITELIBDIR%%/pyftpdlib/contrib/handlers.pyo -%%PYTHON_SITELIBDIR%%/pyftpdlib/ftpserver.py -%%PYTHON_SITELIBDIR%%/pyftpdlib/ftpserver.pyc -%%PYTHON_SITELIBDIR%%/pyftpdlib/ftpserver.pyo +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/PKG-INFO +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/SOURCES.txt +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/dependency_links.txt +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/not-zip-safe +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO/top_level.txt +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/__init__.py +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/__init__.pyc +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/__init__.pyo +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/__init__.py +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/__init__.pyc +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/__init__.pyo +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/authorizers.py +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/authorizers.pyc +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/authorizers.pyo +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/filesystems.py +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/filesystems.pyc +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/filesystems.pyo +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/handlers.py +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/handlers.pyc +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib/handlers.pyo +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/ftpserver.py +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/ftpserver.pyc +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/ftpserver.pyo %%PORTEXAMPLES%%%%EXAMPLESDIR%%/anti_flood_ftpd.py %%PORTEXAMPLES%%%%EXAMPLESDIR%%/basic_ftpd.py %%PORTEXAMPLES%%%%EXAMPLESDIR%%/keycert.pem @@ -26,5 +31,7 @@ %%PORTEXAMPLES%%%%EXAMPLESDIR%%/unix_ftpd.py %%PORTEXAMPLES%%%%EXAMPLESDIR%%/winnt_ftpd.py %%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%% -@dirrm %%PYTHON_SITELIBDIR%%/pyftpdlib/contrib -@dirrm %%PYTHON_SITELIBDIR%%/pyftpdlib +@dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib/contrib +@dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/pyftpdlib +@dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/EGG-INFO +@dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%% --- py27-pyftpdlib-0.7.0.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120916103431.BEF0D39E76>