Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 May 2000 16:01:07 +0100
From:      Ben Smithurst <ben@scientia.demon.co.uk>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/18372: wwwoffle port has hardcoded path and ownerships
Message-ID:  <E12n0eB-000LvR-00@magnesium.scientia.demon.co.uk>

next in thread | raw e-mail | index | archive | help

>Number:         18372
>Category:       ports
>Synopsis:       wwwoffle port has hardcoded path and ownerships
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed May  3 10:20:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Ben Smithurst
>Release:        FreeBSD 3.4-STABLE i386
>Organization:
>Environment:

>Description:

The wwwoffle port has "/var/spool/wwwoffle" hardcoded as the path for
the spool, both in the Makefile and PLIST.  Even if a user overrides
this in Makefile they may not know PLIST needs changing.

Also, the installation attempted to change the ownership of some files
to root:wheel, this changes that to ${BINOWN}:${BINGRP}.  This means
one less warning message while testing the port as a non-root user if
nothing else.

>How-To-Repeat:

>Fix:

Index: Makefile
===================================================================
RCS file: /usr/cvs/ports/www/wwwoffle/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- Makefile	2000/04/29 20:33:42	1.8
+++ Makefile	2000/05/03 14:57:01
@@ -21,9 +21,28 @@
 MAN5=		wwwoffle.conf.5
 MAN8=		wwwoffled.8
 
-SPOOL=		/var/spool
+# $SPOOL seems like a common name which could be used for other things, so
+# use $WWWOFFLE_SPOOL as the overriding setting.
+WWWOFFLE_SPOOL?=	/var/spool
+SPOOL=		${WWWOFFLE_SPOOL}
 
+PLIST_SUB+=	SPOOL=${SPOOL}
+
+.if ${SPOOL} != "/var/spool"
+# If using a non-standard spool, change all the documentation (and anything
+# else) to reflect that.
+PKGMESSAGE=${WRKDIR}/MESSAGE
+post-patch:
+	find ${WRKSRC} | xargs ${CHMOD} u+w
+	find ${WRKSRC} -type f | \
+	  xargs perl -pi -e 's@/var/spool/wwwoffle@${SPOOL}/wwwoffle@g'
+	sed 's@/var/spool/wwwoffle@${SPOOL}/wwwoffle@g' \
+	  ${PKGDIR}/MESSAGE > ${PKGMESSAGE}
+.endif
+
 MAKE_ENV+=	SPOOL="${SPOOL}" \
+		BINOWN="${BINOWN}" \
+		BINGRP="${BINGRP}" \
 		INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
 		INSTALL_DATA="${INSTALL_DATA}" \
 		INSTALL_MAN="${INSTALL_MAN}"
Index: patches/patch-aa
===================================================================
RCS file: /usr/cvs/ports/www/wwwoffle/patches/patch-aa,v
retrieving revision 1.3
diff -u -r1.3 patch-aa
--- patch-aa	2000/04/29 20:33:43	1.3
+++ patch-aa	2000/05/03 14:24:30
@@ -129,6 +129,17 @@
  	  done )
  
  
+@@ -354,8 +353,8 @@
+ 	cd $(SPOOLDIR)/html && ./fixup-install.sh $(SPOOLDIR) $(LOCALHOST) && rm ./fixup-install.sh
+ # Now fix the permissions that tar preserved, we needed to use 'tar xpf' to get round root's umask.
+ # These two will fail unless you are root, that is OK because the owner is already you.
+-	-chown -R 0 $(SPOOLDIR)/html > /dev/null 2>&1
+-	-chgrp -R 0 $(SPOOLDIR)/html > /dev/null 2>&1
++	-chown -R ${BINOWN} $(SPOOLDIR)/html > /dev/null 2>&1
++	-chgrp -R ${BINGRP} $(SPOOLDIR)/html > /dev/null 2>&1
+ 
+ install_config :
+ 	sed -e 's%SPOOLDIR%$(SPOOLDIR)%' -e 's%CONFDIR%$(CONFDIR)%' < wwwoffle.conf > wwwoffle.conf.install
 @@ -365,7 +364,7 @@
  	  echo "WWWOFFLE: There is already a configuration file $(CONFDIR)/wwwoffle.conf." ;\
  	  echo "WWWOFFLE: Run 'perl upgrade-config.pl $(CONFDIR)/wwwoffle.conf' to upgrade it." ;\
Index: pkg/PLIST
===================================================================
RCS file: /usr/cvs/ports/www/wwwoffle/pkg/PLIST,v
retrieving revision 1.5
diff -u -r1.5 PLIST
--- PLIST	2000/04/29 20:33:44	1.5
+++ PLIST	2000/05/03 14:06:28
@@ -22,7 +22,7 @@
 share/doc/wwwoffle/README.win32
 share/doc/wwwoffle/UPGRADE
 @dirrm share/doc/wwwoffle
-@cwd /var/spool
+@cwd %%SPOOL%%
 wwwoffle/html/FAQ.html
 wwwoffle/html/Welcome.html
 wwwoffle/html/htdig/button1.gif

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E12n0eB-000LvR-00>