From owner-svn-ports-all@freebsd.org Sat May 19 16:25:17 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C3A6ED6492; Sat, 19 May 2018 16:25:17 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9AE57536C; Sat, 19 May 2018 16:25:16 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A90E917B3; Sat, 19 May 2018 16:25:16 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JGPGfi001314; Sat, 19 May 2018 16:25:16 GMT (envelope-from miwi@FreeBSD.org) Received: (from miwi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JGPFM1001309; Sat, 19 May 2018 16:25:15 GMT (envelope-from miwi@FreeBSD.org) Message-Id: <201805191625.w4JGPFM1001309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: miwi set sender to miwi@FreeBSD.org using -f From: Martin Wilke Date: Sat, 19 May 2018 16:25:15 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r470417 - in head/mail/py-milter: . files X-SVN-Group: ports-head X-SVN-Commit-Author: miwi X-SVN-Commit-Paths: in head/mail/py-milter: . files X-SVN-Commit-Revision: 470417 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2018 16:25:17 -0000 Author: miwi Date: Sat May 19 16:25:15 2018 New Revision: 470417 URL: https://svnweb.freebsd.org/changeset/ports/470417 Log: - Update to 1.0.2 - Use Github PR: 226857 Submitted by: Peter Wullinger Approved by: maintainer Sponsored by: iXsystems Inc. Added: head/mail/py-milter/files/extra-patch-miltermodule.c (contents, props changed) head/mail/py-milter/files/patch-Milter-dns.py (contents, props changed) head/mail/py-milter/files/patch-Milter-dsn.py (contents, props changed) Deleted: head/mail/py-milter/files/patch-miltermodule.c Modified: head/mail/py-milter/Makefile head/mail/py-milter/distinfo Modified: head/mail/py-milter/Makefile ============================================================================== --- head/mail/py-milter/Makefile Sat May 19 16:21:14 2018 (r470416) +++ head/mail/py-milter/Makefile Sat May 19 16:25:15 2018 (r470417) @@ -2,13 +2,11 @@ # $FreeBSD$ PORTNAME= milter -PORTVERSION= 1.0 -PORTREVISION= 4 +PORTVERSION= 1.0.2 CATEGORIES= mail python -MASTER_SITES= SF/${PYPORTNAME}/${PYPORTNAME}/${DISTNAME} +MASTER_SITES= GH PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} DISTNAME= ${PYPORTNAME}-${PORTVERSION} -DIST_SUBDIR= python MAINTAINER= estartu@augusta.de COMMENT= Python interface to Sendmail milter API @@ -22,11 +20,22 @@ CFLAGS+= -I${LOCALBASE}/include .endif PYPORTNAME= ${PKGNAMEPREFIX:C/[0-9]+-//}${PORTNAME} +GH_ACCOUNT= sdgathman +GH_PROJECT= ${PYPORTNAME} +GH_TAGNAME= ${GH_PROJECT}-${PORTVERSION} -USES= python:2.7 -USE_PYTHON= distutils autoplist +USES= python +USE_GITHUB= yes +USE_PYTHON= distutils autoplist flavors + post-install: ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/milter.so -.include +.include + +.if ${FLAVOR:Upy27:Mpy3*} +EXTRA_PATCHES= ${PATCHDIR}/extra-patch-miltermodule.c +.endif + +.include Modified: head/mail/py-milter/distinfo ============================================================================== --- head/mail/py-milter/distinfo Sat May 19 16:21:14 2018 (r470416) +++ head/mail/py-milter/distinfo Sat May 19 16:25:15 2018 (r470417) @@ -1,2 +1,3 @@ -SHA256 (python/pymilter-1.0.tar.gz) = 93a8f31b06c4a7f04e6f9b69f8d7357ba750819e6348177536b23255616e8937 -SIZE (python/pymilter-1.0.tar.gz) = 1014442 +TIMESTAMP = 1521752301 +SHA256 (pymilter-1.0.2_GH0.tar.gz) = f513053f5fc9b0c31d886d8412a411bdc958786a673d7071b1bd521498b01153 +SIZE (pymilter-1.0.2_GH0.tar.gz) = 1022535 Added: head/mail/py-milter/files/extra-patch-miltermodule.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/py-milter/files/extra-patch-miltermodule.c Sat May 19 16:25:15 2018 (r470417) @@ -0,0 +1,172 @@ +--- miltermodule.c.orig 2016-12-13 19:17:34 UTC ++++ miltermodule.c +@@ -343,7 +343,7 @@ static struct MilterCallback { + { NULL , NULL } + }; + +-staticforward struct smfiDesc description; /* forward declaration */ ++static struct smfiDesc description; /* forward declaration */ + + static PyObject *MilterError; + /* The interpreter instance that called milter.main */ +@@ -355,7 +355,7 @@ typedef struct { + + static milter_Diag diag; + +-staticforward PyTypeObject milter_ContextType; ++static PyTypeObject milter_ContextType; + + typedef struct { + PyObject_HEAD +@@ -700,7 +700,7 @@ _generic_wrapper(milter_ContextObject *s + result = PyEval_CallObject(cb, arglist); + Py_DECREF(arglist); + if (result == NULL) return _report_exception(self); +- if (!PyInt_Check(result)) { ++ if (!PyLong_Check(result)) { + const struct MilterCallback *p; + const char *cbname = "milter"; + char buf[40]; +@@ -715,7 +715,7 @@ _generic_wrapper(milter_ContextObject *s + PyErr_SetString(MilterError,buf); + return _report_exception(self); + } +- retval = PyInt_AS_LONG(result); ++ retval = PyLong_AS_LONG(result); + Py_DECREF(result); + _release_thread(self->t); + return retval; +@@ -732,7 +732,7 @@ makeipaddr(struct sockaddr_in *addr) { + sprintf(buf, "%d.%d.%d.%d", + (int) (x>>24) & 0xff, (int) (x>>16) & 0xff, + (int) (x>> 8) & 0xff, (int) (x>> 0) & 0xff); +- return PyString_FromString(buf); ++ return PyUnicode_FromString(buf); + } + + #ifdef HAVE_IPV6_SUPPORT +@@ -740,8 +740,8 @@ static PyObject * + makeip6addr(struct sockaddr_in6 *addr) { + char buf[100]; /* must be at least INET6_ADDRSTRLEN + 1 */ + const char *s = inet_ntop(AF_INET6, &addr->sin6_addr, buf, sizeof buf); +- if (s) return PyString_FromString(s); +- return PyString_FromString("inet6:unknown"); ++ if (s) return PyUnicode_FromString(s); ++ return PyUnicode_FromString("inet6:unknown"); + } + #endif + +@@ -832,7 +832,7 @@ generic_env_wrapper(SMFICTX *ctx, PyObje + for (i=0;i/libmilter/README for details on setting it up.\n"; + + static void setitem(PyObject *d,const char *name,long val) { +- PyObject *v = PyInt_FromLong(val); ++ PyObject *v = PyLong_FromLong(val); + PyDict_SetItemString(d,name,v); + Py_DECREF(v); + } + +-void +-initmilter(void) { ++static struct PyModuleDef moduledef = { ++ PyModuleDef_HEAD_INIT, ++ "milter", /* m_name */ ++ milter_documentation,/* m_doc */ ++ -1, /* m_size */ ++ milter_methods, /* m_methods */ ++ NULL, /* m_reload */ ++ NULL, /* m_traverse */ ++ NULL, /* m_clear */ ++ NULL, /* m_free */ ++}; ++ ++PyMODINIT_FUNC PyInit_milter(void) { + PyObject *m, *d; + +- m = Py_InitModule4("milter", milter_methods, milter_documentation, +- (PyObject*)NULL, PYTHON_API_VERSION); ++ if (PyType_Ready(&milter_ContextType) < 0) ++ return NULL; ++ ++ m = PyModule_Create(&moduledef); ++ if (m == NULL) return NULL; + d = PyModule_GetDict(m); + MilterError = PyErr_NewException("milter.error", NULL, NULL); + PyDict_SetItemString(d,"error", MilterError); +@@ -1710,4 +1725,5 @@ initmilter(void) { + setitem(d,"DISCARD", SMFIS_DISCARD); + setitem(d,"ACCEPT", SMFIS_ACCEPT); + setitem(d,"TEMPFAIL", SMFIS_TEMPFAIL); ++ return m; + } Added: head/mail/py-milter/files/patch-Milter-dns.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/py-milter/files/patch-Milter-dns.py Sat May 19 16:25:15 2018 (r470417) @@ -0,0 +1,13 @@ +--- Milter/dns.py.orig 2016-12-13 19:17:34 UTC ++++ Milter/dns.py +@@ -26,8 +26,8 @@ def DNSLookup(name, qtype): + # A RR as dotted quad. For consistency, this driver should + # return both as binary string. + return [((a['name'], a['typename']), a['data']) for a in resp.answers] +- except IOError, x: +- raise DNSError, str(x) ++ except IOError as x: ++ raise DNSError(str(x)) + + class Session(object): + """A Session object has a simple cache with no TTL that is valid Added: head/mail/py-milter/files/patch-Milter-dsn.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/py-milter/files/patch-Milter-dsn.py Sat May 19 16:25:15 2018 (r470417) @@ -0,0 +1,19 @@ +--- Milter/dsn.py.orig 2016-12-13 19:17:34 UTC ++++ Milter/dsn.py +@@ -142,13 +142,13 @@ def send_dsn(mailfrom,receiver,msg=None, + if badrcpts: + return badrcpts + return None # success +- except smtplib.SMTPRecipientsRefused,x: ++ except smtplib.SMTPRecipientsRefused as x: + if len(x.recipients) == 1: + return x.recipients.values()[0] # permanent error + return x.recipients +- except smtplib.SMTPSenderRefused,x: ++ except smtplib.SMTPSenderRefused as x: + return x.args[:2] # does not accept DSN +- except smtplib.SMTPDataError,x: ++ except smtplib.SMTPDataError as x: + return x.args # permanent error + except smtplib.SMTPException: + pass # any other error, try next MX