Index: mail/py-milter/Makefile =================================================================== --- mail/py-milter/Makefile (Revision 465315) +++ mail/py-milter/Makefile (Arbeitskopie) @@ -2,13 +2,13 @@ # $FreeBSD$ PORTNAME= milter -PORTVERSION= 1.0 -PORTREVISION= 4 +PORTVERSION= 1.0.2 +PORTREVISION= 0 CATEGORIES= mail python -MASTER_SITES= SF/${PYPORTNAME}/${PYPORTNAME}/${DISTNAME} +MASTER_SITES= GH PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} DISTNAME= ${PYPORTNAME}-${PORTVERSION} -DIST_SUBDIR= python +# DIST_SUBDIR= python MAINTAINER= estartu@augusta.de COMMENT= Python interface to Sendmail milter API @@ -22,11 +22,22 @@ .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 Index: mail/py-milter/distinfo =================================================================== --- mail/py-milter/distinfo (Revision 465315) +++ mail/py-milter/distinfo (Arbeitskopie) @@ -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 Index: mail/py-milter/files/extra-patch-miltermodule.c =================================================================== --- mail/py-milter/files/extra-patch-miltermodule.c (nicht existent) +++ mail/py-milter/files/extra-patch-miltermodule.c (Arbeitskopie) @@ -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; + } Eigenschaftsänderungen: mail/py-milter/files/extra-patch-miltermodule.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: mail/py-milter/files/patch-Milter-dns.py =================================================================== --- mail/py-milter/files/patch-Milter-dns.py (nicht existent) +++ mail/py-milter/files/patch-Milter-dns.py (Arbeitskopie) @@ -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 Eigenschaftsänderungen: mail/py-milter/files/patch-Milter-dns.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: mail/py-milter/files/patch-Milter-dsn.py =================================================================== --- mail/py-milter/files/patch-Milter-dsn.py (nicht existent) +++ mail/py-milter/files/patch-Milter-dsn.py (Arbeitskopie) @@ -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 Eigenschaftsänderungen: mail/py-milter/files/patch-Milter-dsn.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: mail/py-milter/files/patch-miltermodule.c =================================================================== --- mail/py-milter/files/patch-miltermodule.c (Revision 465315) +++ mail/py-milter/files/patch-miltermodule.c (nicht existent) @@ -1,11 +0,0 @@ ---- miltermodule.c.orig 2013-03-15 20:50:01 UTC -+++ miltermodule.c -@@ -285,7 +285,7 @@ $ python setup.py help - * published. Unfortunately I know of no good way to do this - * other than with OS-specific tests. - */ --#if defined(__FreeBSD_kernel__) || defined(__linux__) -+#if defined(__FreeBSD__) || defined(__linux__) - #define HAVE_IPV6_RFC2553 - #include - #endif Eigenschaftsänderungen: mail/py-milter/files/patch-miltermodule.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property