git: 00229f2f9171 - main - mail/panda-cclient: catch-up with the latest patches

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Tue, 19 Apr 2022 20:50:18 UTC
The branch main has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=00229f2f9171034fc64199749a935497a3db48e3

commit 00229f2f9171034fc64199749a935497a3db48e3
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2022-04-19 20:15:33 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2022-04-19 20:49:43 +0000

    mail/panda-cclient: catch-up with the latest patches
    
    Nothing has been released yet, but some interesting patches have been committed.
    See <https://github.com/nkhorman/panda-imap/commits/master>.
---
 mail/panda-cclient/Makefile                        |  9 ++-
 mail/panda-cclient/distinfo                        |  5 +-
 .../files/patch-src_osdep_unix_Makefile            | 83 +++++-----------------
 .../files/patch-src_osdep_unix_ssl__unix.c         | 63 ----------------
 mail/panda-cclient/pkg-plist                       |  4 +-
 5 files changed, 27 insertions(+), 137 deletions(-)

diff --git a/mail/panda-cclient/Makefile b/mail/panda-cclient/Makefile
index 866e759e54eb..8c3b1ab4aa12 100644
--- a/mail/panda-cclient/Makefile
+++ b/mail/panda-cclient/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	cclient
 PORTVERSION=	20130621
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	mail devel
 PKGNAMEPREFIX=	panda-
 
@@ -15,7 +15,7 @@ LICENSE_FILE=	${WRKSRC}/LICENSE
 USE_GITHUB=	yes
 GH_ACCOUNT=	jonabbey
 GH_PROJECT=	panda-imap
-GH_TAGNAME=	7905901
+GH_TAGNAME=	3452f1598a8b4eeb44b38aead1c1598e379b05de
 
 CONFLICTS_INSTALL=	cclient-20*
 
@@ -47,10 +47,9 @@ MAKE_ARGS+=	SSLTYPE=unix.nopwd SSLDIR=${OPENSSLDIR}
 
 MAKE_ARGS+=	EXTRACFLAGS="${CFLAGS}"
 
-SHLIBBASE=	c-client4
-SHLIBMAJ=	10
+SHLIBBASE=	c-client
+SHLIBMAJ=	2010
 SHLIBNAME=	lib${SHLIBBASE}.so.${SHLIBMAJ}
-MAKE_ENV+=	SHLIBNAME=${SHLIBNAME} SHLIBBASE=${SHLIBBASE}
 PLIST_SUB+=	SHLIBNAME=${SHLIBNAME} SHLIBBASE=${SHLIBBASE}
 
 pre-configure:
diff --git a/mail/panda-cclient/distinfo b/mail/panda-cclient/distinfo
index d27871510c2f..0ff789e41af1 100644
--- a/mail/panda-cclient/distinfo
+++ b/mail/panda-cclient/distinfo
@@ -1,2 +1,3 @@
-SHA256 (jonabbey-panda-imap-20130621-7905901_GH0.tar.gz) = 58e6a922c0c2179164955ea0647d8ad0ab4ce830f5c1fc53a5f193c75c88d641
-SIZE (jonabbey-panda-imap-20130621-7905901_GH0.tar.gz) = 2062378
+TIMESTAMP = 1650390380
+SHA256 (jonabbey-panda-imap-20130621-3452f1598a8b4eeb44b38aead1c1598e379b05de_GH0.tar.gz) = e65063633743065848ce0b594acda52b5d149ae426104a7fc1742de9e042c233
+SIZE (jonabbey-panda-imap-20130621-3452f1598a8b4eeb44b38aead1c1598e379b05de_GH0.tar.gz) = 2066879
diff --git a/mail/panda-cclient/files/patch-src_osdep_unix_Makefile b/mail/panda-cclient/files/patch-src_osdep_unix_Makefile
index f9b3effab3e0..56993e1d8940 100644
--- a/mail/panda-cclient/files/patch-src_osdep_unix_Makefile
+++ b/mail/panda-cclient/files/patch-src_osdep_unix_Makefile
@@ -1,4 +1,4 @@
---- src/osdep/unix/Makefile.orig	2013-06-21 21:29:17 UTC
+--- src/osdep/unix/Makefile.orig	2022-04-17 00:12:02 UTC
 +++ src/osdep/unix/Makefile
 @@ -30,9 +30,9 @@
  
@@ -13,7 +13,7 @@
  
  
  # The optimization level here for GCC ports is set here for a reason.  It's
-@@ -56,13 +56,13 @@ GCC4CFLAGS= $(GCCCFLAGS) -Wno-pointer-si
+@@ -56,13 +56,13 @@ GCC4CFLAGS= $(GCCCFLAGS) -Wno-pointer-sign
  
  # Extended flags needed for SSL.  You may need to modify.
  
@@ -30,7 +30,7 @@
  
  # Older versions of MIT Kerberos also have a libcrypto.  If so, you may need
  # to use this instead
