Fix rc.d/ script stuff. - stop daemon on uninstall - only install ONE rc.d script - add REQUIRE/PROVIDE keywords committer/other's comments welcome... :) Sorry for the churn. :) Generated with FreeBSD Port Tools 0.77
On Mon, 15 May 2006 18:41:57 -0500 Larry Rosenman <ler@lerctr.org> wrote: > USE_RC_SUBR= exilog.sh > PLIST_SUB+= AGENT="" > +.if (${OSVERSION} >= 700007 || (${OSVERSION} < 700000 && ${OSVERSION} >= 600101)) > + RCSCRIPT=exilog > +.else > + RCSCRIPT=exilog.sh > +.endif > +PLIST_SUB+= RCSCRIPT=${RCSCRIPT} > .endif This is not needed, USE_RC_SUBR takes care of it and installs one rc.d script, depending of OSVERSION. > > PLIST_SUB+= EXILOGDIR="${EXILOGDIR:S,^${PREFIX}/,,}" > @@ -76,9 +84,6 @@ > @${CHMOD} 0600 ${PREFIX}/etc/exilog.conf-dist > @${CHOWN} ${WWWOWN}:${WWWGRP} ${PREFIX}/etc/exilog.conf-dist > @${CP} ${FILESDIR}/htaccess ${EXILOGDIR}/.htaccess > -.if !defined(NO_AGENT) > - @${INSTALL_SCRIPT} ${WRKDIR}/exilog.sh ${PREFIX}/etc/rc.d > -.endif Personally I disagree with this behavior, if the server doesn't crash w/o the deleted files (think of portupgrade'ing), YMMV. > +%%AGENT%%etc/rc.d/%%RCSCRIPT%% This is not need either. USE_RC_SUBR takes care of it. I would also change NO_AGENT --> WITH[OUT]_AGENT Current Makefile lacks some "()": .ifndef WITHOUT_WWWDIR Also it could use OPTIONS. -- IOnut - Un^d^dregistered ;) FreeBSD "user" "Intellectual Property" is nowhere near as valuable as "Intellect" BOFH excuse #253: We've run out of licenses
Try this one instead. I'm still looking for comments.... --- exilog-0.5_4.patch begins here --- diff -ruN --exclude=CVS /usr/ports/mail/exilog/Makefile /usr/home/ler/ports/mail/exilog/Makefile --- /usr/ports/mail/exilog/Makefile Mon May 15 13:28:08 2006 +++ /usr/home/ler/ports/mail/exilog/Makefile Mon May 15 21:26:06 2006 @@ -2,12 +2,12 @@ # Date created: 03 Jun 2005 # Whom: Vsevolod Stakhov <vsevolod@highsecure.ru> # -# $FreeBSD: ports/mail/exilog/Makefile,v 1.11 2006/05/15 13:27:29 sem Exp $ +# $FreeBSD: ports/mail/exilog/Makefile,v 1.10 2006/05/10 22:36:50 edwin Exp $ # PORTNAME= exilog PORTVERSION= 0.5 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= mail MASTER_SITES= http://duncanthrax.net/exilog/ @@ -27,24 +27,32 @@ .if (${WITH_SQL_BACKEND} == "mysql") WITH_MYSQL= yes RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql +SERVER=mysql .elif (${WITH_SQL_BACKEND} == "postgresql") WITH_POSTGRESQL= yes RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/DBD/Pg.pm:${PORTSDIR}/databases/p5-DBD-Pg +SERVER=postgresql .else BROKEN= You should specify sql backend using WITH_SQL_BACKEND .endif - +SUB_LIST+= SERVER=${SERVER} .ifndef WITHOUT_WWWDIR EXILOGDIR?= ${PREFIX}/www/exilog .else EXILOGDIR?= ${PREFIX}/exilog .endif - -.if defined(NO_AGENT) +.include <bsd.port.pre.mk> +.if defined(WITHOUT_AGENT) PLIST_SUB+= AGENT="@comment " .else USE_RC_SUBR= exilog.sh PLIST_SUB+= AGENT="" +.if (${OSVERSION} >= 700007 || (${OSVERSION} < 700000 && ${OSVERSION} >= 600101)) + RCSCRIPT=exilog +.else + RCSCRIPT=exilog.sh +.endif +PLIST_SUB+= RCSCRIPT=${RCSCRIPT} .endif PLIST_SUB+= EXILOGDIR="${EXILOGDIR:S,^${PREFIX}/,,}" @@ -67,7 +75,7 @@ @${CP} ${WRKSRC}/*.pm ${WRKSRC}/*.css ${WRKSRC}/*.js ${EXILOGDIR} @${CP} ${WRKSRC}/icons/* ${EXILOGDIR}/icons -.if !defined(NO_AGENT) +.if !defined(WITHOUT_AGENT) @${INSTALL_SCRIPT} ${WRKSRC}/exilog_agent.pl ${PREFIX}/sbin .endif @${INSTALL_SCRIPT} ${WRKSRC}/exilog_cleanup.pl ${PREFIX}/sbin @@ -76,9 +84,6 @@ @${CHMOD} 0600 ${PREFIX}/etc/exilog.conf-dist @${CHOWN} ${WWWOWN}:${WWWGRP} ${PREFIX}/etc/exilog.conf-dist @${CP} ${FILESDIR}/htaccess ${EXILOGDIR}/.htaccess -.if !defined(NO_AGENT) - @${INSTALL_SCRIPT} ${WRKDIR}/exilog.sh ${PREFIX}/etc/rc.d -.endif .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for docfile in ${PORTDOC_FILES} @@ -86,4 +91,4 @@ .endfor .endif -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff -ruN --exclude=CVS /usr/ports/mail/exilog/files/exilog.sh.in /usr/home/ler/ports/mail/exilog/files/exilog.sh.in --- /usr/ports/mail/exilog/files/exilog.sh.in Mon May 15 08:27:30 2006 +++ /usr/home/ler/ports/mail/exilog/files/exilog.sh.in Mon May 15 18:36:39 2006 @@ -1,6 +1,10 @@ #!/bin/sh # -# $FreeBSD: ports/mail/exilog/files/exilog.sh.in,v 1.1 2006/05/15 13:27:30 sem Exp $ +# $FreeBSD: ports/mail/exilog/files/exilog.sh,v 1.2 2005/11/03 13:43:00 vsevolod Exp $ +# +# PROVIDE: exilog +# REQUIRE: %%SERVER%% +# KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable exilog agent: # diff -ruN --exclude=CVS /usr/ports/mail/exilog/pkg-plist /usr/home/ler/ports/mail/exilog/pkg-plist --- /usr/ports/mail/exilog/pkg-plist Sat Jan 14 15:01:24 2006 +++ /usr/home/ler/ports/mail/exilog/pkg-plist Mon May 15 21:26:35 2006 @@ -1,6 +1,5 @@ -%%AGENT%%@unexec [ ! -f /var/run/exilog.pid ] || %D/etc/rc.d/exilog.sh stop +%%AGENT%%@unexec [ ! -f /var/run/exilog.pid ] || %D/etc/rc.d/%%RCSCRIPT%% stop %%AGENT%%sbin/exilog_agent.pl -%%AGENT%%etc/rc.d/exilog.sh sbin/exilog_cleanup.pl %%EXILOGDIR%%/exilog_cgi.pl %%EXILOGDIR%%/exilog_cgi_html.pm --- exilog-0.5_4.patch ends here --- -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 512-248-2683 E-Mail: ler@lerctr.org US Mail: 430 Valona Loop, Round Rock, TX 78681-3893
Ion-Mihai IOnut Tetcu wrote: > On Mon, 15 May 2006 18:41:57 -0500 > Larry Rosenman <ler@lerctr.org> wrote: > >> USE_RC_SUBR= exilog.sh > >> PLIST_SUB+= AGENT="" >> +.if (${OSVERSION} >= 700007 || (${OSVERSION} < 700000 && >> ${OSVERSION} +>= 600101)) + RCSCRIPT=exilog >> +.else >> + RCSCRIPT=exilog.sh >> +.endif >> +PLIST_SUB+= RCSCRIPT=${RCSCRIPT} >> .endif > > This is not needed, USE_RC_SUBR takes care of it and installs one > rc.d script, depending of OSVERSION. I was trying to get the system to stop the daemon on uninstall, and therefore need To know which flavor (see my question and Pav's response on -ports earlier). > >> >> PLIST_SUB+= EXILOGDIR="${EXILOGDIR:S,^${PREFIX}/,,}" @@ -76,9 +84,6 >> @@ @${CHMOD} 0600 ${PREFIX}/etc/exilog.conf-dist >> @${CHOWN} ${WWWOWN}:${WWWGRP} ${PREFIX}/etc/exilog.conf-dist >> @${CP} ${FILESDIR}/htaccess ${EXILOGDIR}/.htaccess -.if >> !defined(NO_AGENT) >> - @${INSTALL_SCRIPT} ${WRKDIR}/exilog.sh ${PREFIX}/etc/rc.d >> -.endif > > Personally I disagree with this behavior, if the server doesn't crash > w/o the deleted files (think of portupgrade'ing), YMMV. The old Makefile installed the exilog.sh unconditionally, I was removing it so That USE_RC_SUBR would handle it. > >> +%%AGENT%%etc/rc.d/%%RCSCRIPT%% Ok, I can kill this one. > > This is not need either. USE_RC_SUBR takes care of it. > > I would also change NO_AGENT --> WITH[OUT]_AGENT Current Makefile > lacks some "()": .ifndef WITHOUT_WWWDIR Also it could use OPTIONS. I did this in the above diff. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 512-248-2683 E-Mail: ler@lerctr.org US Mail: 430 Valona Loop, Round Rock, TX 78681-3683 US
Hi Larry, the last patch is OK, but, it does not apply cleanly onto the port. Looks like it got some leading spaces extra. Can you resend it? -- Pav Lucistnik <pav@oook.cz> <pav@FreeBSD.org> 94 outdated ports on the box, 94 outdated ports. Portupgrade one, an hour 'til done, 82 outdated ports on the box.
On Fri, 19 May 2006, Pav Lucistnik wrote: > Hi Larry, > > the last patch is OK, but, it does not apply cleanly onto the port. > Looks like it got some leading spaces extra. > > Can you resend it? > > Attached. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 512-248-2683 E-Mail: ler@lerctr.org US Mail: 430 Valona Loop, Round Rock, TX 78681-3893
Responsible Changed From-To: freebsd-ports-bugs->pav Take
State Changed From-To: open->closed Committed, thanks!