From a0d0a1e903b31f18c42f2502ee5f8ee00c171cfa Mon Sep 17 00:00:00 2001 From: Sheldon Hearn Date: Mon, 12 Jan 2004 10:56:41 +0000 Subject: 1) Fix build for the WITHOUT_ALT_CONFIG_PREFIX case. 2) Allow the operator to override exim user and group with EXIM_USER and EXIM_GROUP. This was made possible by the introduction of runtime resolution of the exim_user UID and the exim_group GID, new in exim-4.30. Reported by: Phil Pennock --- mail/exim/Makefile | 15 ++++++++++++++- mail/exim/files/patch-src::EDITME | 6 +++--- mail/exim/files/patch-src::configure.default | 10 +++++----- mail/exim/pkg-install | 4 ++-- 4 files changed, 24 insertions(+), 11 deletions(-) (limited to 'mail/exim') diff --git a/mail/exim/Makefile b/mail/exim/Makefile index e13ecec8a8ef..eb5725398e0f 100644 --- a/mail/exim/Makefile +++ b/mail/exim/Makefile @@ -48,6 +48,8 @@ DAILY_SCRIPTS= 150.exim-tidydb 460.exim-mail-rejects EXISCAN_VERSION= ${PORTVERSION}-14 +PKGINSTALL= ${WRKDIR}/pkg-install + PLIST_SUB+= EXIM_VERSION="${PORTVERSION}-${PORTREVISION}" .if defined(NOPORTDOCS) @@ -60,6 +62,9 @@ MAKE_ENV+= OSTYPE=${OPSYS} ARCHTYPE=${MACHINE_ARCH} LOCALBASE=${LOCALBASE} POSTGRESQL_PORT?= databases/postgresql7 +EXIM_USER?= mailnull +EXIM_GROUP?= mail + # If WITH_EXIMON is defined, the eximon monitor, which requires X, # will be made a dependency. Note that using WITH_EXIMON will cause # XFree86 to be installed if it is not present. @@ -174,6 +179,8 @@ PLIST_SUB+= EXISCAN_ACL="@comment " .endif SEDLIST= -e 's,XX_PREFIX_XX,${PREFIX},' \ + -e 's,XX_EXIM_USER_XX,${EXIM_USER},' \ + -e 's,XX_EXIM_GROUP_XX,${EXIM_GROUP},' \ -e 's,XX_LOCALBASE_XX,${LOCALBASE},' \ -e 's,XX_DEFAULT_CHARSET_XX,${WITH_DEFAULT_CHARSET},' @@ -340,7 +347,7 @@ SEDLIST+= -e 's,^\# TRANSPORT_LMTP=,TRANSPORT_LMTP=,' .endif .if defined(WITHOUT_ALT_CONFIG_PREFIX) -SEDLIST+= -e 's,^\ALT_CONFIG_PREFIX=,# ALT_CONFIG_PREFIX=,' +SEDLIST+= -e 's,^ALT_CONFIG_PREFIX=,\# ALT_CONFIG_PREFIX=,' .endif .include @@ -385,6 +392,12 @@ pre-everything:: do-configure: @${MKDIR} ${WRKSRC}/Local @${SED} ${SEDLIST} ${WRKSRC}/src/EDITME > ${WRKSRC}/Local/Makefile + @${SED} -e 's/XX_EXIM_USER_XX/${EXIM_USER}/' \ + -e 's/XX_EXIM_GROUP_XX/${EXIM_GROUP}/' \ + < ${PKGDIR}/pkg-install > ${PKGINSTALL} + @${REINPLACE_CMD} -e 's/XX_EXIM_USER_XX/${EXIM_USER}/' \ + -e 's/XX_EXIM_GROUP_XX/${EXIM_GROUP}/' \ + ${WRKSRC}/src/configure.default @${REINPLACE_CMD} -e 's/"(Exim $$version_number)\\n\\t"/"(Exim $$version_number; ${OPSYS})\\n\\t"/' \ ${WRKSRC}/src/globals.c @${REINPLACE_CMD} -e 's/^#include "cnumber\.h"$$/${PORTREVISION}/' ${WRKSRC}/src/version.c diff --git a/mail/exim/files/patch-src::EDITME b/mail/exim/files/patch-src::EDITME index 0bc84eea74c8..f7180f425d8c 100644 --- a/mail/exim/files/patch-src::EDITME +++ b/mail/exim/files/patch-src::EDITME @@ -1,5 +1,5 @@ --- src/EDITME.orig Mon Dec 1 12:15:41 2003 -+++ src/EDITME Tue Jan 6 12:04:13 2004 ++++ src/EDITME Mon Jan 12 12:36:43 2004 @@ -98,7 +98,7 @@ # /usr/local/sbin. The installation script will try to create this directory, # and any superior directories, if they do not exist. @@ -23,7 +23,7 @@ # discouraged. -EXIM_USER= -+EXIM_USER=ref:mailnull ++EXIM_USER=ref:XX_EXIM_USER_XX # If you specify EXIM_USER as a name, this is looked up at build time, and the # uid number is built into the binary. However, you can specify that this @@ -32,7 +32,7 @@ # you want to use a group other than the default group for the given user. -# EXIM_GROUP= -+EXIM_GROUP=mail ++EXIM_GROUP=XX_EXIM_GROUP_XX # Many sites define a user called "exim", with an appropriate default group, # and use diff --git a/mail/exim/files/patch-src::configure.default b/mail/exim/files/patch-src::configure.default index 410792a3e1e3..56a0a114432b 100644 --- a/mail/exim/files/patch-src::configure.default +++ b/mail/exim/files/patch-src::configure.default @@ -13,8 +13,8 @@ # were a normal user. This isn't usually a problem, as most sites have an alias # for root that redirects such mail to a human administrator. -+exim_user = mailnull -+exim_group = mail ++exim_user = XX_EXIM_USER_XX ++exim_group = XX_EXIM_GROUP_XX never_users = root @@ -23,8 +23,8 @@ allow_defer data = ${lookup{$local_part}lsearch{SYSTEM_ALIASES_FILE}} -# user = exim -+ user = mailnull -+ group = mail ++ user = XX_EXIM_USER_XX ++ group = XX_EXIM_GROUP_XX file_transport = address_file pipe_transport = address_pipe @@ -42,7 +42,7 @@ return_path_add -# group = mail -# mode = 0660 -+ group = mail ++ group = XX_EXIM_GROUP_XX + user = $local_part + mode = 0660 + no_mode_fail_narrower diff --git a/mail/exim/pkg-install b/mail/exim/pkg-install index 843fc2fc6b1d..81c3e5050026 100644 --- a/mail/exim/pkg-install +++ b/mail/exim/pkg-install @@ -13,8 +13,8 @@ PKG_PREFIX=${PKG_PREFIX:=/usr/local} -user=mailnull -group=mail +user=XX_EXIM_USER_XX +group=XX_EXIM_GROUP_XX if [ "$2" = "PRE-INSTALL" ]; then if ! /usr/bin/id ${user} > /dev/null; then -- cgit v1.2.3