Make port build, install and run as package.
Give warning upon installing, majordomo is legacy. PR: 104686 Submitted by: erwin, anders
This commit is contained in:
parent
6f5888d23a
commit
8a3af76424
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=186314
7 changed files with 129 additions and 119 deletions
|
@ -7,12 +7,12 @@
|
|||
|
||||
PORTNAME= majordomo
|
||||
PORTVERSION= 1.94.5
|
||||
PORTREVISION= 2
|
||||
PORTREVISION= 3
|
||||
CATEGORIES= mail
|
||||
MASTER_SITES= ftp://ftp.nuug.no/pub/anders/distfiles/ \
|
||||
ftp://ftp.sgi.com/other/majordomo/1.94.5/ \
|
||||
ftp://ftp.greatcircle.com/pub/majordomo/1.94.5/
|
||||
EXTRACT_SUFX= .tgz
|
||||
EXTRACT_SUFX= .tgz
|
||||
|
||||
MAINTAINER= anders@FreeBSD.org
|
||||
COMMENT= A mailing list manager
|
||||
|
@ -25,13 +25,16 @@ RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Dig
|
|||
|
||||
USE_PERL5= yes
|
||||
|
||||
# Needs to create a user and group
|
||||
IS_INTERACTIVE= yes
|
||||
NO_PACKAGE= "User and group need to be created"
|
||||
ALL_TARGET= wrapper
|
||||
INSTALL_TARGET= install install-wrapper
|
||||
MAN1= approve.1 bounce-remind.1 digest.1
|
||||
MAN8= majordomo.8
|
||||
PKGMESSAGE= ${FILESDIR}/post-install-notes
|
||||
|
||||
pre-fetch:
|
||||
.if !defined(BATCH) && !defined(PACKAGE_BUILDING)
|
||||
${DIALOG} --yesno "WARNING: Majordomo is a really old mail list manager. The last version was released in january 2000, and there does not seem to be any updates coming. You might want to consider using mailman instead. Are you sure you want to install majordomo?" 8 70 no || ${FALSE}
|
||||
.endif
|
||||
|
||||
post-patch:
|
||||
.if defined(WITH_POSTFIX_APPROVE_PATCH)
|
||||
|
@ -49,66 +52,53 @@ post-patch:
|
|||
${FIND} ${WRKSRC} -name *.orig -delete
|
||||
${FIND} ${WRKSRC} -name *.bak -delete
|
||||
|
||||
|
||||
pre-configure:
|
||||
@ ${SETENV} ${MAKE_ENV} ${PERL} ${SCRIPTDIR}/createuser
|
||||
@ ${SH} ${PKGINSTALL} ${PKGNAME} ADDUSER
|
||||
@ ${CP} ${FILESDIR}/aliases.majordomo ${WRKSRC}
|
||||
|
||||
pre-install:
|
||||
post-configure:
|
||||
@ if ${TEST} -f ${WRKSRC}/majordomo.cf; then :; else \
|
||||
${CP} ${WRKSRC}/sample.cf ${WRKSRC}/majordomo.cf; \
|
||||
${PERL} ${SCRIPTDIR}/makeseed ${WRKSRC}/majordomo.cf; \
|
||||
fi
|
||||
|
||||
post-install:
|
||||
@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
.for file in ${MAN1}
|
||||
@ ${INSTALL_MAN} ${WRKSRC}/Doc/man/${file} ${PREFIX}/man/man1
|
||||
.endfor
|
||||
.for file in ${MAN8}
|
||||
@ ${INSTALL_MAN} ${WRKSRC}/Doc/man/${file} ${PREFIX}/man/man8
|
||||
.endfor
|
||||
|
||||
@ ${LN} -sf archive2.pl ${PREFIX}/majordomo/archive
|
||||
@ for dir in tmp lists/test-l.archive lists/test-l-digest.archive digests/test-l-digest doc; do \
|
||||
${MKDIR} ${PREFIX}/majordomo/$$dir; \
|
||||
done
|
||||
@ ${CHOWN} majordom:majordom ${PREFIX}/majordomo/tmp
|
||||
@ ${CHMOD} 700 ${PREFIX}/majordomo/tmp
|
||||
@ ${CHMOD} 755 ${PREFIX}/majordomo
|
||||
@ for dir in digests lists lists/test-l.archive lists/test-l-digest.archive digests/test-l-digest doc; do \
|
||||
${CHOWN} majordom:majordom ${PREFIX}/majordomo/$$dir; \
|
||||
${CHMOD} 775 ${PREFIX}/majordomo/$$dir; \
|
||||
done
|
||||
@ ${LN} -sf archive2.pl ${PREFIX}/majordomo/archive
|
||||
.if !defined(NOPORTDOCS)
|
||||
@ for f in Changelog FUTURE INSTALL LICENSE NEWLIST README; do \
|
||||
${INSTALL_DATA} ${WRKSRC}/$$f ${PREFIX}/majordomo/doc; \
|
||||
done
|
||||
@ for f in FAQ README.sequencer list-owner-info majordomo-faq.html majordomo.lisa6.ps majordomo.ora; do \
|
||||
${INSTALL_DATA} ${WRKSRC}/Doc/$$f ${PREFIX}/majordomo/doc; \
|
||||
done
|
||||
@ ${INSTALL_DATA} ${FILESDIR}/post-install-notes ${PREFIX}/majordomo/doc
|
||||
@ for f in Changelog FUTURE INSTALL LICENSE NEWLIST README; do \
|
||||
${INSTALL_DATA} ${WRKSRC}/$$f ${PREFIX}/majordomo/doc; \
|
||||
done
|
||||
@ for f in FAQ README.sequencer list-owner-info majordomo-faq.html majordomo.lisa6.ps majordomo.ora; do \
|
||||
${INSTALL_DATA} ${WRKSRC}/Doc/$$f ${PREFIX}/majordomo/doc; \
|
||||
done
|
||||
@ ${INSTALL_DATA} ${FILESDIR}/post-install-notes ${PREFIX}/majordomo/doc
|
||||
.endif
|
||||
@ if test -f ${PREFIX}/majordomo/aliases.majordomo; then :; \
|
||||
else ${INSTALL_DATA} ${WRKSRC}/aliases.majordomo \
|
||||
${PREFIX}/majordomo; fi
|
||||
@ for f in test-l.passwd test-l.info; do \
|
||||
${INSTALL_DATA} ${FILESDIR}/$$f ${PREFIX}/majordomo/lists; \
|
||||
done
|
||||
@ for f in test-l test-l-digest; do \
|
||||
${TOUCH} ${PREFIX}/majordomo/lists/$$f; \
|
||||
done
|
||||
@ ${LN} -sf test-l.info ${PREFIX}/majordomo/lists/test-l-digest.info
|
||||
@ ${LN} -sf test-l.passwd ${PREFIX}/majordomo/lists/test-l-digest.passwd
|
||||
@ ${CHMOD} 660 ${PREFIX}/majordomo/lists/test-l.passwd
|
||||
@ ${CHOWN} -R majordom:majordom ${PREFIX}/majordomo/lists
|
||||
@ ${CHMOD} -R 664 ${PREFIX}/majordomo/lists
|
||||
@ ${CHMOD} 755 ${PREFIX}/majordomo/lists
|
||||
@ ${CHMOD} 755 ${PREFIX}/majordomo/lists/test-l.archive
|
||||
@ ${CHMOD} 755 ${PREFIX}/majordomo/lists/test-l-digest.archive
|
||||
@ ${CHMOD} 660 ${PREFIX}/majordomo/lists/*.passwd
|
||||
@ ${INSTALL_DATA} ${WRKSRC}/aliases.majordomo \
|
||||
${PREFIX}/majordomo/aliases.majordomo-sample
|
||||
@ for f in test-l.passwd test-l.info; do \
|
||||
${INSTALL_DATA} ${FILESDIR}/$$f ${PREFIX}/majordomo/lists; \
|
||||
done
|
||||
@ for f in test-l test-l-digest; do \
|
||||
${TOUCH} ${PREFIX}/majordomo/lists/$$f; \
|
||||
${CHMOD} 644 ${PREFIX}/majordomo/lists/$$f; \
|
||||
done
|
||||
@ ${LN} -sf test-l.info ${PREFIX}/majordomo/lists/test-l-digest.info
|
||||
@ ${LN} -sf test-l.passwd ${PREFIX}/majordomo/lists/test-l-digest.passwd
|
||||
@ ${CHOWN} -R majordom:majordom ${PREFIX}/majordomo
|
||||
@ ${CHMOD} -R 644 ${PREFIX}/majordomo/lists
|
||||
@ ${CHMOD} 755 ${PREFIX}/majordomo/lists
|
||||
@ ${CHMOD} 755 ${PREFIX}/majordomo/lists/*.archive
|
||||
@ ${CHMOD} 660 ${PREFIX}/majordomo/lists/*.passwd
|
||||
.if !defined(BATCH)
|
||||
@ ${SH} ${SCRIPTDIR}/adaptwrapper ${PREFIX}
|
||||
@ /usr/bin/more -e ${FILESDIR}/post-install-notes
|
||||
@ ${SH} ${SCRIPTDIR}/adaptwrapper ${PREFIX}
|
||||
.endif
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -6,31 +6,38 @@ manually:
|
|||
|
||||
- customize 'majordomo.cf' in your majordomo directory
|
||||
|
||||
- look at 'aliases.majordomo' in your majordomo directory for examples
|
||||
of how to create lists. A test list (test-l) has been created and
|
||||
configured for you. Be sure to remove this list if you do not
|
||||
want to use it for testing.
|
||||
- look at 'aliases.majordomo-sample' in your majordomo directory for
|
||||
examples of how to create lists. Before editing, copy this list to
|
||||
where you keep your alias files (for example, copy it to
|
||||
/etc/aliases.majordomo. A test list (test-l) has been created and
|
||||
configured for you. Be sure to remove this list if you do not want
|
||||
to use it for testing.
|
||||
|
||||
- substitute your own email address for "Postmaster" for the
|
||||
"majordomo-owner" alias.
|
||||
|
||||
- add 'aliases.majordomo' to your sendmail configuration. This can
|
||||
be done by adding a line similar to the following to
|
||||
/etc/sendmail.cf :
|
||||
/etc/mail/sendmail.cf and /etc/mail/submit.cf:
|
||||
|
||||
OA/usr/local/majordomo/aliases.majordomo
|
||||
OA/etc/aliases.majordomo
|
||||
(for 8.6.x Sendmail)
|
||||
|
||||
O AliasFile=/etc/aliases,/usr/local/majordomo/aliases.majordomo
|
||||
O AliasFile=/etc/aliases,/etc/aliases.majordomo
|
||||
(for 8.7.x and up)
|
||||
|
||||
or a line similar to the following to your m4 macros file :
|
||||
|
||||
define(`ALIAS_FILE',`/etc/aliases,/usr/local/majordomo/aliases.majordomo')
|
||||
define(`ALIAS_FILE',`/etc/aliases,/etc/aliases.majordomo')
|
||||
|
||||
Sendmail will need a restart after this.
|
||||
|
||||
- consider using ports/mail/tlb to process your deliveries if you
|
||||
want to hide your outgoing aliases. This way you can prevent people
|
||||
from evading restrictions for posting to your lists.
|
||||
|
||||
Enjoy Majordomo!
|
||||
- to prepare proper permissions for the wrapper script, run
|
||||
ports/mail/majordomo/scripts/adaptwrapper (if it has not already
|
||||
been run)
|
||||
|
||||
Enjoy Majordomo!
|
||||
|
|
17
mail/majordomo/pkg-deinstall
Normal file
17
mail/majordomo/pkg-deinstall
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
MAJORDOMOUSER=majordom
|
||||
MAJORDOMOGROUP=majordom
|
||||
|
||||
case $2 in
|
||||
POST-DEINSTALL)
|
||||
if pw groupshow "${MAJORDOMOGROUP}" 2>/dev/null 1>&2; then
|
||||
echo "To delete ${MAJORDOMOGROUP} group permanently, use 'pw groupdel \"${MAJORDOMOGROUP}\"'"
|
||||
fi
|
||||
if pw usershow "${MAJORDOMOUSER}" 2>/dev/null 1>&2; then
|
||||
echo "To delete ${MAJORDOMOUSER} user permanently, use 'pw userdel \"${MAJORDOMOUSER}\"'"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
exit 0
|
48
mail/majordomo/pkg-install
Normal file
48
mail/majordomo/pkg-install
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
MAJORDOMOUSER=majordom
|
||||
MAJORDOMOGROUP=majordom
|
||||
UID=54
|
||||
GID=$UID
|
||||
|
||||
case $2 in
|
||||
PRE-INSTALL|ADDUSER)
|
||||
if ! pw groupshow ${MAJORDOMOGROUP} 2>/dev/null 1>&2; then
|
||||
if pw groupadd ${MAJORDOMOGROUP} -g $GID; then
|
||||
echo "=> Added group \"${MAJORDOMOGROUP}\"."
|
||||
else
|
||||
echo "=> Adding group \"${MAJORDOMOGROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! pw usershow ${MAJORDOMOUSER} 2>/dev/null 1>&2; then
|
||||
if pw useradd ${MAJORDOMOUSER} -u $UID -g ${MAJORDOMOGROUP} -h - \
|
||||
-s "/nonexistent" -d "/usr/local/majordomo" \
|
||||
-c "Majordomo Pseudo User"; \
|
||||
then
|
||||
pw groupmod ${MAJORDOMOGROUP} -m ${MAJORDOMOUSER}
|
||||
echo "=> Added user \"${MAJORDOMOUSER}\"."
|
||||
else
|
||||
echo "=> Adding user \"${MAJORDOMOUSER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
POST-INSTALL)
|
||||
# Add misc empty dirs, correct permissions
|
||||
for dir in tmp lists/test-l.archive lists/test-l-digest.archive digests/test-l-digest doc; do
|
||||
mkdir -p ${PKG_PREFIX}/majordomo/$dir
|
||||
done
|
||||
chown -R majordom:majordom ${PKG_PREFIX}/majordomo
|
||||
chmod 700 ${PKG_PREFIX}/majordomo/tmp
|
||||
chmod 755 ${PKG_PREFIX}/majordomo
|
||||
for dir in digests lists/*.archive digests/test-l-digest doc; do
|
||||
chmod 775 ${PKG_PREFIX}/majordomo/$dir
|
||||
done
|
||||
chmod 755 ${PKG_PREFIX}/majordomo/lists ${PKG_PREFIX}/majordomo
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,3 +1,4 @@
|
|||
majordomo/aliases.majordomo-sample
|
||||
majordomo/archive
|
||||
majordomo/archive2.pl
|
||||
majordomo/bin/approve
|
||||
|
@ -49,6 +50,6 @@ majordomo/doc/post-install-notes
|
|||
@dirrm majordomo/lists/test-l-digest.archive
|
||||
@dirrm majordomo/lists/test-l.archive
|
||||
@dirrmtry majordomo/lists
|
||||
@dirrm majordomo/tmp
|
||||
@dirrmtry majordomo/tmp
|
||||
@dirrm majordomo/Tools
|
||||
@dirrmtry majordomo
|
||||
|
|
|
@ -5,7 +5,15 @@ if [ -z "$1" ]
|
|||
then
|
||||
prefix=/usr/local/majordomo
|
||||
else
|
||||
prefix=$1/majordomo
|
||||
if [ -d "$1/majordomo" ]
|
||||
then
|
||||
prefix=$1/majordomo
|
||||
else
|
||||
echo "Could not find the majordomo dir."
|
||||
echo
|
||||
echo "Usage: $0 <install prefix>"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
tempfile=`/usr/bin/mktemp -t radiolist`
|
||||
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
|
||||
& eval 'exec /usr/bin/perl -S $0 $argv:q'
|
||||
if 0;
|
||||
|
||||
if( ! -x "/usr/sbin/pw" ) {
|
||||
print "\nYou require the pw command, which was included in FreeBSD v2.2 builds\n";
|
||||
print "as of Dec 9th 1996. If you don't have it, try looking in\n";
|
||||
print "/usr/src/usr.sbin/pw and building it\n\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if( getpwnam( "majordom" ) ) {
|
||||
$have_user = 1;
|
||||
( $null, $null, $mjUID ) = getpwnam( "majordom" );
|
||||
} else {
|
||||
$mjUID = 54;
|
||||
while( getpwuid( $mjUID ) ) {
|
||||
$mjUID++;
|
||||
}
|
||||
}
|
||||
|
||||
if( getgrnam( "majordom" ) ) {
|
||||
$have_group = 1;
|
||||
( $null, $null, $mjGID ) = getgrnam( "majordom" );
|
||||
} else {
|
||||
$mjGID = 54;
|
||||
while( getgrgid( $mjGID ) ) {
|
||||
$mjGID++;
|
||||
}
|
||||
}
|
||||
|
||||
if( $have_group && $have_user ) {
|
||||
exit 0;
|
||||
} elsif( $> ) {
|
||||
print "\nYou must be root to run this step!\n\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
print "majordom user using uid $mjUID\n";
|
||||
print "majordom user using gid $mjGID\n";
|
||||
|
||||
if( ! $have_group ) {
|
||||
$result = system( "/usr/sbin/pw groupadd majordom -g $mjGID" );
|
||||
if( $result ) {
|
||||
print "Failed to add group majordom!\n";
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
if( ! $have_user ) {
|
||||
$result = system( "pw useradd majordom -u $mjUID -g $mjGID -d \"$ENV{PREFIX}/majordomo\" -c \"Majordomo Pseudo User\" -p \"*\" -s \"/nonexistent\"" );
|
||||
} else {
|
||||
$result = system( "pw usermod majordom -u $mjUID -g $mjGID -d \"$ENV{PREFIX}/majordomo\" -c \"Majordomo Pseudo User\" -p \"*\" -s \"/nonexistent\"" );
|
||||
}
|
||||
if( $result ) {
|
||||
print "Failed to add/modify user majordom!\n";
|
||||
exit 1;
|
||||
}
|
Loading…
Reference in a new issue