Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 2014 14:59:26 +0000 (UTC)
From:      John Marino <marino@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r364848 - in head/mail/mailagent: . files scripts
Message-ID:  <201408141459.s7EExQ2x037264@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marino
Date: Thu Aug 14 14:59:26 2014
New Revision: 364848
URL: http://svnweb.freebsd.org/changeset/ports/364848
QAT: https://qat.redports.org/buildarchive/r364848/

Log:
  Convert mail/mailagent from an interactive to a regular port
  
  This PR saved this unmaintained port from the chopping block next week.
  
  PR:		196642
  Submitted by:	Yoshiaki Kasahara

Added:
  head/mail/mailagent/files/patch-agent-Makefile.SH   (contents, props changed)
  head/mail/mailagent/files/patch-agent-examples-Makefile.SH   (contents, props changed)
  head/mail/mailagent/files/patch-agent-files-Makefile.SH   (contents, props changed)
  head/mail/mailagent/files/patch-agent-files-help-Makefile.SH   (contents, props changed)
  head/mail/mailagent/files/patch-agent-filter-Makefile.SH   (contents, props changed)
  head/mail/mailagent/files/patch-agent-magent.sh   (contents, props changed)
  head/mail/mailagent/files/pkg-message.in   (contents, props changed)
Deleted:
  head/mail/mailagent/files/patch-agent-examples-Makefile
  head/mail/mailagent/files/patch-agent-files-Makefile
  head/mail/mailagent/files/patch-agent-files-help-Makefile
  head/mail/mailagent/files/patch-agent-filter-Makefile
  head/mail/mailagent/scripts/
Modified:
  head/mail/mailagent/Makefile
  head/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_Makefile.SH
  head/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_utmp.pl
  head/mail/mailagent/files/patch-agent-filter-io.c
  head/mail/mailagent/files/patch-agent-filter-logfile.c
  head/mail/mailagent/files/patch-agent-man-Makefile.SH
  head/mail/mailagent/pkg-plist

Modified: head/mail/mailagent/Makefile
==============================================================================
--- head/mail/mailagent/Makefile	Thu Aug 14 14:58:52 2014	(r364847)
+++ head/mail/mailagent/Makefile	Thu Aug 14 14:59:26 2014	(r364848)
@@ -3,19 +3,17 @@
 
 PORTNAME=		mailagent
 PORTVERSION=		3.1.78
+PORTREVISION=		1
 CATEGORIES=		mail
 MASTER_SITES=		http://eron.info/
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Sophisticated automatic mail-processing tool
 
-DEPRECATED=	Unmaintained interactive port
-EXPIRATION_DATE=2014-08-20
-
 USES=		perl5 tar:bzip2
 
-NO_PACKAGE=	Correct FQDN needs to be hardcoded
-IS_INTERACTIVE=		yes
+ORGFILE=	${PREFIX}/etc/mailagent.orgname
+
 HAS_CONFIGURE=		yes
 CONFIGURE_SCRIPT=	Configure
 CONFIGURE_ARGS=		-dres \
@@ -23,12 +21,17 @@ CONFIGURE_ARGS=		-dres \
 			-Dccflags='${CFLAGS}' \
 			-Dd_flockonly='define' \
 			-Dutmp='/var/run/utmp' \
+			-Dorgname='${ORGFILE}' \
 			-Dprefix='${PREFIX}' \
 			-Dmansrc='${STAGEDIR}${PREFIX}/man/man1'
 MAKE_JOBS_UNSAFE=	yes
 MAKE_ENV=	PATH=`dirname ${PERL5}`:${PATH} INSTALL_PREFIX=${STAGEDIR}
 INSTALL_TARGET=	install install.man
 
+SUB_LIST+=	ORGFILE="${ORGFILE}"
+SUB_FILES=	pkg-message
+PLIST_SUB+=	ORGFILE="${ORGFILE}"
+
 .include <bsd.port.pre.mk>
 .if ${OSVERSION} > 900006
 EXTRA_PATCHES=	${PATCHDIR}/extra-patch-utmpx-agent_pl_utmp_utmp.pl \
@@ -40,9 +43,6 @@ pre-extract:
 	  ${ECHO} "Please set umask to 022 before running make,"; \
 	  ${ECHO} "or mailagent will not build successfully."; \
 	  ${FALSE}; fi
