diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2002-01-05 23:43:13 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2002-01-05 23:43:13 +0000 |
commit | 2025ba84eedefaef90a7e7d9eaee3f6f03181f8f (patch) | |
tree | 701fd40b4de20d4b4b0bb2d2c9b977933243c1a2 /news/ifmail | |
parent | Update to 2.8 (diff) |
- make portlint happier
- use DOCSDIR or EXAMPLESDIR
- get rid of some INTERACTIVE scrips in news/ifmail
Notes
Notes:
svn path=/head/; revision=52636
Diffstat (limited to 'news/ifmail')
-rw-r--r-- | news/ifmail/Makefile | 21 | ||||
-rw-r--r-- | news/ifmail/pkg-deinstall | 45 | ||||
-rw-r--r-- | news/ifmail/pkg-install | 100 | ||||
-rw-r--r-- | news/ifmail/pkg-plist | 6 |
4 files changed, 21 insertions, 151 deletions
diff --git a/news/ifmail/Makefile b/news/ifmail/Makefile index 73214c91f181..2ff93f1a4f03 100644 --- a/news/ifmail/Makefile +++ b/news/ifmail/Makefile @@ -17,8 +17,17 @@ MAINTAINER= dinoex@FreeBSD.org MAN3= parsedate.3 MAN8= ifmail.8 iftoss.8 +.if defined(IFMAIL_RUNAS) +pre-configure: + @${PERL5} -pi -e "s/OWNER = ifmail/OWNER = ${IFMAIL_RUNAS}/" \ + ${WRKSRC}/CONFIG +.endif + pre-install: - @PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL +.if !defined(IFMAIL_RUNAS) + if ! pw usershow ifmail; then pw useradd ifmail -g uucp -u 70 \ + -h - -d /nonexistent -s /nonexistent -c "Ifmail Server"; fi +.endif ${MKDIR} ${PREFIX}/libexec/ifmail post-install: @@ -29,13 +38,13 @@ post-install: ${INSTALL_MAN} ${WRKSRC}/iflib/${i} ${PREFIX}/man/man3 .endfor .if !defined(NOPORTDOCS) - ${MKDIR} ${PREFIX}/share/doc/ifmail - ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/ifmail + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}/ .for i in ifcico ifgate iflib - ${INSTALL_DATA} ${WRKSRC}/${i}/README ${PREFIX}/share/doc/ifmail/README.${i} + ${INSTALL_DATA} ${WRKSRC}/${i}/README ${DOCSDIR}/README.${i} .endfor + ${MKDIR} ${EXAMPLESDIR} + @${TAR} -C ${WRKSRC}/misc -cf - . | ${TAR} -C ${EXAMPLESDIR} -xf - .endif - ${MKDIR} ${PREFIX}/share/examples/ifmail - @cd ${WRKSRC}/misc; tar cf - . | (cd ${PREFIX}/share/examples/ifmail; tar xf -) .include <bsd.port.mk> diff --git a/news/ifmail/pkg-deinstall b/news/ifmail/pkg-deinstall deleted file mode 100644 index 50d05233e469..000000000000 --- a/news/ifmail/pkg-deinstall +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -user=ifmail - -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" ]; then - read -p "${question} [${default}]? " answer - fi - if [ x${answer} = x ]; then - answer=${default} - fi - echo ${answer} -} - -yesno() { - local dflt question answer - - question=$1 - dflt=$2 - while :; do - answer=$(ask "${question}" "${dflt}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done -} - -if [ x$2 != xDEINSTALL ]; then - exit -fi - -if yesno "Do you want me to remove user \"${user}\"" y; then - if [ `id -u` -ne 0 ]; then - echo "You must be root to delete the user." - exit 1 - fi - pw userdel -n ${user} - echo "Done." -fi diff --git a/news/ifmail/pkg-install b/news/ifmail/pkg-install deleted file mode 100644 index 544ec0d2bdb4..000000000000 --- a/news/ifmail/pkg-install +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -user=ifmail -group=uucp -uid=70 - -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" ]; then - read -p "${question} [${default}]? " answer - fi - if [ x${answer} = x ]; then - answer=${default} - fi - echo ${answer} -} - -yesno() { - local dflt question answer - - question=$1 - dflt=$2 - while :; do - answer=$(ask "${question}" "${dflt}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done -} - -case $2 in - -PRE-INSTALL) - - if which -s pw; then - : - else - cat <<EOF - -This system looks like a pre-2.2 version of FreeBSD. I see that -it is missing the "pw" utility. I need this utility. Please get -it and install it, and try again. You can get the sources from: - - ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar - -EOF - exit 1 - fi - - if pw user show "${user}" 2>/dev/null; then - echo "You already have a user \"${user}\", so I will use it." - else - echo "You need a user \"${user}\"." - if which -s pw && yesno "Would you like me to create it" y; then - if [ `id -u` -ne 0 ]; then - echo "You must be root to add the user." - exit 1 - fi - if pw user show ${uid} >/dev/null 2>&1; then - echo "The ifmail user is normally UID ${uid}. However, you currently have" - echo "a UID ${uid}." - if yesno "Should I just pick a new UID" y; then - while pw user show ${uid} >/dev/null 2>&1; do - uid=`expr ${uid} + 1` - done - if [ $uid -gt 99 ]; then - echo "I can't find a low UID to use. Please create an 'ifmail' user" - echo "and try the installation again." - exit 1 - fi - else - exit 1 - fi - echo "Ok, I'll use UID ${uid}." - fi - pw useradd ${user} -g ${group} -u ${uid} -h - -d /nonexistent \ - -s /nonexistent -c "Ifmail user" || exit 1 - echo "Done." - else - echo "Please create it, and try again." - exit 1 - fi - fi - - ;; - -# -# The package system untar's the file first, potentially before the -# ifmail user is created. This means that the files in -# ${PKG_PREFIX}/libexec/ifmail will be setuid root, not setuid ifmail. -# We have to fix this up. -POST-INSTALL) - chown ifmail ${PKG_PREFIX}/libexec/ifmail/* - ;; -esac diff --git a/news/ifmail/pkg-plist b/news/ifmail/pkg-plist index 3a590bdefd0f..a2b449c7f209 100644 --- a/news/ifmail/pkg-plist +++ b/news/ifmail/pkg-plist @@ -1,3 +1,7 @@ +@exec if ! pw usershow ifmail 2>/dev/null; then pw useradd ifmail -g uucp -u 70 -h - -d /nonexistent -s /nonexistent -c "Ifmail Server"; fi +@unexec if pw usershow ifmail | grep -q 70:70; then pw userdel ifmail; fi +@owner ifmail +@group uucp libexec/ifmail/ifcico libexec/ifmail/ifindex libexec/ifmail/ifmail @@ -8,6 +12,8 @@ libexec/ifmail/ifstat libexec/ifmail/iftoss libexec/ifmail/ifunpack libexec/ifmail/nlpatch +@owner +@group @dirrm libexec/ifmail %%PORTDOCS%%share/doc/ifmail/README %%PORTDOCS%%share/doc/ifmail/README.ifcico |