-@@ -89,7 +89,7 @@ AFSLDFLAGS=-L$(AFSLIB)/afs -L$(AFSLIB) -
+@@ -89,7 +89,7 @@ AFSLDFLAGS=-L$(AFSLIB)/afs -L$(AFSLIB) -L$(AFSDIR)/dom
  # AFSLDFLAGS may also need -L/usr/ucblib -lucb
  DCECFLAGS= -DDCE_MINIMAL -DPASSWD_OVERRIDE=\"/opt/pop3/passwd/passwd\"
  DCELDFLAGS= -ldce
@@ -48,7 +48,7 @@
  LN=ln -s
  RANLIB=ranlib
  
-@@ -156,7 +156,7 @@ BINARIES=osdep.o mail.o misc.o newsrc.o 
+@@ -156,7 +156,7 @@ BINARIES=osdep.o mail.o misc.o newsrc.o smanager.o utf
   dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
   rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
   unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o
@@ -57,8 +57,8 @@
  
  CAT=cat
  MAKE=make
-@@ -173,6 +173,10 @@ BUILD=$(MAKE) build EXTRACFLAGS='$(EXTRA
-  PASSWDTYPE=$(PASSWDTYPE) SSLTYPE=$(SSLTYPE) IP=$(IP)
+@@ -177,6 +177,10 @@ BUILD=$(MAKE) build EXTRACFLAGS='$(EXTRACFLAGS)'\
+ SOFILES=${BINARIES:.o=.so}
  
  
 +# Need this for the shared library rule to work correctly
@@ -68,7 +68,7 @@
  # Here if no make argument established
  
  missing: osdep.h
-@@ -261,13 +265,14 @@ bsd:	# BSD UNIX
+@@ -265,13 +269,14 @@ bsd:	# BSD UNIX
  	 BASECFLAGS="-g -Dconst="
  
  bsf:	# FreeBSD
@@ -85,68 +85,21 @@
  
  bsi:	# BSD/i386
  	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
-@@ -863,23 +868,31 @@ vu2:	# VAX Ultrix 2.3, etc.
+@@ -867,7 +872,7 @@ vu2:	# VAX Ultrix 2.3, etc.
  
  # Build it!
  
--build:	clean once $(ARCHIVE)
-+build:	clean once $(ARCHIVE) $(SHLIBNAME)
+-build:	clean once all
++build:	clean once all `$(CAT) SHLIBNAME`
  
--all:	$(ARCHIVE)
-+all:	$(ARCHIVE) $(SHLIBNAME)
+ all:	$(ARCHIVE) `$(CAT) SHLIBNAME`
  