-	@if [ `id -u` = 0 ]; then \
-	  ${ECHO} "Do not build mailagent as root or it won't pass the sanity tests."; \
-	  ${FALSE}; fi
 
 post-patch:
 	@(cd ${WRKSRC}; \
@@ -53,9 +53,18 @@ post-patch:
 	    bin/perload misc/getcost/getcost misc/mime/unmime \
 	    misc/news/newsgate)
 
+TEST_CMD=	'(cd ${WRKSRC}/agent/test; ${SETENV} ${MAKE_ENV} ${MAKE})'
+post-build:
+	@if [ `${ID} -u` = 0 ]; then \
+	  ${CHOWN} -R nobody ${WRKSRC}/agent/test; \
+	  su -m nobody -c ${TEST_CMD}; \
+	else \
+	  ${SH} -c ${TEST_CMD}; \
+	fi
+
 post-install:
 	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/misc
-	${CP} -pR ${WRKSRC}/misc/* ${STAGEDIR}${EXAMPLESDIR}/misc
-	@${LN} -fs ${PREFIX}/lib/mailagent/examples ${STAGEDIR}${EXAMPLESDIR}/agent
+	cd ${WRKSRC}/misc && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}/misc
+	${MV} ${STAGEDIR}${PREFIX}/lib/mailagent/examples ${STAGEDIR}${EXAMPLESDIR}/agent
 
 .include <bsd.port.post.mk>

Modified: head/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_Makefile.SH
==============================================================================
--- head/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_Makefile.SH	Thu Aug 14 14:58:52 2014	(r364847)
+++ head/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_Makefile.SH	Thu Aug 14 14:59:26 2014	(r364848)
@@ -1,5 +1,5 @@
---- ../mailagent-3.1.77/agent/pl/utmp/Makefile.SH	2006-08-24 22:24:12.354556000 +0900
-+++ agent/pl/utmp/Makefile.SH	2012-01-19 17:37:50.697895588 +0900
+--- ./agent/pl/utmp/Makefile.SH.orig	2006-08-24 22:24:12.000000000 +0900
++++ ./agent/pl/utmp/Makefile.SH	2014-08-14 01:59:33.508704927 +0900
 @@ -107,7 +107,6 @@
  	cp Makefile.new Makefile
  	$(RM) Makefile.new

Modified: head/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_utmp.pl
==============================================================================
--- head/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_utmp.pl	Thu Aug 14 14:58:52 2014	(r364847)
+++ head/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_utmp.pl	Thu Aug 14 14:59:26 2014	(r364848)
@@ -1,5 +1,5 @@
---- /dev/null	2012-01-19 17:47:14.000000000 +0900
-+++ agent/pl/utmp/utmp.pl	2012-01-19 17:53:06.536872534 +0900
+--- ./agent/pl/utmp/utmp.pl.orig	2014-08-14 01:59:33.506704776 +0900
++++ ./agent/pl/utmp/utmp.pl	2014-08-14 01:59:33.506704776 +0900
 @@ -0,0 +1,22 @@
 +#
 +# utmp file primitives

Added: head/mail/mailagent/files/patch-agent-Makefile.SH
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/mailagent/files/patch-agent-Makefile.SH	Thu Aug 14 14:59:26 2014	(r364848)
@@ -0,0 +1,11 @@
+--- ./agent/Makefile.SH.orig	2008-08-19 17:48:44.000000000 +0900
++++ ./agent/Makefile.SH	2014-08-14 01:59:33.510702714 +0900
+@@ -53,7 +53,7 @@
+ ########################################################################
+ # Automatically generated parameters -- do not edit
+ 
+-SUBDIRS = pl filter files man test examples
++SUBDIRS = pl filter files man examples
+ SCRIPTS =  \$(BIN)
+ 
+ !GROK!THIS!

Added: head/mail/mailagent/files/patch-agent-examples-Makefile.SH
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/mailagent/files/patch-agent-examples-Makefile.SH	Thu Aug 14 14:59:26 2014	(r364848)
@@ -0,0 +1,20 @@
+--- ./agent/examples/Makefile.SH.orig	2006-08-24 22:24:12.000000000 +0900
++++ ./agent/examples/Makefile.SH	2014-08-14 01:59:33.512702931 +0900
+@@ -84,7 +84,7 @@
+ install::
+ 	@for dir in $(PRIVLIB)/examples; do \
+ 	case '${MFLAGS}' in *[i]*) set +e;; esac; \
+-	(set -x; test -d $$dir || $(INSTALLDIR) $$dir); \
++	(set -x; test -d $(INSTALL_PREFIX)$$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \
+ 	done
+ 
+ deinstall::
+@@ -93,7 +93,7 @@
+ install:: $(FILES)
+ 	@case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ 	for i in $(FILES); do \
+-	(set -x; $(INSTALL) -c -m 444 $$i $(PRIVLIB)/examples); \
++	(set -x; $(INSTALL) -c -m 444 $$i $(INSTALL_PREFIX)$(PRIVLIB)/examples); \
+ 	done
+ 
+ deinstall::

Added: head/mail/mailagent/files/patch-agent-files-Makefile.SH
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/mailagent/files/patch-agent-files-Makefile.SH	Thu Aug 14 14:59:26 2014	(r364848)
@@ -0,0 +1,20 @@
+--- ./agent/files/Makefile.SH.orig	2006-08-24 22:24:12.000000000 +0900
++++ ./agent/files/Makefile.SH	2014-08-14 01:59:33.532955007 +0900
+@@ -87,7 +87,7 @@
+ install::
+ 	@for dir in $(PRIVLIB); do \
+ 	case '${MFLAGS}' in *[i]*) set +e;; esac; \
+-	(set -x; test -d $$dir || $(INSTALLDIR) $$dir); \
++	(set -x; test -d $(INSTALL_PREFIX)$$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \
+ 	done
+ 
+ deinstall::
+@@ -96,7 +96,7 @@
+ install:: $(FILES)
+ 	@case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ 	for i in $(FILES); do \
+-	(set -x; $(INSTALL) -c -m 444 $$i $(PRIVLIB)); \
++	(set -x; $(INSTALL) -c -m 444 $$i $(INSTALL_PREFIX)$(PRIVLIB)); \
+ 	done
+ 
+ deinstall::

Added: head/mail/mailagent/files/patch-agent-files-help-Makefile.SH
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/mailagent/files/patch-agent-files-help-Makefile.SH	Thu Aug 14 14:59:26 2014	(r364848)
@@ -0,0 +1,20 @@
+--- ./agent/files/help/Makefile.SH.orig	2006-08-24 22:24:12.000000000 +0900
++++ ./agent/files/help/Makefile.SH	2014-08-14 01:59:33.534704805 +0900
+@@ -129,7 +129,7 @@
+ install::
+ 	@for dir in $(PRIVLIB) $(PRIVLIB)/help; do \
+ 		case '${MFLAGS}' in *[i]*) set +e;; esac; \
+-		(set -x; test -d $$dir || $(INSTALLDIR) $$dir); \
++		(set -x; test -d $(INSTALL_PREFIX)$$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \
+ 	done
+ 
+ deinstall::
+@@ -138,7 +138,7 @@
+ install:: $(FILES)
+ 	@case '${MFLAGS}' in *[i]*) set +e;; esac; \
+ 	for i in $(FILES); do \
+-		(set -x; $(INSTALL) -c -m 444 $$i $(PRIVLIB)/help); \
++		(set -x; $(INSTALL) -c -m 444 $$i $(INSTALL_PREFIX)$(PRIVLIB)/help); \
+ 	done
+ 
+ deinstall::

Added: head/mail/mailagent/files/patch-agent-filter-Makefile.SH
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/mailagent/files/patch-agent-filter-Makefile.SH	Thu Aug 14 14:59:26 2014	(r364848)
@@ -0,0 +1,19 @@
+--- ./agent/filter/Makefile.SH.orig	2006-08-24 22:24:12.000000000 +0900
++++ ./agent/filter/Makefile.SH	2014-08-14 01:59:33.536704870 +0900
+@@ -154,14 +154,14 @@
+ install::
+ 	@for dir in $(PRIVLIB); do \
+ 	case '${MFLAGS}' in *[i]*) set +e;; esac; \
+-	(set -x; test -d $$dir || $(INSTALLDIR) $$dir); \
++	(set -x; test -d $(INSTALL_PREFIX)$$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \
+ 	done
+ 
+ deinstall::
+ 	$(RM) -r $(PRIVLIB)
+ 
+ install:: filter
+-	$(INSTALL) -c -s -m 555  filter $(PRIVLIB)
++	$(INSTALL) -c -s -m 555  filter $(INSTALL_PREFIX)$(PRIVLIB)
+ 
+ deinstall::
+ 	$(RM) $(PRIVLIB)/filter

Modified: head/mail/mailagent/files/patch-agent-filter-io.c
==============================================================================
--- head/mail/mailagent/files/patch-agent-filter-io.c	Thu Aug 14 14:58:52 2014	(r364847)
+++ head/mail/mailagent/files/patch-agent-filter-io.c	Thu Aug 14 14:59:26 2014	(r364848)
@@ -1,6 +1,6 @@
---- agent/filter/io.c.orig	Wed Jul 29 02:41:11 1998
-+++ agent/filter/io.c	Mon Aug 10 21:01:22 1998
-@@ -120,6 +120,9 @@
+--- ./agent/filter/io.c.orig	2008-08-19 17:44:07.000000000 +0900
++++ ./agent/filter/io.c	2014-08-14 01:59:33.537704696 +0900
+@@ -141,6 +141,9 @@
  #ifdef I_SYS_IOCTL
  #include <sys/ioctl.h>
  #endif
@@ -10,9 +10,9 @@
  
  /*
   * The following should be defined in <sys/stat.h>.
-@@ -713,7 +716,7 @@
+@@ -739,7 +742,7 @@
  	 */
