pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mail



Module Name:    pkgsrc
Committed By:   schmonz
Date:           Tue Feb 27 19:13:44 UTC 2024

Modified Files:
        pkgsrc/mail/py-vmailmgr: Makefile
        pkgsrc/mail/vmailmgr: Makefile.common
        pkgsrc/mail/vmailmgr-base: distinfo
        pkgsrc/mail/vmailmgr-base/patches: patch-Makefile.am patch-configure.ac
Added Files:
        pkgsrc/mail/vmailmgr-base/patches: patch-python_vmailmgr_Makefile.am
            patch-python_vmailmgr_____init____.py
            patch-python_vmailmgr_commands.py patch-python_vmailmgr_config.py
            patch-python_vmailmgr_daemon.py patch-python_vmailmgr_types.py
Removed Files:
        pkgsrc/mail/vmailmgr-base/patches: patch-python_Makefile.am

Log Message:
py-vmailmgr: add Python 3 support. NFCI for 2.7.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mail/py-vmailmgr/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mail/vmailmgr/Makefile.common
cvs rdiff -u -r1.2 -r1.3 pkgsrc/mail/vmailmgr-base/distinfo
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mail/vmailmgr-base/patches/patch-Makefile.am \
    pkgsrc/mail/vmailmgr-base/patches/patch-configure.ac
cvs rdiff -u -r1.1 -r0 \
    pkgsrc/mail/vmailmgr-base/patches/patch-python_Makefile.am
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_Makefile.am \
    pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_____init____.py \
    pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_commands.py \
    pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_config.py \
    pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_daemon.py \
    pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_types.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mail/py-vmailmgr/Makefile
diff -u pkgsrc/mail/py-vmailmgr/Makefile:1.1 pkgsrc/mail/py-vmailmgr/Makefile:1.2
--- pkgsrc/mail/py-vmailmgr/Makefile:1.1        Sun Feb 25 12:09:21 2024
+++ pkgsrc/mail/py-vmailmgr/Makefile    Tue Feb 27 19:13:44 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2024/02/25 12:09:21 schmonz Exp $
+# $NetBSD: Makefile,v 1.2 2024/02/27 19:13:44 schmonz Exp $
 
 .include "../../mail/vmailmgr/Makefile.common"
 
@@ -13,17 +13,15 @@ LICENSE=            gnu-gpl-v2
 CONFIGURE_ARGS+=       --enable-python
 CONFIGURE_ENV+=                PYTHONBIN=${PYTHONBIN:Q}
 
-BUILD_DIRS=            python
-INSTALL_DIRS=          python
+BUILD_DIRS=            python/vmailmgr
+INSTALL_DIRS=          python/vmailmgr
 
 PLIST_SUBST+=          PYSITELIB=${PYSITELIB:Q}
 
 SUBST_CLASSES+=                pyversion
 SUBST_STAGE.pyversion= pre-configure
-SUBST_FILES.pyversion= configure.ac python/Makefile.am
+SUBST_FILES.pyversion= configure.ac python/vmailmgr/Makefile.am
 SUBST_VARS.pyversion=  PYTHONBIN
 
-PYTHON_VERSIONS_ACCEPTED=      27
-
 .include "../../lang/python/application.mk"
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/mail/vmailmgr/Makefile.common
diff -u pkgsrc/mail/vmailmgr/Makefile.common:1.1 pkgsrc/mail/vmailmgr/Makefile.common:1.2
--- pkgsrc/mail/vmailmgr/Makefile.common:1.1    Sun Feb 25 12:09:21 2024
+++ pkgsrc/mail/vmailmgr/Makefile.common        Tue Feb 27 19:13:43 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.1 2024/02/25 12:09:21 schmonz Exp $
+# $NetBSD: Makefile.common,v 1.2 2024/02/27 19:13:43 schmonz Exp $
 #
 # used by mail/php-vmailmgr/Makefile
 # used by mail/py-vmailmgr/Makefile
@@ -74,6 +74,10 @@ SUBST_SED.varbase=   -e 's|/var/lib/vmailm
 SUBST_SED.varbase+=    -e 's|/var/spool|${VARBASE}/spool|g'
 
 post-extract:
+       cd ${WRKSRC}; \
+               ${MKDIR} python-tempname; \
+               ${MV} python python-tempname/vmailmgr; \
+               ${MV} python-tempname python
        cd ${WRKSRC}/lib/config && ${SH} build-config.sh
 
 pre-configure:

