Bug 56450 - [PATCH] port mail/exim: use rc.subr(8) start/stop script, add daily maintainance scripts
Summary: [PATCH] port mail/exim: use rc.subr(8) start/stop script, add daily maintaina...
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: Sheldon Hearn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-04 18:00 UTC by Oliver Eikemeier
Modified: 2003-09-10 14:49 UTC (History)
1 user (show)

See Also:


Attachments
exim-rc.subr.patch (12.47 KB, patch)
2003-09-04 18:00 UTC, Oliver Eikemeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Eikemeier 2003-09-04 18:00:33 UTC
- use a rc.subr(8) start/stop script
  * Don't forget to add 'enable_exim="YES' to rc.conf(5) *
- contributed daily scripts 150.exim-tidydb and 460.exim-mail-rejects,
  analogous to 150.clean-hoststat and 460.status-mail-rejects
- replace literal '${PREFIX}' by the real prefix in generated documentation
- generate a default ${PREFIX}/etc/exim/configure
- stop exim when deleting the package
- bump PORTREVISION

one step closer to make exim a real sendmail replacement on FreeBSD:
a patch to sysinstall will be posted seperately
Comment 1 Kirill Ponomarev freebsd_committer 2003-09-04 18:05:31 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sheldonh

Over to maintainer.
Comment 2 Oliver Eikemeier 2003-09-08 05:33:00 UTC
followup:

- install additional documentation: ChangeLog, NewStuff, README.SIEVE
- moved 'exim_enable' warning message to pkg-install
- moved creation/removal of /var/log/exim to pkg-plist

--- exim-rc.subr.patch2 begins here ---
diff -Nur mail/exim/Makefile.orig mail/exim/Makefile
--- mail/exim/Makefile.orig	Mon Sep  8 06:21:06 2003
+++ mail/exim/Makefile	Mon Sep  8 05:59:25 2003
@@ -29,6 +29,10 @@
 USE_PERL5=	yes
 MAN8=		exim.8
 
+PORTDOC_FILES=	ChangeLog Exim3.upgrade Exim4.upgrade NewStuff \
+		OptionLists.txt README README.SIEVE dbm.discuss.txt \
+		filter.txt pcrepattern.txt pcretest.txt spec.txt
+
 DAILY_SCRIPTS=	150.exim-tidydb 460.exim-mail-rejects
 
 EXISCAN_ACL_VERSION=	${PORTVERSION}-12
@@ -158,9 +162,6 @@
 PLIST_SUB+=	RC_DIR=${RC_DIR} \
 		RC_SUFX=${RC_SUFX}
 
-PORTDOC_FILES=	Exim3.upgrade Exim4.upgrade OptionLists.txt README \
-		dbm.discuss.txt filter.txt pcrepattern.txt pcretest.txt \
-		spec.txt
 .if !defined(WITHOUT_EXISCAN)
 PORTDOC_FILES+=	exiscan-acl-examples.txt exiscan-acl-spec.txt
 PLIST_SUB+=	EXISCAN_ACL=""
diff -Nur mail/exim.orig/pkg-install mail/exim/pkg-install
--- mail/exim.orig/pkg-install	Fri Jun 13 15:20:56 2003
+++ mail/exim/pkg-install	Mon Sep  8 06:08:03 2003
@@ -46,12 +46,10 @@
 			echo "============================================================"
 		fi
 	fi
+	if ! grep -qs "^exim_enable" /etc/rc.conf
+	    then
+		echo
+		echo "Don't forget to add 'exim_enable=\"YES\"' to rc.conf(5)"
+		echo
+	fi
 fi
-
-# This is naughty, since the directory we create won't be removed along
-# with Exim.  However, logfiles should probably stick around after Exim
-# is removed, until the administrator is sure he doesn't want them
-# any more.
-#
-mkdir -p /var/log/exim
-chown ${user}:${group} /var/log/exim
diff -Nur mail/exim/pkg-message.orig mail/exim/pkg-message
--- mail/exim/pkg-message.orig	Mon Sep  8 06:21:06 2003
+++ mail/exim/pkg-message	Mon Sep  8 06:08:20 2003
@@ -5,5 +5,3 @@
 Please read %%DOCSDIR%%/POST-INSTALL-NOTES for important
 information regarding your Exim installation.
 
-Don't forget to add 'exim_enable="YES"' to rc.conf(5)
-
diff -Nur mail/exim/pkg-plist.orig mail/exim/pkg-plist
--- mail/exim/pkg-plist.orig	Mon Sep  8 06:21:06 2003
+++ mail/exim/pkg-plist	Mon Sep  8 06:16:02 2003
@@ -15,19 +15,22 @@
 sbin/eximstats
 sbin/exiqgrep
 sbin/exiqsumm
-%%PORTDOCS%%%%DOCSDIR%%/POST-INSTALL-NOTES
+%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
 %%PORTDOCS%%%%DOCSDIR%%/Exim3.upgrade
 %%PORTDOCS%%%%DOCSDIR%%/Exim4.upgrade