- 	
+ 
  	char **envp;			/* Environment pointer */
 -#ifdef UNION_WAIT
 +#if defined(UNION_WAIT) && (!defined(BSD) || BSD < 199306)

Modified: head/mail/mailagent/files/patch-agent-filter-logfile.c
==============================================================================
--- head/mail/mailagent/files/patch-agent-filter-logfile.c	Thu Aug 14 14:58:52 2014	(r364847)
+++ head/mail/mailagent/files/patch-agent-filter-logfile.c	Thu Aug 14 14:59:26 2014	(r364848)
@@ -1,8 +1,8 @@
---- agent/filter/logfile.c.orig Fri Mar 17 12:59:44 2006
-+++ agent/filter/logfile.c      Fri Mar 17 13:02:25 2006
-@@ -47,6 +47,12 @@
- #include <stdio.h>
- #include <sys/types.h>
+--- ./agent/filter/logfile.c.orig	2008-08-19 17:44:07.000000000 +0900
++++ ./agent/filter/logfile.c	2014-08-14 01:59:33.539704490 +0900
+@@ -58,6 +58,12 @@
+ #endif
+ #endif	/* I_STDLIB */
  
 +#ifdef I_STRING
 +#include <string.h>

Added: head/mail/mailagent/files/patch-agent-magent.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/mailagent/files/patch-agent-magent.sh	Thu Aug 14 14:59:26 2014	(r364848)
@@ -0,0 +1,15 @@
+--- ./agent/magent.sh.orig	2011-12-23 07:44:07.000000000 +0900
++++ ./agent/magent.sh	2014-08-14 01:59:33.545705026 +0900
+@@ -116,10 +116,10 @@
+ \$phostname = '$phostname';
+ 
+ # Our domain name
+-\$mydomain = '$mydomain';
++\$mydomain = '';
+ 
+ # Hidden network (advertised host)
+-\$hiddennet = '$hiddennet';
++\$hiddennet = '';
+ 
+ # Directory where mail is spooled
+ \$maildir = '$maildir';

