[PATCH] Fixes for mail/dspam-devel port on recent FreeBSD-STABLE

As of this writing, the mail/dspam-devel port will fail to build on a recent FreeBSD-STABLE due to changes in the port options infrastructure, as well as ctime.pl being removed from Perl. The following patches take care of these problems, and they also add a few web UI files that have been missing from the makefile for a long time.

Makefile

--- Makefile.orig	2013-09-07 20:02:47.000000000 -0500
+++ Makefile	2013-09-07 20:03:27.000000000 -0500
@@ -253,7 +253,7 @@
 PLIST_SUB+=	HASH="@comment "
 .endif

-.ifdef(WITH_MYSQL51)
+.if ${PORT_OPTIONS:MMYSQL51}
 WANT_MYSQL_VER=	51
 #PKGNAMESUFFIX=	-mysql51
 .elif ${PORT_OPTIONS:MMYSQL55}
@@ -261,7 +261,7 @@
 #PKGNAMESUFFIX=	-mysql55
 .endif

-.if defined(WITH_MYSQL51) || defined(WITH_MYSQL55)
+.if ${PORT_OPTIONS:MMYSQL51} || ${PORT_OPTIONS:MMYSQL55}
 USE_MYSQL=	yes
 CONFIGURE_ARGS+=	--with-mysql-includes=${LOCALBASE}/include/mysql \
 		--with-mysql-libraries=${LOCALBASE}/lib/mysql
@@ -340,10 +340,10 @@
 CONFIGURE_ARGS+=	--with-delivery-agent='${LOCALBASE}/cyrus/bin/deliver'
 .endif

-.ifdef(WITH_EXIM_LDA)
-.	ifdef(WITH_MYSQL51) || (WITH_MYSQL55)
+.if ${PORT_OPTIONS:MEXIM}
+.	if ${PORT_OPTIONS:MMYSQL51} || ${PORT_OPTIONS:MMYSQL55}
 _EXIM_EXT=	-mysql
-.	elifdef(WITH_POSTGRESQL)
+.	elif ${PORT_OPTIONS:MPGSQL}
 _EXIM_EXT=	-postgresql
 .	endif
 RUN_DEPENDS+=	exim:${PORTSDIR}/mail/exim${_EXIM_EXT}
@@ -496,12 +496,12 @@
 	@${ECHO_CMD} "You need MySQL, PostgreSQL or Hash for Daemon mode, because multithreading support is needed"
 	@${FALSE}
 .endif
-.if (defined(WITH_MYSQL51) && defined(WITH_MYSQL55))
+.if ${PORT_OPTIONS:MMYSQL51} && ${PORT_OPTIONS:MMYSQL55}
 	@${ECHO_CMD} "You can compile with only one MySQL version driver."
 	@${FALSE}
 .endif
-.if defined(WITH_EXTERNAL_LOOKUP) && !( defined(USE_MYSQL) || \
-	!defined(WITHOUT_POSTGRESQL) || defined(USE_SQLITE) )
+.if ${PORT_OPTIONS:MEXTERNAL_LOOKUP} && !( defined(USE_MYSQL) || \
+	${PORT_OPTIONS:MPGSQL} || defined(USE_SQLITE) )
 	@${ECHO_CMD} "You need MySQL, Postgres or SQLITE for EXTERNAL_LOOKUP."
 	@${FALSE}
 .endif
@@ -570,7 +570,7 @@
 		${INSTALL_SCRIPT} *.cgi ${WWWDIR} && \
 		${INSTALL_DATA} rgb.txt ${WWWDIR}/
 	cd ${WRKSRC}/webui/htdocs && \
-		${INSTALL_DATA} base.css dspam-logo-small.gif ${WWWDIR}/
+		${INSTALL_DATA} base.css dspam-logo-small.gif dspam.js favicon.ico rtl.css ${WWWDIR}/
 	cd ${WRKSRC}/webui/cgi-bin && \
 		${INSTALL_DATA} default.prefs ${WWWDIR}/default.prefs.sample
 	cd ${WRKSRC}/webui/cgi-bin && \

Web UI

--- admin.cgi.orig	2013-09-07 20:05:06.000000000 -0500
+++ admin.cgi	2013-09-07 20:06:24.000000000 -0500
@@ -20,7 +20,6 @@
 use strict;
 use Time::Local;
 use vars qw { %CONFIG %DATA %FORM %LANG $LANGUAGE };
-require "ctime.pl";

 #
 # Read configuration parameters common to all CGI scripts
--- dspam.cgi.orig	2013-09-07 20:05:06.000000000 -0500
+++ dspam.cgi	2013-09-07 20:06:56.000000000 -0500
@@ -18,12 +18,11 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.

 use strict;
+use POSIX;
 use Time::Local;
 use vars qw { %CONFIG %DATA %FORM %LANG $MAILBOX $CURRENT_USER $USER $TMPFILE $USERSELECT };
 use vars qw { $CURRENT_STORE $LANGUAGE };

-require "ctime.pl";
-
 #
 # Read configuration parameters common to all CGI scripts
 #
@@ -36,10 +35,6 @@
 }
 require "configure.pl";

-if($CONFIG{"DATE_FORMAT"}) {
-  use POSIX qw(strftime);
-}
-
 #
 # The current CGI script
 #

Leave a Reply

Your email address will not be published. Required fields are marked *