diff options
author | marino <marino@FreeBSD.org> | 2014-08-14 22:59:26 +0800 |
---|---|---|
committer | marino <marino@FreeBSD.org> | 2014-08-14 22:59:26 +0800 |
commit | 7f07bbdffb433e0879fbe2d9beddb13486105f5c (patch) | |
tree | fb523dfc935713d5600473cb7cfe4e1071edcbcb | |
parent | c96cb873ec9e12e834192bfb2e7a47f22f196978 (diff) | |
download | freebsd-ports-gnome-7f07bbdffb433e0879fbe2d9beddb13486105f5c.tar.gz freebsd-ports-gnome-7f07bbdffb433e0879fbe2d9beddb13486105f5c.tar.zst freebsd-ports-gnome-7f07bbdffb433e0879fbe2d9beddb13486105f5c.zip |
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
15 files changed, 107 insertions, 97 deletions
diff --git a/mail/mailagent/Makefile b/mail/mailagent/Makefile index 9fd3274daac0..974993748a90 100644 --- a/mail/mailagent/Makefile +++ b/mail/mailagent/Makefile @@ -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> diff --git a/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_Makefile.SH b/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_Makefile.SH index dec69898cb5e..ac898bbdcf2c 100644 --- a/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_Makefile.SH +++ b/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_Makefile.SH @@ -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 diff --git a/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_utmp.pl b/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_utmp.pl index 50cdf1195c9f..0d4ee40a63a5 100644 --- a/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_utmp.pl +++ b/mail/mailagent/files/extra-patch-utmpx-agent_pl_utmp_utmp.pl @@ -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 diff --git a/mail/mailagent/files/patch-agent-Makefile.SH b/mail/mailagent/files/patch-agent-Makefile.SH new file mode 100644 index 000000000000..5444fecd58fd --- /dev/null +++ b/mail/mailagent/files/patch-agent-Makefile.SH @@ -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! diff --git a/mail/mailagent/files/patch-agent-examples-Makefile b/mail/mailagent/files/patch-agent-examples-Makefile.SH index 2ca97d6eb39e..68908ebe626f 100644 --- a/mail/mailagent/files/patch-agent-examples-Makefile +++ b/mail/mailagent/files/patch-agent-examples-Makefile.SH @@ -1,15 +1,15 @@ ---- agent/examples/Makefile.orig 2014-06-20 11:31:53.597110451 -0300 -+++ agent/examples/Makefile 2014-06-20 11:32:15.393108703 -0300 -@@ -54,7 +54,7 @@ +--- ./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 $$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \ ++ (set -x; test -d $(INSTALL_PREFIX)$$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \ done deinstall:: -@@ -63,7 +63,7 @@ +@@ -93,7 +93,7 @@ install:: $(FILES) @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for i in $(FILES); do \ diff --git a/mail/mailagent/files/patch-agent-files-Makefile b/mail/mailagent/files/patch-agent-files-Makefile.SH index 784c9f80524e..2c510ea82eb3 100644 --- a/mail/mailagent/files/patch-agent-files-Makefile +++ b/mail/mailagent/files/patch-agent-files-Makefile.SH @@ -1,15 +1,15 @@ ---- agent/files/Makefile.orig 2014-06-20 11:29:40.559119965 -0300 -+++ agent/files/Makefile 2014-06-20 11:30:00.539568981 -0300 -@@ -58,7 +58,7 @@ +--- ./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 $$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \ ++ (set -x; test -d $(INSTALL_PREFIX)$$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \ done deinstall:: -@@ -67,7 +67,7 @@ +@@ -96,7 +96,7 @@ install:: $(FILES) @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for i in $(FILES); do \ diff --git a/mail/mailagent/files/patch-agent-files-help-Makefile b/mail/mailagent/files/patch-agent-files-help-Makefile.SH index b1594efd05aa..fe38b7453ca2 100644 --- a/mail/mailagent/files/patch-agent-files-help-Makefile +++ b/mail/mailagent/files/patch-agent-files-help-Makefile.SH @@ -1,15 +1,15 @@ ---- agent/files/help/Makefile.orig 2014-06-20 11:30:51.718114891 -0300 -+++ agent/files/help/Makefile 2014-06-20 11:31:10.122113536 -0300 -@@ -99,7 +99,7 @@ +--- ./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 $$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \ ++ (set -x; test -d $(INSTALL_PREFIX)$$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \ done deinstall:: -@@ -108,7 +108,7 @@ +@@ -138,7 +138,7 @@ install:: $(FILES) @case '${MFLAGS}' in *[i]*) set +e;; esac; \ for i in $(FILES); do \ diff --git a/mail/mailagent/files/patch-agent-filter-Makefile b/mail/mailagent/files/patch-agent-filter-Makefile.SH index 0d0d5ba7f0e0..4ab52e5d7acb 100644 --- a/mail/mailagent/files/patch-agent-filter-Makefile +++ b/mail/mailagent/files/patch-agent-filter-Makefile.SH @@ -1,11 +1,11 @@ ---- agent/filter/Makefile.orig 2014-06-20 11:27:19.802128926 -0300 -+++ agent/filter/Makefile 2014-06-20 11:29:16.092184615 -0300 -@@ -124,14 +124,14 @@ +--- ./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 $$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \ ++ (set -x; test -d $(INSTALL_PREFIX)$$dir || $(INSTALLDIR) $(INSTALL_PREFIX)$$dir); \ done deinstall:: diff --git a/mail/mailagent/files/patch-agent-filter-io.c b/mail/mailagent/files/patch-agent-filter-io.c index ab4f26f2f2aa..77f213059c94 100644 --- a/mail/mailagent/files/patch-agent-filter-io.c +++ b/mail/mailagent/files/patch-agent-filter-io.c @@ -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) diff --git a/mail/mailagent/files/patch-agent-filter-logfile.c b/mail/mailagent/files/patch-agent-filter-logfile.c index 60a0bcbc130a..9d34c44b9be1 100644 --- a/mail/mailagent/files/patch-agent-filter-logfile.c +++ b/mail/mailagent/files/patch-agent-filter-logfile.c @@ -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> diff --git a/mail/mailagent/files/patch-agent-magent.sh b/mail/mailagent/files/patch-agent-magent.sh new file mode 100644 index 000000000000..3d4fab17ef2f --- /dev/null +++ b/mail/mailagent/files/patch-agent-magent.sh @@ -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'; diff --git a/mail/mailagent/files/patch-agent-man-Makefile.SH b/mail/mailagent/files/patch-agent-man-Makefile.SH index 9e4bb2cc9fcd..127a8166a291 100644 --- a/mail/mailagent/files/patch-agent-man-Makefile.SH +++ b/mail/mailagent/files/patch-agent-man-Makefile.SH @@ -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. # diff --git a/mail/mailagent/files/pkg-message.in b/mail/mailagent/files/pkg-message.in new file mode 100644 index 000000000000..554b7d8fce1d --- /dev/null +++ b/mail/mailagent/files/pkg-message.in @@ -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. + diff --git a/mail/mailagent/pkg-plist b/mail/mailagent/pkg-plist index f6ec757deebd..23e44a02eedd 100644 --- a/mail/mailagent/pkg-plist +++ b/mail/mailagent/pkg-plist @@ -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 diff --git a/mail/mailagent/scripts/pre-configure b/mail/mailagent/scripts/pre-configure deleted file mode 100644 index a08a67bcb6ba..000000000000 --- a/mail/mailagent/scripts/pre-configure +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# Pre-configure script for mailagent. -# This script asks for information specific to the machine and writes -# given values to work/mailagent-3.0/config.sh to set the default -# values for COnfigure script so that Configure doesn't request any -# input. - -while [ X$addr = X ]; do - read -p "Enter your complete E-mail address> " addr -done - -while [ X$host = X ]; do - read -p "Enter fully qualified name of this host (`hostname`)> " host - if [ X$host = X ]; then - host=`hostname` - fi -done - -maildomain=`echo $addr | awk -F@ '{printf("%s", $2)}'` -if [ `echo $maildomain | tr A-Z a-z` = `echo $host | tr A-Z a-z` ]; then - d_hidnet=undef - hiddennet='' -else - d_hidnet=define - hiddennet=$maildomain -fi - -read -p "Enter the name of your organization> " orgname - -cat >${WRKSRC}/config.sh <<EOM -#!/bin/sh -cf_email='$addr' -d_flockonly='define' -d_hidnet='$d_hidnet' -hiddennet='$hiddennet' -orgname='$orgname' -EOM |