- $(ARCHIVE): $(BINARIES)
- 	sh -c '$(RM) $(ARCHIVE) || true'
- 	@$(CAT) ./ARCHIVE
- 	@$(SH) ./ARCHIVE
- 
-+$(SHLIBNAME): $(SOFILES)
-+	$(CC) -shared -Wl,-soname=$(SHLIBNAME) -o $(SHLIBNAME) $(SOFILES) `cat LDFLAGS`
-+	$(LN) $(SHLIBNAME) lib$(SHLIBBASE).so
-+
-+.c.so: osdep.h
-+	$(CC) -fPIC -DPIC -c `cat CFLAGS` ${@:.so=.c} -o $@
-+
- .c.o:
--	`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c
-+	$(CC) -c `cat CFLAGS` $*.c
- 
- 
- # Cleanup
- 
- clean:
- 	sh -c '$(RM) auths.c crexcl.c ip_unix.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true'
-+	sh -c '$(RM) *.so $(SHLIBNAME)'
+@@ -881,7 +886,7 @@ $(ARCHIVE): $(BINARIES)
+ 	ln -fs `$(CAT) SHLIBNAME` libc-client.so
  
+ .c.so:	osdep.h
+-	`$(CAT) CCTYPE` `$(CAT) SHLIBFLAGS` -c `$(CAT) CFLAGS` ${@:.so=.c} -o $@
++	`$(CAT) CCTYPE` -fPIC -DPIC -c `$(CAT) SHLIBFLAGS` -c `$(CAT) CFLAGS` ${@:.so=.c} -o $@
  
- # Dependencies
-@@ -914,7 +927,7 @@ utf8aux.o: mail.h misc.h osdep.h utf8.h
- 
- # OS-dependent
- 
--osdep.o:mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
-+OSDEPS= mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \
- 	osdep.h env_unix.h tcp_unix.h \
- 	osdep.c env_unix.c fs_unix.c ftl_unix.c nl_unix.c tcp_unix.c ip_unix.c\
- 	auths.c crexcl.c flockcyg.c flocklnx.c flocksim.c fsync.c \
-@@ -928,12 +941,19 @@ osdep.o:mail.h misc.h env.h fs.h ftl.h n
- 	write.c sslstdio.c \
- 	strerror.c strpbrk.c strstr.c strtok.c strtoul.c \
- 	OSCFLAGS
-+
-+osdep.o: $(OSDEPS)
-+	$(CC) `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
-+	@echo ========================================================================
- 	@echo Building OS-dependent module
- 	@echo If you get No such file error messages for files x509.h, ssl.h,
- 	@echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL
- 	@echo is not installed on your system.  Either install OpenSSL first
- 	@echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none
--	`$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c
-+	@echo ========================================================================
-+
-+osdep.so: $(OSDEPS)
-+	$(CC) -fPIC -DPIC -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` osdep.c -o $@
- 
- osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c
- 	$(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c
+ .c.o:
+ 	`$(CAT) CCTYPE` `$(CAT) SHLIBFLAGS` -c `$(CAT) CFLAGS` $*.c
diff --git a/mail/panda-cclient/files/patch-src_osdep_unix_ssl__unix.c b/mail/panda-cclient/files/patch-src_osdep_unix_ssl__unix.c
deleted file mode 100644
index 15f471074d0b..000000000000
--- a/mail/panda-cclient/files/patch-src_osdep_unix_ssl__unix.c
+++ /dev/null
@@ -1,63 +0,0 @@
---- src/osdep/unix/ssl_unix.c.orig	2013-06-21 21:29:17 UTC
-+++ src/osdep/unix/ssl_unix.c
-@@ -22,6 +22,10 @@
-  *     http://www.apache.org/licenses/LICENSE-2.0
-  *
-  */
-+
-+/* Patch for OPENSSL_VERSION_NUMBER >= 0x10100000 obtained from
-+ * openembedded/meta-openembedded (on GitHub)
-+ */
- 
- #define crypt ssl_private_crypt
- #define STRING OPENSSL_STRING
-@@ -241,8 +245,16 @@ static char *ssl_start_work (SSLSTREAM *
- 				/* disable certificate validation? */
-   if (flags & NET_NOVALIDATECERT)
-     SSL_CTX_set_verify (stream->context,SSL_VERIFY_NONE,NIL);
--  else SSL_CTX_set_verify (stream->context,SSL_VERIFY_PEER,ssl_open_verify);
-+  else {
-+#if OPENSSL_VERSION_NUMBER >= 0x10100000
-+      X509_VERIFY_PARAM *param = SSL_CTX_get0_param(stream->context);
-+      X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
-+      X509_VERIFY_PARAM_set1_host(param, host, 0);
-+#endif
-+
-+      SSL_CTX_set_verify (stream->context,SSL_VERIFY_PEER,ssl_open_verify);
- 				/* set default paths to CAs... */
-+  }
-   SSL_CTX_set_default_verify_paths (stream->context);
- 				/* ...unless a non-standard path desired */
-   if (s = (char *) mail_parameters (NIL,GET_SSLCAPATH,NIL))
-@@ -280,6 +292,7 @@ static char *ssl_start_work (SSLSTREAM *
-   if (SSL_write (stream->con,"",0) < 0)
-     return ssl_last_error ? ssl_last_error : "SSL negotiation failed";
- 				/* need to validate host names? */
-+#if OPENSSL_VERSION_NUMBER < 0x10100000
-   if (!(flags & NET_NOVALIDATECERT) &&
-       (err = ssl_validate_cert (cert = SSL_get_peer_certificate (stream->con),
- 				host))) {
-@@ -289,6 +302,7 @@ static char *ssl_start_work (SSLSTREAM *
-     sprintf (tmp,"*%.128s: %.255s",err,cert ? cert->name : "???");
-     return ssl_last_error = cpystr (tmp);
-   }
-+#endif
-   return NIL;
- }
- 
-@@ -327,6 +341,7 @@ static int ssl_open_verify (int ok,X509_
-  * Returns: NIL if validated, else string of error message
-  */
- 
-+#if OPENSSL_VERSION_NUMBER < 0x10100000
- static char *ssl_validate_cert (X509 *cert,char *host)
- {
-   int i,n;
-@@ -356,6 +371,7 @@ static char *ssl_validate_cert (X509 *ce
-   else ret = "Unable to locate common name in certificate";
-   return ret;
- }
-+#endif
- 
- /* Case-independent wildcard pattern match
-  * Accepts: base string
diff --git a/mail/panda-cclient/pkg-plist b/mail/panda-cclient/pkg-plist
index f948c0970bee..f7f94f5f0b55 100644
--- a/mail/panda-cclient/pkg-plist
+++ b/mail/panda-cclient/pkg-plist
@@ -32,5 +32,5 @@ include/c-client/CFLAGS
 include/c-client/LDFLAGS
 include/c-client/OSCFLAGS
 lib/%%SHLIBNAME%%
-lib/libc-client4.a
-lib/libc-client4.so
+lib/libc-client.a
+lib/libc-client.so