+%%PORTDOCS%%%%DOCSDIR%%/NewStuff
 %%PORTDOCS%%%%DOCSDIR%%/OptionLists.txt
+%%PORTDOCS%%%%DOCSDIR%%/POST-INSTALL-NOTES
+%%PORTDOCS%%%%EXISCAN_ACL%%%%DOCSDIR%%/POST-INSTALL-NOTES.clamd
 %%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/README.SIEVE
 %%PORTDOCS%%%%DOCSDIR%%/dbm.discuss.txt
+%%PORTDOCS%%%%EXISCAN_ACL%%%%DOCSDIR%%/exiscan-acl-examples.txt
+%%PORTDOCS%%%%EXISCAN_ACL%%%%DOCSDIR%%/exiscan-acl-spec.txt
 %%PORTDOCS%%%%DOCSDIR%%/filter.txt
 %%PORTDOCS%%%%DOCSDIR%%/pcrepattern.txt
 %%PORTDOCS%%%%DOCSDIR%%/pcretest.txt
 %%PORTDOCS%%%%DOCSDIR%%/spec.txt
-%%PORTDOCS%%%%EXISCAN_ACL%%%%DOCSDIR%%/POST-INSTALL-NOTES.clamd
-%%PORTDOCS%%%%EXISCAN_ACL%%%%DOCSDIR%%/exiscan-acl-examples.txt
-%%PORTDOCS%%%%EXISCAN_ACL%%%%DOCSDIR%%/exiscan-acl-spec.txt
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
 etc/periodic/daily/150.exim-tidydb
 etc/periodic/daily/460.exim-mail-rejects
@@ -39,3 +42,6 @@
 @unexec rmdir %B 2>/dev/null || true
 @cwd %%RC_DIR%%
 exim%%RC_SUFX%%
+@exec mkdir -p /var/log/exim
+@exec chown mailnull:mail /var/log/exim
+@unexec rmdir /var/log/exim 2>/dev/null || true
--- exim-rc.subr.patch2 ends here ---
Comment 3 Sheldon Hearn 2003-09-10 12:38:00 UTC
On (2003/09/04 18:57), Oliver Eikemeier wrote:

> - use a rc.subr(8) start/stop script

This seems to install files directly into /etc/rc.d on -CURRENT?  Isn't
that considered a no-no for ports?

> - replace literal '${PREFIX}' by the real prefix in generated documentation

I'm ambivalent about this change.  Folks who install to a non-standard
prefix using pkg_add will end up with docs that point to the wrong
location.

Your comments?

> - generate a default ${PREFIX}/etc/exim/configure

This means that Exim will magically start up the next time the
administrator boots.  I didn't want that, because the administrator must
first disable sendmail and/or adjust mailer.conf.

This desire of mine is at odds with the goal of making Exim available as
a sysinstall drop-in MTA.  That goal is important, so I'm happy for my
desire to take second place.

Ciao,
Sheldon.
Comment 4 Oliver Eikemeier 2003-09-10 13:13:26 UTC
Sheldon Hearn wrote:

> On (2003/09/04 18:57), Oliver Eikemeier wrote:
> 
>>- use a rc.subr(8) start/stop script
> 
> This seems to install files directly into /etc/rc.d on -CURRENT?  Isn't
> that considered a no-no for ports?

That's true, but

- see the remark in /etc/rc.d/othermta

- dependency ordering does not work when the script is not
  installed in /etc/rc.d, so it is no sendmail replacement
  (it has to fulfil 'PROVIDE: mail')

But I agree that this is a point that should be discussed,
probably we can get the start/stop script in the base
system at src/etc/rc.d/exim, or find a general solution
that includes ports rc.subr scripts in dependency ordering.

Meanwhile, if you are not convinced, change the lines after
.if ${OSVERSION} >= 500038
to

RC_SUBR?=	${DESTDIR}/etc/rc.subr
RC_DIR=		${PREFIX}/etc/rc.d
RC_SUFX=	.sh

and you can change them back at any time.

>>- replace literal '${PREFIX}' by the real prefix in generated documentation
> 
> I'm ambivalent about this change.  Folks who install to a non-standard
> prefix using pkg_add will end up with docs that point to the wrong
> location.

They should be used to that, they have to cope with things like the default
location of the configuration file anyway. It's far easier to understand for
most people installing to the standard directories, and the average package
user probably does not know what their '${PREFIX}' is.
But that's noting I set my heart on. It's just an proposal, if you don't like
it, leave it out.

> Your comments?

see above.

>>- generate a default ${PREFIX}/etc/exim/configure
> 
> This means that Exim will magically start up the next time the
> administrator boots.  I didn't want that, because the administrator must
> first disable sendmail and/or adjust mailer.conf.
Not quite: they are missing 'exim_enable="YES"' in /etc/rc.conf

> This desire of mine is at odds with the goal of making Exim available as
> a sysinstall drop-in MTA.  That goal is important, so I'm happy for my
> desire to take second place.
sysinstall does this in -CURRENT
Comment 5 Sheldon Hearn freebsd_committer 2003-09-10 14:49:23 UTC
State Changed
From-To: open->closed

Excellent work!  Committed, thanks!