Index: pkgsrc/mail/vmailmgr-base/distinfo
diff -u pkgsrc/mail/vmailmgr-base/distinfo:1.2 pkgsrc/mail/vmailmgr-base/distinfo:1.3
--- pkgsrc/mail/vmailmgr-base/distinfo:1.2      Sun Feb 25 12:44:44 2024
+++ pkgsrc/mail/vmailmgr-base/distinfo  Tue Feb 27 19:13:43 2024
@@ -1,15 +1,15 @@
-$NetBSD: distinfo,v 1.2 2024/02/25 12:44:44 schmonz Exp $
+$NetBSD: distinfo,v 1.3 2024/02/27 19:13:43 schmonz Exp $
 
 BLAKE2s (vmailmgr-526d53c1d0e604ec29ada61b79485ceeb8b978cd-526d53c1d0e604ec29ada61b79485ceeb8b978cd.tar.gz) = 6e83ecea2a0defebd20323fbe9833dc1d4e63e8e2d4c6d904c9558ba32cc9a59
 SHA512 (vmailmgr-526d53c1d0e604ec29ada61b79485ceeb8b978cd-526d53c1d0e604ec29ada61b79485ceeb8b978cd.tar.gz) = 
9d717b4b9ae763509d8192c40167606acdc56622d8f9351c763140f5b2573d6c2c1364c33003e1649d2b0d628aadab03690ade20f9e3210c5b44a89237bdd62b
 Size (vmailmgr-526d53c1d0e604ec29ada61b79485ceeb8b978cd-526d53c1d0e604ec29ada61b79485ceeb8b978cd.tar.gz) = 191933 bytes
-SHA1 (patch-Makefile.am) = e78f4db1430c54b6a7a7db4020a4d5169b1b9d22
+SHA1 (patch-Makefile.am) = 707c7a590153618eb7d94d57f314c706577e6300
 SHA1 (patch-acinclude.m4) = 950092d07a7021fb92e4fd4716107a7988a21d22
 SHA1 (patch-authenticate_Makefile.am) = 3529853104846d64882d64be39597cacb0bc6e98
 SHA1 (patch-commands_Makefile.am) = 0fc9881f76fefad7648ecde4bb230278237e33b5
 SHA1 (patch-commands_vadduser.cc) = 425ff956c716b443af4749412dd87e72e9be8af6
 SHA1 (patch-commands_vdeliver.cc) = 0b0217839a0edab2dd070bd4377b8b273f44e836
-SHA1 (patch-configure.ac) = d1a9fad59f076debcdeb6fd352a9b691aad9eec6
+SHA1 (patch-configure.ac) = a3bd54716955c6351b4b045d698932465cbfc6de
 SHA1 (patch-daemon_Makefile.am) = 4a0a2bbcc25371ae412c5b64b577a2194a84f2e4
 SHA1 (patch-daemon_main.cc) = e93f2b06b26920ec9dd8aaf8e4029792b9042284
 SHA1 (patch-doc_HOWTO.texi) = 29a8e8413d653e6901c520ecf38d4febfe7a9845
