pkgsrc-WIP-changes archive

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

vmailmgr: fix most warnings, avoid needing fig2dev.



Module Name:	pkgsrc-wip
Committed By:	Amitai Schleier <schmonz-web-git%schmonz.com@localhost>
Pushed By:	schmonz
Date:		Thu Feb 22 14:01:33 2024 -0500
Changeset:	06f4e99e3160c450e805f2d212a4982d9efdaa4c

Modified Files:
	vmailmgr-base/distinfo
	vmailmgr-base/patches/patch-commands_vdeliver.cc
	vmailmgr-base/patches/patch-configure.ac
	vmailmgr-base/patches/patch-doc_Makefile.am
	vmailmgr-docs/Makefile
	vmailmgr/Makefile.common
	vmailmgr/TODO.md
Added Files:
	vmailmgr-base/patches/patch-commands_vadduser.cc
	vmailmgr-base/patches/patch-daemon_main.cc
	vmailmgr-base/patches/patch-lib_cli++_main.cc
	vmailmgr-base/patches/patch-lib_misc_crc32.cc
	vmailmgr-base/patches/patch-lib_misc_md5-crypt.c
	vmailmgr-base/patches/patch-lib_misc_md5.c
	vmailmgr-base/patches/patch-lib_misc_response.h

Log Message:
vmailmgr: fix most warnings, avoid needing fig2dev.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=06f4e99e3160c450e805f2d212a4982d9efdaa4c

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

diffstat:
 vmailmgr-base/distinfo                           | 13 +++-
 vmailmgr-base/patches/patch-commands_vadduser.cc | 27 ++++++++
 vmailmgr-base/patches/patch-commands_vdeliver.cc | 18 ++++-
 vmailmgr-base/patches/patch-configure.ac         | 14 +++-
 vmailmgr-base/patches/patch-daemon_main.cc       | 19 ++++++
 vmailmgr-base/patches/patch-doc_Makefile.am      | 13 ++++
 vmailmgr-base/patches/patch-lib_cli++_main.cc    | 18 +++++
 vmailmgr-base/patches/patch-lib_misc_crc32.cc    | 15 +++++
 vmailmgr-base/patches/patch-lib_misc_md5-crypt.c | 30 +++++++++
 vmailmgr-base/patches/patch-lib_misc_md5.c       | 85 ++++++++++++++++++++++++
 vmailmgr-base/patches/patch-lib_misc_response.h  | 15 +++++
 vmailmgr-docs/Makefile                           |  1 -
 vmailmgr/Makefile.common                         |  6 ++
 vmailmgr/TODO.md                                 |  1 -
 14 files changed, 266 insertions(+), 9 deletions(-)

diffs:
diff --git a/vmailmgr-base/distinfo b/vmailmgr-base/distinfo
index 6efc81dce8..00e5991713 100644
--- a/vmailmgr-base/distinfo
+++ b/vmailmgr-base/distinfo
@@ -7,13 +7,20 @@ SHA1 (patch-Makefile.am) = e78f4db1430c54b6a7a7db4020a4d5169b1b9d22
 SHA1 (patch-acinclude.m4) = 950092d07a7021fb92e4fd4716107a7988a21d22
 SHA1 (patch-authenticate_Makefile.am) = 3529853104846d64882d64be39597cacb0bc6e98
 SHA1 (patch-commands_Makefile.am) = 0fc9881f76fefad7648ecde4bb230278237e33b5
-SHA1 (patch-commands_vdeliver.cc) = 2f63addd758b14516a3acaf6ed79a4770c263968
-SHA1 (patch-configure.ac) = d48ce7a3912a1ab2dd9b27e5ed271bba0118d951
+SHA1 (patch-commands_vadduser.cc) = 425ff956c716b443af4749412dd87e72e9be8af6
+SHA1 (patch-commands_vdeliver.cc) = ddf90a5adefd646872d59591e03f0feeb7f72167
+SHA1 (patch-configure.ac) = d1a9fad59f076debcdeb6fd352a9b691aad9eec6
 SHA1 (patch-daemon_Makefile.am) = 4a0a2bbcc25371ae412c5b64b577a2194a84f2e4