Modified: head/mail/mailagent/files/patch-agent-man-Makefile.SH
==============================================================================
--- head/mail/mailagent/files/patch-agent-man-Makefile.SH	Thu Aug 14 14:58:52 2014	(r364847)
+++ head/mail/mailagent/files/patch-agent-man-Makefile.SH	Thu Aug 14 14:59:26 2014	(r364848)
@@ -1,5 +1,5 @@
---- agent/man/Makefile.SH.orig	Sun Mar 18 03:31:22 2001
-+++ agent/man/Makefile.SH	Tue Sep  3 07:51:50 2002
+--- ./agent/man/Makefile.SH.orig	2006-08-24 22:24:12.000000000 +0900
++++ ./agent/man/Makefile.SH	2014-08-14 01:59:33.542700970 +0900
 @@ -85,8 +85,7 @@
  # Baseline for mailagent 3.0 netwide release.
  #

Added: head/mail/mailagent/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/mailagent/files/pkg-message.in	Thu Aug 14 14:59:26 2014	(r364848)
@@ -0,0 +1,15 @@
+** Upgrade note from a previous version to mailagent-3.1.78_1 or later **
+
+In order to make building of this port non-interactive, the build-time
+manual configuration of FQDN and the organization name had been removed.
+
+Now you need to specify your domain's FQDN properly in ~/.mailagent file.
+
+Please run "mailagent -I" to make sure your ~/.mailagent is up-to-date,
+and set "domain" and "hidenet" configuration options appropriately.
+Please consult mailagent(1) for more details.
+
+This package is configured to read %%ORGFILE%%
+file to retrieve the name of your organization.  An empty file had been
+installed to suppress warning messages.  Please modify as necessary.
+