@@ -27,4 +27,9 @@ SHA1 (patch-lib_vpwtable_gdbm__exists.cc
 SHA1 (patch-lib_vpwtable_gdbm__getbyname.cc) = 6a74f8a8398b6344116d1ded1553a0e795dc809c
 SHA1 (patch-lib_vpwtable_gdbm__put.cc) = 26e9c45bba56cb22fcf17d4a61daef3803ddc752
 SHA1 (patch-lib_vpwtable_gdbm__write.cc) = 5d5bbdc6369292aab87225ba525e81a194aa0d70
-SHA1 (patch-python_Makefile.am) = b1991252f66714b31709a50029fb8c85cd277d79
+SHA1 (patch-python_vmailmgr_Makefile.am) = cbefbe6c445f564e5cc746ddfd027780abc79000
+SHA1 (patch-python_vmailmgr_____init____.py) = 60a51b6b2e97fd9670efc8bfe30dbc72f9fdb682
+SHA1 (patch-python_vmailmgr_commands.py) = fc2204441d320c47ab1e92d8b0b22d8ca94cdf02
+SHA1 (patch-python_vmailmgr_config.py) = 4b7c1aa0a6c5019b8585bf5a2b98fe26acc7e6da
+SHA1 (patch-python_vmailmgr_daemon.py) = 019bd45669340204aa732fc4a1b9e0b9d006ae0c
+SHA1 (patch-python_vmailmgr_types.py) = 386da866b46f8a886f9951db1c2a4c6433ef0741

Index: pkgsrc/mail/vmailmgr-base/patches/patch-Makefile.am
diff -u pkgsrc/mail/vmailmgr-base/patches/patch-Makefile.am:1.1 pkgsrc/mail/vmailmgr-base/patches/patch-Makefile.am:1.2
--- pkgsrc/mail/vmailmgr-base/patches/patch-Makefile.am:1.1     Sun Feb 25 12:09:21 2024
+++ pkgsrc/mail/vmailmgr-base/patches/patch-Makefile.am Tue Feb 27 19:13:43 2024
@@ -1,4 +1,4 @@
-$NetBSD: patch-Makefile.am,v 1.1 2024/02/25 12:09:21 schmonz Exp $
+$NetBSD: patch-Makefile.am,v 1.2 2024/02/27 19:13:43 schmonz Exp $
 
 Build cgi, php, and python as their own packages.
 
@@ -16,7 +16,7 @@ Build cgi, php, and python as their own 
 -SUBDIRS = python php lib authenticate commands daemon cgi doc scripts
 -else
 -SUBDIRS = php lib authenticate commands daemon cgi doc scripts
-+SUBDIRS += python
++SUBDIRS += python/vmailmgr
  endif
  
  dist-hook:
Index: pkgsrc/mail/vmailmgr-base/patches/patch-configure.ac
diff -u pkgsrc/mail/vmailmgr-base/patches/patch-configure.ac:1.1 pkgsrc/mail/vmailmgr-base/patches/patch-configure.ac:1.2
--- pkgsrc/mail/vmailmgr-base/patches/patch-configure.ac:1.1    Sun Feb 25 12:09:22 2024
+++ pkgsrc/mail/vmailmgr-base/patches/patch-configure.ac        Tue Feb 27 19:13:43 2024
@@ -1,4 +1,4 @@
-$NetBSD: patch-configure.ac,v 1.1 2024/02/25 12:09:22 schmonz Exp $
+$NetBSD: patch-configure.ac,v 1.2 2024/02/27 19:13:43 schmonz Exp $
 
 Don't build courier-imap, cgi, php, or python by default.
 Remove unused text-browser checks.
@@ -24,7 +24,7 @@ Remove unused text-browser checks.
  AC_CACHE_CHECK(Python library path, local_cv_python_lib_dir,
  [[if test -x "$PYTHON"; then
 -  local_cv_python_lib_dir=`$PYTHON -c "import sys;print sys.path[1]"`
-+  local_cv_python_lib_dir=`$PYTHON -c "import sys;print(sys.path[2])"`/site-packages
++  local_cv_python_lib_dir=`$PYTHON -c "import site;print(site.getsitepackages()[0])"`
  else
    local_cv_python_lib_dir=NONE
  fi]])
@@ -90,3 +90,10 @@ Remove unused text-browser checks.
  AC_CONFIG_HEADERS([config.h])
  AC_CONFIG_FILES(Makefile
        cgi/Makefile
+@@ -141,5 +148,5 @@ AC_CONFIG_FILES(Makefile
+       lib/vpwtable/Makefile
+       scripts/Makefile
+       php/Makefile
+-      python/Makefile)
++      python/vmailmgr/Makefile)
+ AC_OUTPUT

Added files:

Index: pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_Makefile.am
diff -u /dev/null pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_Makefile.am:1.1
--- /dev/null   Tue Feb 27 19:13:44 2024
+++ pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_Makefile.am Tue Feb 27 19:13:43 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-python_vmailmgr_Makefile.am,v 1.1 2024/02/27 19:13:43 schmonz Exp $
+
+Use pkgsrc-selected python.
+
+--- python/vmailmgr/Makefile.am.orig   2015-09-01 16:03:21.000000000 +0000
++++ python/vmailmgr/Makefile.am
+@@ -26,6 +26,6 @@ types.pyc: types.py local.py
+ types.pyo: types.py local.py
+ 
+ .py.pyc:
+-      python -c 'import $*' && touch $@
++      env PYTHONPATH=.. @PYTHONBIN@ -c 'import vmailmgr.$*' && touch $@
+ .py.pyo:
+-      python -O -c 'import $*' && touch $@
++      env PYTHONPATH=.. @PYTHONBIN@ -O -c 'import vmailmgr.$*' && touch $@
Index: pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_____init____.py
diff -u /dev/null pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_____init____.py:1.1
--- /dev/null   Tue Feb 27 19:13:44 2024
+++ pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_____init____.py     Tue Feb 27 19:13:43 2024
@@ -0,0 +1,9 @@
+$NetBSD: patch-python_vmailmgr_____init____.py,v 1.1 2024/02/27 19:13:43 schmonz Exp $
+
+Port to Python 3, maintaining 2.7 compatibility.
+
+--- python/vmailmgr/__init__.py.orig   2015-09-01 16:03:21.000000000 +0000
++++ python/vmailmgr/__init__.py
+@@ -1 +1 @@
+-from commands import *
++from vmailmgr.commands import *
Index: pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_commands.py
diff -u /dev/null pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_commands.py:1.1
--- /dev/null   Tue Feb 27 19:13:44 2024
+++ pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_commands.py Tue Feb 27 19:13:44 2024
@@ -0,0 +1,63 @@
+$NetBSD: patch-python_vmailmgr_commands.py,v 1.1 2024/02/27 19:13:44 schmonz Exp $
+
+Port to Python 3, maintaining 2.7 compatibility.
+
+--- python/vmailmgr/commands.py.orig   2015-09-01 16:03:21.000000000 +0000
++++ python/vmailmgr/commands.py
+@@ -14,45 +14,44 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ 
+-import daemon
+-import string
+-import types
++import vmailmgr.daemon
++import vmailmgr.types
+ 
+ def execute(command, *args):
+-    return daemon.execute(command, args)
++    return vmailmgr.daemon.execute(command, args)
+ 
+ def check(domain, username, password):
+     return execute('check', domain, username, password)
+ 
+ def listdomain(domain, password):
+-    conn = daemon.Daemon()
+-    response = conn.execute(daemon.Command('listdomain', (domain, password)))
++    conn = vmailmgr.daemon.Daemon()
++    response = conn.execute(vmailmgr.daemon.Command('listdomain', (domain, password)))
+     users = []
+     while 1:
+         r = conn.read_response()
+         if not r:
+             break
+-        (username,data) = string.split(r, '\0', 1)
+-        users.append(types.NamedVUser(username, types.VUser(data)))
++        (username,data) = r.split('\0', 1)
++        users.append(vmailmgr.types.NamedVUser(username, vmailmgr.types.VUser(data)))
+     return users
+ 
+ def adduser(domain, newuser, password, newpass,
+             maildir=None, has_mailbox=None, forwards=[]):
+-    return daemon.execute('adduser3',
++    return vmailmgr.daemon.execute('adduser3',
+                           (domain, newuser, password, newpass,
+                            maildir or '', has_mailbox or '') + tuple(forwards))
+ 
+ def lookup(domain, username, password):
+-    return types.VUser(execute('lookup', domain, username, password))
++    return vmailmgr.types.VUser(execute('lookup', domain, username, password))
+ 
+ def autoresponse(domain, user, password, action, message=None):
+     cmd = [ domain, user, password, action ]
+     if message:
+         cmd.append(message)
+-    return daemon.execute('autoresponse', cmd)
++    return vmailmgr.daemon.execute('autoresponse', cmd)
+ 
+ def deluser(domain, username, password):
+     return execute('deluser', domain, username, password)
+ 
+ def chattr(domain, username, password, attribute, *value):
+-    return daemon.execute('chattr', (domain,username,password,attribute)+value)
++    return vmailmgr.daemon.execute('chattr', (domain,username,password,attribute)+value)
Index: pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_config.py
diff -u /dev/null pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_config.py:1.1
--- /dev/null   Tue Feb 27 19:13:44 2024
+++ pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_config.py   Tue Feb 27 19:13:44 2024
@@ -0,0 +1,23 @@
+$NetBSD: patch-python_vmailmgr_config.py,v 1.1 2024/02/27 19:13:44 schmonz Exp $
+
+Port to Python 3, maintaining 2.7 compatibility.
+
+--- python/vmailmgr/config.py.orig     2015-09-01 16:03:21.000000000 +0000
++++ python/vmailmgr/config.py
+@@ -15,13 +15,12 @@
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ 
+ import os
+-import string
+-import local
++import vmailmgr.local
+ 
+ def read(name, default):
+     try:
+-        file = open(os.path.join(vmailmgr_local.sysconfdir, name))
+-        result = string.strip(file.readline())
++        file = open(os.path.join(vmailmgr.local.sysconfdir, name))
++        result = file.readline().strip()
+         file.close()
+     except:
+         result = default
Index: pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_daemon.py
diff -u /dev/null pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_daemon.py:1.1
--- /dev/null   Tue Feb 27 19:13:44 2024
+++ pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_daemon.py   Tue Feb 27 19:13:44 2024
@@ -0,0 +1,24 @@
+$NetBSD: patch-python_vmailmgr_daemon.py,v 1.1 2024/02/27 19:13:44 schmonz Exp $
+
+Port to Python 3, maintaining 2.7 compatibility.
+
+--- python/vmailmgr/daemon.py.orig     2015-09-01 16:03:21.000000000 +0000
++++ python/vmailmgr/daemon.py
+@@ -14,7 +14,7 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ 
+-import config
++import vmailmgr.config
+ 
+ ok = 0
+ bad = 1
+@@ -47,7 +47,7 @@ class Command:
+ 
+ class Daemon:
+     def __init__(self):
+-        self.socket_file = config.read('socket-file', '/tmp/.vmailmgrd')
++        self.socket_file = vmailmgr.config.read('socket-file', '/tmp/.vmailmgrd')
+         self.socket = None
+ 
+     def connect(self):
Index: pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_types.py
diff -u /dev/null pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_types.py:1.1
--- /dev/null   Tue Feb 27 19:13:44 2024
+++ pkgsrc/mail/vmailmgr-base/patches/patch-python_vmailmgr_types.py    Tue Feb 27 19:13:44 2024
@@ -0,0 +1,62 @@
+$NetBSD: patch-python_vmailmgr_types.py,v 1.1 2024/02/27 19:13:44 schmonz Exp $
+
+Port to Python 3, maintaining 2.7 compatibility.
+
+--- python/vmailmgr/types.py.orig      2015-09-01 16:03:21.000000000 +0000
++++ python/vmailmgr/types.py
+@@ -14,13 +14,12 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ 
+-import string
+ import time
+ 
+ class Limit:
+     unlimited = -1
+     def __init__(self, str):
+-        if str[0] == '-' or string.lower(str) == 'unlimited':
++        if str[0] == '-' or str.lower() == 'unlimited':
+             str = self.unlimited
+         self.value = int(str)
+     def __str__(self):
+@@ -84,18 +83,18 @@ class VUser:
+             self.from_binary(bin)
+ 
+     def from_binary(self, bin):
+-        if bin[0] <> chr(2):
+-            raise ValueError, "Virtual user data has invalid format number"
++        if bin[0] != chr(2):
++            raise ValueError("Virtual user data has invalid format number")
+         i = 1
+-        while bin[i] <> chr(0):
++        while bin[i] != chr(0):
+             flag = ord(bin[i])
+             val = ord(bin[i+1])
+             i = i + 2
+             if flag == ATTR_MAILBOX_ENABLED:
+                 self.mailbox_enabled = Flag(val)
+             else:
+-                raise ValueError, "Invalid flag number %d in vuser data" % flag
+-        bin = string.split(bin[i+1:], '\0')
++                raise ValueError("Invalid flag number %d in vuser data" % flag)
++        bin = bin[i+1:].split('\0')
+         self.password = bin[0]
+         self.mailbox = bin[1]
+         self.forwards = []
+@@ -124,12 +123,15 @@ class VUser:
+     def items(self): return self.__dict__.items()
+     def dict(self): return self.__dict__
+ 
++def my_cmp(a, b):
++    return (a > b) - (a < b)
++
+ class NamedVUser:
+     def __init__(self, username, vuser):
+         self.username = username
+         self.vuser = vuser
+     def __cmp__(self, other):
+-        return cmp(self.username, other.username)
++        return my_cmp(self.username, other.username)
+     def __getitem__(self, key):
+         if key == 'username':
+             return self.username



Home | Main Index | Thread Index | Old Index