+SHA1 (patch-daemon_main.cc) = e93f2b06b26920ec9dd8aaf8e4029792b9042284
 SHA1 (patch-doc_HOWTO.texi) = 29a8e8413d653e6901c520ecf38d4febfe7a9845
-SHA1 (patch-doc_Makefile.am) = 95118818ccd228f3b5d20458bff7adeed222b772
+SHA1 (patch-doc_Makefile.am) = cd16ee93a4209411fdd478d66401dd00fa765013
+SHA1 (patch-lib_cli++_main.cc) = cfa961d73e61fa5bd6ef20efefe77d773f8ef951
 SHA1 (patch-lib_fdbuf_fdbuf.h) = 2607bb82c4d9123df0a94b30fc5930db6429010d
 SHA1 (patch-lib_mergelib.sh) = 59cdc1e5896331195f1d693a7cad4f7f6f7ec8e4
+SHA1 (patch-lib_misc_crc32.cc) = 06c57d2fb85d8e216b9e961aa949d2c7a12d1d3a
+SHA1 (patch-lib_misc_md5-crypt.c) = 34b45a7b10b07bea9a1b64958d8b31b807d75083
+SHA1 (patch-lib_misc_md5.c) = 44a8bdfb8db3861f4e3ca5631f40ab47e4092901
+SHA1 (patch-lib_misc_response.h) = 36b3366b718118139d86121b2473e7f2f6d04c92
 SHA1 (patch-lib_vpwtable_cdb__write.cc) = 68e159457a1c6dd152c9d33abeb4457078a4e666
 SHA1 (patch-lib_vpwtable_gdbm__del.cc) = 9eb35e3d6daaf55aaefdaf7fec33a500e51d7856
 SHA1 (patch-lib_vpwtable_gdbm__exists.cc) = c819d6fb8d410b83faf113d639620dcb44d7ba2d