Modified: head/mail/mailagent/pkg-plist
==============================================================================
--- head/mail/mailagent/pkg-plist	Thu Aug 14 14:58:52 2014	(r364847)
+++ head/mail/mailagent/pkg-plist	Thu Aug 14 14:59:26 2014	(r364848)
@@ -30,19 +30,21 @@ lib/mailagent/help/remauth
 lib/mailagent/help/set
 lib/mailagent/help/setauth
 lib/mailagent/help/user
-lib/mailagent/examples/README
-lib/mailagent/examples/daemon
-lib/mailagent/examples/mailfolders
-lib/mailagent/examples/mchk
-lib/mailagent/examples/mhinc
-lib/mailagent/examples/nocmds
-lib/mailagent/examples/profile
-lib/mailagent/examples/rules
-lib/mailagent/examples/vacation
 man/man1/edusers.1.gz
 man/man1/mailagent.1.gz
 man/man1/mailhelp.1.gz
 man/man1/package.1.gz
+@exec [ -f %%ORGFILE%% ] || touch %%ORGFILE%% || true
+@unexec [ -s %%ORGFILE%% ] || rm -f %%ORGFILE%% || true
+%%EXAMPLESDIR%%/agent/README
+%%EXAMPLESDIR%%/agent/daemon
+%%EXAMPLESDIR%%/agent/mailfolders
+%%EXAMPLESDIR%%/agent/mchk
+%%EXAMPLESDIR%%/agent/mhinc
+%%EXAMPLESDIR%%/agent/nocmds
+%%EXAMPLESDIR%%/agent/profile
+%%EXAMPLESDIR%%/agent/rules
+%%EXAMPLESDIR%%/agent/vacation
 %%EXAMPLESDIR%%/misc/README
 %%EXAMPLESDIR%%/misc/fakesend/README
 %%EXAMPLESDIR%%/misc/fakesend/fakesend.pl
@@ -50,17 +52,14 @@ man/man1/package.1.gz
 %%EXAMPLESDIR%%/misc/fakesend/mh_profile
 %%EXAMPLESDIR%%/misc/getcost/README
 %%EXAMPLESDIR%%/misc/getcost/getcost
-%%EXAMPLESDIR%%/misc/getcost/getcost.bak
 %%EXAMPLESDIR%%/misc/getcost/rules
 %%EXAMPLESDIR%%/misc/getcost/spamconfig
 %%EXAMPLESDIR%%/misc/mime/README
 %%EXAMPLESDIR%%/misc/mime/rules
 %%EXAMPLESDIR%%/misc/mime/unmime
-%%EXAMPLESDIR%%/misc/mime/unmime.bak
 %%EXAMPLESDIR%%/misc/news/README
 %%EXAMPLESDIR%%/misc/news/ml.map
 %%EXAMPLESDIR%%/misc/news/newsgate
-%%EXAMPLESDIR%%/misc/news/newsgate.bak
 %%EXAMPLESDIR%%/misc/news/rules
 %%EXAMPLESDIR%%/misc/pbounce/README
 %%EXAMPLESDIR%%/misc/pbounce/mailagent.cf
@@ -76,8 +75,7 @@ man/man1/package.1.gz
 %%EXAMPLESDIR%%/misc/unkit/newcmd.cf
 %%EXAMPLESDIR%%/misc/unkit/rules
 %%EXAMPLESDIR%%/misc/unkit/unkit.pl
-@exec /bin/ln -sf %D/lib/mailagent/examples %D/%%EXAMPLESDIR%%/agent
-@unexec /bin/rm -f %D/%%EXAMPLESDIR%%/agent
+@dirrm %%EXAMPLESDIR%%/agent
 @dirrm %%EXAMPLESDIR%%/misc/unkit
 @dirrm %%EXAMPLESDIR%%/misc/shell
 @dirrm %%EXAMPLESDIR%%/misc/pbounce
@@ -87,6 +85,5 @@ man/man1/package.1.gz
 @dirrm %%EXAMPLESDIR%%/misc/fakesend
 @dirrm %%EXAMPLESDIR%%/misc
 @dirrm %%EXAMPLESDIR%%
-@dirrm lib/mailagent/examples
 @dirrm lib/mailagent/help
 @dirrm lib/mailagent



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408141459.s7EExQ2x037264>