aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorcrees <crees@FreeBSD.org>2011-07-09 18:07:49 +0800
committercrees <crees@FreeBSD.org>2011-07-09 18:07:49 +0800
commit8a405f0bb00aa4b950e8cf2acb0c94c27987e2d0 (patch)
tree3df7522be9d205dbefa7a2e6e5be08d223654869 /mail
parent9e7f7317e9009e6daf3dbab4837fc3b11ac8325e (diff)
downloadfreebsd-ports-gnome-8a405f0bb00aa4b950e8cf2acb0c94c27987e2d0.tar.gz
freebsd-ports-gnome-8a405f0bb00aa4b950e8cf2acb0c94c27987e2d0.tar.zst
freebsd-ports-gnome-8a405f0bb00aa4b950e8cf2acb0c94c27987e2d0.zip
Use USERS and GROUPS
PR: ports/157613 Submitted by: crees (me) Approved by: rene (mentor, implicit), Corey Halpin (maintainer)
Diffstat (limited to 'mail')
-rw-r--r--mail/fetchmail/Makefile6
-rw-r--r--mail/fetchmail/pkg-install46
-rw-r--r--mail/fetchmail/pkg-plist1
3 files changed, 4 insertions, 49 deletions
diff --git a/mail/fetchmail/Makefile b/mail/fetchmail/Makefile
index 02df594acffc..2b871c7e99e1 100644
--- a/mail/fetchmail/Makefile
+++ b/mail/fetchmail/Makefile
@@ -21,6 +21,9 @@ COMMENT= Batch mail retrieval utility for IMAP/POP3/ETRN/ODMR
RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:${PORTSDIR}/security/ca_root_nss
+USERS= ${PORTNAME}
+GROUPS= ${USERS}
+
USE_RC_SUBR= fetchmail
FETCHMAILRC= ${PREFIX}/etc/fetchmailrc
SUB_FILES= pkg-message
@@ -109,9 +112,6 @@ pre-patch:
post-build:
@cd ${WRKSRC} && ${MAKE} check
-pre-su-install:
- @${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
post-install:
.if !defined(NOPORTDOCS)
${INSTALL} -d -m 555 -o ${DOCOWN} -g ${DOCGRP} ${DOCSDIR}
diff --git a/mail/fetchmail/pkg-install b/mail/fetchmail/pkg-install
deleted file mode 100644
index 179729e50461..000000000000
--- a/mail/fetchmail/pkg-install
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-PKG_PREFIX=${PKG_PREFIX:=/usr/local}
-
-if [ -x /usr/sbin/nologin ]; then
- NOLOGIN=/usr/sbin/nologin
-else
- NOLOGIN=/sbin/nologin
-fi
-
-if [ x"$2" = xPRE-INSTALL ]; then
- USER=fetchmail
- UID=124
- GROUP=fetchmail
- GID=124
-
- if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
- echo "You already have a group \"${GROUP}\", so I will use it."
- else
- if /usr/sbin/pw groupadd ${GROUP} -g ${GID}
- then
- echo "Added group \"${GROUP}\"."
- else
- echo "Adding group \"${GROUP}\" failed..."
- echo "Please create it, and try again."
- exit 1
- fi
- fi
-
- if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
- echo "You already have a user \"${USER}\", so I will use it."
- else
- if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d /var/run/fetchmail -s ${NOLOGIN} -c "Fetchmail mail-retrieval daemon"; then
- echo "Added user \"${USER}\"."
- else
- echo "Adding user \"${USER}\" failed..."
- echo "Please create it, and try again."
- exit 1
- fi
- fi
-fi
-
-/usr/bin/install -d -m 755 -o fetchmail -g fetchmail /var/run/fetchmail
diff --git a/mail/fetchmail/pkg-plist b/mail/fetchmail/pkg-plist
index 935f24ef95ae..507eb94cb22a 100644
--- a/mail/fetchmail/pkg-plist
+++ b/mail/fetchmail/pkg-plist
@@ -36,6 +36,7 @@ libexec/fetchmailconf.py
%%NLS%%share/locale/tr/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/vi/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/zh_CN/LC_MESSAGES/fetchmail.mo
+@exec /usr/bin/install -d -m 755 -o fetchmail -g fetchmail /var/run/fetchmail
@unexec if cmp -s %D/etc/fetchmailrc.sample %D/etc/fetchmailrc; then rm -f %D/etc/fetchmailrc; fi
etc/fetchmailrc.sample
@exec if [ ! -f %D/etc/fetchmailrc ] ; then cp -p %D/%F %B/fetchmailrc; fi