Bug 89832 - [PATCH] mail/exim - create user/group when EXIM_USER/EXIM_GROUP are used
Summary: [PATCH] mail/exim - create user/group when EXIM_USER/EXIM_GROUP are used
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Kirill Ponomarev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-02 08:50 UTC by Artis Caune
Modified: 2006-01-07 22:48 UTC (History)
0 users

See Also:


Attachments
file.diff (563 bytes, patch)
2005-12-02 08:50 UTC, Artis Caune
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Artis Caune 2005-12-02 08:50:02 UTC
              
'make EXIM_USER=exim EXIM_GROUP=exim install clean' don't work
port requires user/group to be added before 'make install'
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2005-12-02 08:51:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->krion

Over to maintainer
Comment 2 Artis Caune 2005-12-02 09:32:14 UTC
*** Makefile.origThu Dec  1 18:33:53 2005
--- MakefileThu Dec  1 18:48:31 2005
***************
*** 618,623 ****
--- 618,627 ----
  .if !defined(EXIMON_ONLY)
  
  pre-install:
+	if ! pw groupshow ${EXIM_GROUP}; then pw groupadd ${EXIM_GROUP} -g 125; fi
+	if ! pw usershow ${EXIM_USER}; then pw useradd ${EXIM_USER} -g ${EXIM_GROUP} -u 125 \
+	-h - -d /var/spool/exim -s /nonexistent -c "Exim User"; fi
+
  @[ -d "${DESTDIR}/etc" ] || ${MKDIR} "${DESTDIR}/etc"
  @${SETENV} PKG_PREFIX="${PREFIX}" PKG_DESTDIR="${DESTDIR}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL



*** pkg-install.orig    Sat Jul 17 17:21:13 2004
--- pkg-install Fri Dec  2 11:20:33 2005
***************
*** 20,31 ****
  
  if [ "$2" = "PRE-INSTALL" ]; then
	if ! /usr/bin/id ${user} > /dev/null; then
!		echo "Exim requires user ${user}.  Please update your system." 1>&2
!		exit 1
	fi
	if ! /usr/bin/grep -q "^${group}:" /etc/group; then
!		echo "Exim requires group ${group}.  Please update your system." 1>&2
!		exit 1
	fi
	/bin/mkdir -p ${logdir}
	/usr/sbin/chown ${user}:${group} ${logdir}
--- 20,30 ----
  
  if [ "$2" = "PRE-INSTALL" ]; then
	if ! /usr/bin/id ${user} > /dev/null; then
!		pw useradd ${EXIM_USER} -g ${EXIM_GROUP} -u 125 \
!		-h - -d /var/spool/exim -s /nonexistent -c "Exim User"
	fi
	if ! /usr/bin/grep -q "^${group}:" /etc/group; then
!		pw groupadd ${EXIM_GROUP} -g 125
	fi
	/bin/mkdir -p ${logdir}
	/usr/sbin/chown ${user}:${group} ${logdir}
Comment 3 Kirill Ponomarev freebsd_committer freebsd_triage 2006-01-07 22:48:32 UTC
State Changed
From-To: open->closed

Committed. Thanks!