diff --git a/vmailmgr-base/patches/patch-commands_vadduser.cc b/vmailmgr-base/patches/patch-commands_vadduser.cc
new file mode 100644
index 0000000000..067fe21070
--- /dev/null
+++ b/vmailmgr-base/patches/patch-commands_vadduser.cc
@@ -0,0 +1,27 @@
+$NetBSD$
+
+Avoid dangling else.
+
+--- commands/vadduser.cc.orig	2024-02-22 18:36:02.894040336 +0000
++++ commands/vadduser.cc
+@@ -190,16 +190,18 @@ void add_alias(mystring user, mystring a
+   if(!domain.exists(alias)) {
+     vpwentry vpw(alias, "*", domain.userdir(alias), user, false);
+     response resp = domain.set(&vpw, true);
+-    if(!resp)
++    if(!resp) {
+       if(!o_quiet)
+ 	ferr << argv0base << ": warning: adding the alias '"
+ 	     << alias
+ 	     << "' failed:\n  "
+ 	     << resp.msg << endl;
+-    else
++    }
++    else {
+       if(!o_quiet)
+ 	fout << argv0base << ": alias '" << alias << "' successfully added"
+ 	     << endl;
++    }
+   }
+   else
+     if(!o_quiet)
diff --git a/vmailmgr-base/patches/patch-commands_vdeliver.cc b/vmailmgr-base/patches/patch-commands_vdeliver.cc
index c583014d14..9aa233717f 100644
--- a/vmailmgr-base/patches/patch-commands_vdeliver.cc
+++ b/vmailmgr-base/patches/patch-commands_vdeliver.cc
@@ -2,7 +2,7 @@ $NetBSD$
 
 Patch from FreeBSD ports.
 
---- commands/vdeliver.cc.orig	2024-02-20 03:26:27.764197339 +0000
+--- commands/vdeliver.cc.orig	2015-09-01 16:03:21.000000000 +0000
 +++ commands/vdeliver.cc
 @@ -262,7 +262,7 @@ void inject(mystring sender, mystring re
      close(pipe2[1]);
@@ -13,3 +13,19 @@ Patch from FreeBSD ports.
      die_temp("Exec of qmail-queue failed.");
    default:
      close(pipe1[0]);
+@@ -335,11 +335,12 @@ int cli_main(int, char*[])
+ 
+   if (run_predeliver) {
+     int r = execute("vdeliver-predeliver");
+-    if(r)
++    if(r) {
+       if(r == 99)
+-	return 99;
++        return 99;
+       else
+-	exit_msg("Execution of vdeliver-predeliver failed", r);
++        exit_msg("Execution of vdeliver-predeliver failed", r);
++    }
+   }
+ 
+   if(do_delivery) {
diff --git a/vmailmgr-base/patches/patch-configure.ac b/vmailmgr-base/patches/patch-configure.ac
index 2d9f7de755..79ce4e2576 100644
--- a/vmailmgr-base/patches/patch-configure.ac
+++ b/vmailmgr-base/patches/patch-configure.ac
@@ -11,7 +11,7 @@ Remove unused text-browser checks.
  AC_CONFIG_SRCDIR([lib/mergelib.sh])
  AM_INIT_AUTOMAKE
  
-@@ -55,34 +55,42 @@ AC_PATH_PROG(RM, rm)
+@@ -55,38 +55,48 @@ AC_PATH_PROG(RM, rm)
  AC_PATH_PROG(MKDIR, mkdir)
  AC_PATH_PROG(LN, ln)
  
@@ -71,8 +71,16 @@ Remove unused text-browser checks.
 +AM_CONDITIONAL(WANTCGI, test "$USE_CGI" != no)
  
  TODAY=`date +%Y-%m-%d`
- POD2MAN="pod2man --release='vmailmgr ${VERSION}' --center='VMailMgr Tools Documentation' --date='${TODAY}'"
-@@ -117,9 +125,6 @@ dnl Checks for library functions.
+-POD2MAN="pod2man --release='vmailmgr ${VERSION}' --center='VMailMgr Tools Documentation' --date='${TODAY}'"
+-POD2HTML="pod2html --noindex"
++AC_PATH_PROG(POD2MAN,pod2man)
++POD2MAN="$POD2MAN --release='vmailmgr ${VERSION}' --center='VMailMgr Tools Documentation' --date='${TODAY}'"
++AC_PATH_PROG(POD2HTML,pod2html)
++POD2HTML="$POD2HTML --noindex"
+ SUFFIXES="$SUFFIXES .1 .5 .7 .8 .pod .html .texi .txt .ps .fig .sgml .py .pyc .pyo"
+ AC_SUBST(POD2MAN)
+ AC_SUBST(POD2HTML)
+@@ -117,9 +127,6 @@ dnl Checks for library functions.
  AC_CHECK_FUNCS(gethostname gettimeofday mkdir putenv rmdir socket)
  AC_CHECK_FUNCS(srandom random crypt strcasestr)
  
diff --git a/vmailmgr-base/patches/patch-daemon_main.cc b/vmailmgr-base/patches/patch-daemon_main.cc
new file mode 100644
index 0000000000..e397e23895
--- /dev/null
+++ b/vmailmgr-base/patches/patch-daemon_main.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+Remove unused function.
+
+--- daemon/main.cc.orig	2024-02-22 18:32:57.270441623 +0000
++++ daemon/main.cc
+@@ -61,12 +61,6 @@ cli_option cli_options[] = {
+ 
+ #define TIMEOUT 1
+ 
+-static inline void die(const char* msg)
+-{
+-  perror(msg);
+-  exit(1);
+-}
+-
+ static void finishreq()
+ {
+   alarm(0);
diff --git a/vmailmgr-base/patches/patch-doc_Makefile.am b/vmailmgr-base/patches/patch-doc_Makefile.am
index 42aa7693d3..c11c83c5ad 100644
--- a/vmailmgr-base/patches/patch-doc_Makefile.am
+++ b/vmailmgr-base/patches/patch-doc_Makefile.am
@@ -4,6 +4,19 @@ Avoid "warning: ignoring prerequisites on suffix rule definition"
 
 --- doc/Makefile.am.orig	2015-09-01 16:03:21.000000000 +0000
 +++ doc/Makefile.am
+@@ -7,10 +7,10 @@ noinst_TXTS = HOWTO.txt FAQ.txt \
+ 	record-format.txt
+ noinst_PODS = vmailmgr.pod
+ noinst_MISC = FAQ.info FAQ.pdf HOWTO.info HOWTO.pdf \
+-	configuration.info translation.pdf translation.ps
++	configuration.info
+ EXTRA_DIST = ChangeLog-pre-vmailmgr ChangeLog-pre-0.70 \
+ 	changelog2html.pl news2html.pl \
+-	YEAR2000 translation.fig \
++	YEAR2000 \
+ 	$(man_MANS) \
+ 	$(noinst_PODS) \
+ 	$(noinst_TEXINFOS) \
 @@ -31,6 +31,7 @@ TEXI2INFO = texi2any --info --no-split -
  TEXI2TXT = texi2any --plaintext
  
diff --git a/vmailmgr-base/patches/patch-lib_cli++_main.cc b/vmailmgr-base/patches/patch-lib_cli++_main.cc
new file mode 100644
index 0000000000..633274f574
--- /dev/null
+++ b/vmailmgr-base/patches/patch-lib_cli++_main.cc
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Remove unused function.
+
+--- lib/cli++/main.cc.orig	2024-02-22 18:32:27.213171111 +0000
++++ lib/cli++/main.cc
+@@ -49,11 +49,6 @@ static void build_options()
+   options[optionc-1] = &help_option;
+ }
+ 
+-static inline unsigned max(unsigned a, unsigned b)
+-{
+-  return (a>b) ? a : b;
+-}
+-
+ static const char* fill(unsigned i)
+ {
+   static unsigned lastlen = 0;
diff --git a/vmailmgr-base/patches/patch-lib_misc_crc32.cc b/vmailmgr-base/patches/patch-lib_misc_crc32.cc
new file mode 100644
index 0000000000..e9af281b94
--- /dev/null
+++ b/vmailmgr-base/patches/patch-lib_misc_crc32.cc
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Remove unsupported keyword.
+
+--- lib/misc/crc32.cc.orig	2024-02-22 18:31:14.384171118 +0000
++++ lib/misc/crc32.cc
+@@ -132,7 +132,7 @@ const crc32_t crc32tab[] = { /* a table
+ crc32_t crc32_c::update (const unsigned char *s, int len)
+ /* update running CRC calculation with contents of a buffer */
+ {
+-	register crc32_t a = val;
++	crc32_t a = val;
+ 	while(len-- > 0)
+ 		a = crc32_update (a, *s++);
+ 	return (val = a) ^ CRC32INIT;
diff --git a/vmailmgr-base/patches/patch-lib_misc_md5-crypt.c b/vmailmgr-base/patches/patch-lib_misc_md5-crypt.c
new file mode 100644
index 0000000000..c7ec14a9ef
--- /dev/null
+++ b/vmailmgr-base/patches/patch-lib_misc_md5-crypt.c
@@ -0,0 +1,30 @@
+$NetBSD$
+
+Provide modern prototypes.
+
+--- lib/misc/md5-crypt.c.orig	2024-02-22 18:33:20.895490263 +0000
++++ lib/misc/md5-crypt.c
+@@ -53,11 +53,7 @@ extern char *md5_crypt __P ((const char
+ /* This entry point is equivalent to the `crypt' function in Unix
+    libcs.  */
+ char *
+-md5_crypt_r (key, salt, buffer, buflen)
+-     const char *key;
+-     const char *salt;
+-     char *buffer;
+-     int buflen;
++md5_crypt_r (const char *key, const char *salt, char *buffer, int buflen)
+ {
+   unsigned char alt_result[16];
+   struct md5_ctx ctx;
+@@ -213,9 +209,7 @@ md5_crypt_r (key, salt, buffer, buflen)
+ 
+ 
+ char *
+-md5_crypt (key, salt)
+-     const char *key;
+-     const char *salt;
++md5_crypt (const char *key, const char *salt)
+ {
+   /* We don't want to have an arbitrary limit in the size of the
+      password.  We can compute the size of the result in advance and
diff --git a/vmailmgr-base/patches/patch-lib_misc_md5.c b/vmailmgr-base/patches/patch-lib_misc_md5.c
new file mode 100644
index 0000000000..56e58daeb8
--- /dev/null
+++ b/vmailmgr-base/patches/patch-lib_misc_md5.c
@@ -0,0 +1,85 @@
+$NetBSD$
+
+Provide modern prototypes.
+
+--- lib/misc/md5.c.orig	2015-09-01 16:03:21.000000000 +0000
++++ lib/misc/md5.c
+@@ -69,8 +69,7 @@ static const unsigned char fillbuf[64] =
+ /* Initialize structure containing state of computation.
+    (RFC 1321, 3.3: Step 3)  */
+ void
+-md5_init_ctx (ctx)
+-     struct md5_ctx *ctx;
++md5_init_ctx (struct md5_ctx *ctx)
+ {
+   ctx->A = 0x67452301;
+   ctx->B = 0xefcdab89;
+@@ -87,9 +86,7 @@ md5_init_ctx (ctx)
+    IMPORTANT: On some systems it is required that RESBUF is correctly
+    aligned for a 32 bits value.  */
+ void *
+-md5_read_ctx (ctx, resbuf)
+-     const struct md5_ctx *ctx;
+-     void *resbuf;
++md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
+ {
+   ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
+   ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
+@@ -105,9 +102,7 @@ md5_read_ctx (ctx, resbuf)
+    IMPORTANT: On some systems it is required that RESBUF is correctly
+    aligned for a 32 bits value.  */
+ void *
+-md5_finish_ctx (ctx, resbuf)
+-     struct md5_ctx *ctx;
+-     void *resbuf;
++md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
+ {
+   /* Take yet unprocessed bytes into account.  */
+   md5_uint32 bytes = ctx->buflen;
+@@ -136,9 +131,7 @@ md5_finish_ctx (ctx, resbuf)
+    resulting message digest number will be written into the 16 bytes
+    beginning at RESBLOCK.  */
+ int
+-md5_stream (stream, resblock)
+-     FILE *stream;
+-     void *resblock;
++md5_stream (FILE *stream, void *resblock)
+ {
+   /* Important: BLOCKSIZE must be a multiple of 64.  */
+ #define BLOCKSIZE 4096
+@@ -193,10 +186,7 @@ md5_stream (stream, resblock)
+    output yields to the wanted ASCII representation of the message
+    digest.  */
+ void *
+-md5_buffer (buffer, len, resblock)
+-     const char *buffer;
+-     size_t len;
+-     void *resblock;
++md5_buffer (const char *buffer, size_t len, void *resblock)
+ {
+   struct md5_ctx ctx;
+ 
+@@ -212,10 +202,7 @@ md5_buffer (buffer, len, resblock)
+ 
+ 
+ void
+-md5_process_bytes (buffer, len, ctx)
+-     const void *buffer;
+-     size_t len;
+-     struct md5_ctx *ctx;
++md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
+ {
+   /* When we already have some bits in our internal buffer concatenate
+      both inputs first.  */
+@@ -270,10 +257,7 @@ md5_process_bytes (buffer, len, ctx)
+    It is assumed that LEN % 64 == 0.  */
+ 
+ void
+-md5_process_block (buffer, len, ctx)
+-     const void *buffer;
+-     size_t len;
+-     struct md5_ctx *ctx;
++md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
+ {
+   md5_uint32 correct_words[16];
+   const md5_uint32 *words = buffer;
diff --git a/vmailmgr-base/patches/patch-lib_misc_response.h b/vmailmgr-base/patches/patch-lib_misc_response.h
new file mode 100644
index 0000000000..35dad6b9ce
--- /dev/null
+++ b/vmailmgr-base/patches/patch-lib_misc_response.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Avoid operator precedence warning.
+
+--- lib/misc/response.h.orig	2024-02-22 18:26:09.457292318 +0000
++++ lib/misc/response.h
+@@ -19,7 +19,7 @@ struct response
+   mystring message() const;
+   mystring codestr() const;
+ 
+-  static const unsigned long maxsize = 1<<16-1;
++  static const unsigned long maxsize = (1<<16)-1;
+ };
+ 
+ #define RETURN(CODE,STR) return response(response::CODE, STR)
diff --git a/vmailmgr-docs/Makefile b/vmailmgr-docs/Makefile
index f2290e3f29..2c1214bd4c 100644
--- a/vmailmgr-docs/Makefile
+++ b/vmailmgr-docs/Makefile
@@ -7,7 +7,6 @@ PKGNAME=		vmailmgr-docs-${VERSION}
 BUILD_TARGET=		docs
 BUILD_DIRS+=		. authenticate
 
-TOOL_DEPENDS+=		fig2dev-[0-9]*:../../print/fig2dev
 TOOL_DEPENDS+=		gtexinfo-[0-9]*:../../devel/gtexinfo
 TOOL_DEPENDS+=		tex-texinfo-[0-9]*:../../print/tex-texinfo
 
diff --git a/vmailmgr/Makefile.common b/vmailmgr/Makefile.common
index be4a93c7fe..4eebbe2c2b 100644
--- a/vmailmgr/Makefile.common
+++ b/vmailmgr/Makefile.common
@@ -22,6 +22,7 @@ LICENSE=		gnu-gpl-v2
 WRKSRC=			${WRKDIR}/${DISTNAME}
 
 USE_LANGUAGES=		c c++
+USE_CXX_FEATURES=	c++14
 USE_TOOLS+=		autoconf automake gmake perl sh
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR:Q}
@@ -42,6 +43,11 @@ SUBST_STAGE.prefix=	pre-configure
 SUBST_FILES.prefix=	authenticate/checkvpw.pod doc/HOWTO.texi
 SUBST_SED.prefix=	-e 's|/usr/bin|${PREFIX}/bin|g'
 
+SUBST_CLASSES+=		unused
+SUBST_STAGE.unused=	pre-configure
+SUBST_FILES.unused=	lib/courier-authlib/*.c lib/courier-authlib/*.h
+SUBST_SED.unused=	-e 's|\(.*rcsid\[\]=.*;\)$$|// \1|g'
+
 SUBST_CLASSES+=		sysconf
 SUBST_STAGE.sysconf=	pre-configure
 SUBST_FILES.sysconf=	php/vmail.inc scripts/vmailmgrd.run
diff --git a/vmailmgr/TODO.md b/vmailmgr/TODO.md
index 8f779cfa77..fbe276e858 100644
--- a/vmailmgr/TODO.md
+++ b/vmailmgr/TODO.md
@@ -1,6 +1,5 @@
 # TODO
 
 - Give each package its own DESCR and COMMENT
-- Fix build warnings
 - Add separate package for daemon?
 - [FreeBSD's vmailmgr port just before deletion](https://github.com/freebsd/freebsd-ports/tree/635ccfbf59522ddd44cd9283b321e2d9b3bc9876/mail/vmailmgr)


Home | Main Index | Thread Index | Old Index