ports/190083: [patch] Add staging support to www/foswiki
Joseph Benden
joe at thrallingpenguin.com
Wed May 21 19:20:00 UTC 2014
>Number: 190083
>Category: ports
>Synopsis: [patch] Add staging support to www/foswiki
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed May 21 19:20:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator: Joseph Benden
>Release: FreeBSD 11
>Organization:
>Environment:
FreeBSD lucy 11.0-CURRENT FreeBSD 11.0-CURRENT #4 r264887: Thu Apr 24 12:43:46 MST 2014 root at lucy:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
Adds staging support to www/foswiki.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
diff --git a/www/foswiki/Makefile b/www/foswiki/Makefile
index 9d11270..0d1a32f 100644
--- a/www/foswiki/Makefile
+++ b/www/foswiki/Makefile
@@ -26,7 +26,6 @@ OPTINT_DESC= Install Perl modules for intl character support
OPTOTH_DESC= Install other optional Perl modules
APACHE_DESC= Install Apache web server and sample config file
-NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MOPTINT}
@@ -97,9 +96,10 @@ post-patch:
post-install:
.if ${PORT_OPTIONS:MAPACHE}
- @if [ -d "${CONFDIR}" ]; then \
+ @${MKDIR} ${STAGEDIR}${CONFDIR}
+ @if [ -d "${STAGEDIR}${CONFDIR}" ]; then \
${INSTALL_DATA} ${WRKSRC}/foswiki_httpd_conf.txt \
- ${CONFDIR}/foswiki.conf.sample; \
+ ${STAGEDIR}${CONFDIR}/foswiki.conf.sample; \
else \
${ECHO_MSG} "" ; \
${ECHO_MSG} "Please check your Apache installation -" ; \
diff --git a/www/foswiki/bsd.foswiki.mk b/www/foswiki/bsd.foswiki.mk
index d77a671..44244d0 100644
--- a/www/foswiki/bsd.foswiki.mk
+++ b/www/foswiki/bsd.foswiki.mk
@@ -15,7 +15,7 @@
PORTVERSION?= 0.0.${SVNREV}
.if ${PORTNAME} == foswiki
.if ${.TARGETS} == make-port
-PNAME=
+PNAME=
.else
PNAME= core
.endif
@@ -40,7 +40,6 @@ PLIST_SUB+= FWDIR=${FWDIR:S|^${PREFIX}/||}
SUB_LIST+= FWDIR=${FWDIR} FIND=${FIND} CHMOD=${CHMOD} CHOWN=${CHOWN} \
TOUCH=${TOUCH} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} \
CONFDIR=${CONFDIR}
-SUB_FILES+= pkg-install
MAINTAINER?= glarkin at FreeBSD.org
RUN_DEPENDS+= ${FWDEP:C/([^=<>]*)([=<>]*)(.*)/foswiki-\1\20.0.\3:${PORTSDIR}\/www\/foswiki-\1/}
@@ -60,12 +59,11 @@ create-plist: extract
@${ECHO_CMD} '@dirrm %%FWDIR%%' >> ${PLIST}
do-install:
- @${INSTALL} -d ${FWDIR}/
- @cd ${WRKSRC}/ && ${COPYTREE_SHARE} . ${FWDIR}/
+ @${INSTALL} -d ${STAGEDIR}${FWDIR}/
+ @cd ${WRKSRC}/ && ${COPYTREE_SHARE} . ${STAGEDIR}${FWDIR}/
.if ${PORTNAME} == foswiki
- @${INSTALL_DATA} ${WRKDIR}/LocalSite.cfg ${WWWDIR}/lib
+ @${INSTALL_DATA} ${WRKDIR}/LocalSite.cfg ${STAGEDIR}${WWWDIR}/lib/LocalSite.cfg.sample
.endif
- ${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
make-fwdep: extract
@echo "FWDEP=`grep -v ^# ${WRKSRC}/lib/*[wW]iki/*/${PORTNAME}/DEPENDENCIES |\
@@ -124,4 +122,5 @@ make-port:
sed -E 's|.+[wW]iki:Main[./]||g;s|^|Author: |;s| | |g;s| $$||;\
s|([a-z]) |\1, |;s|([a-z])([A-Z])|\1 \2|g' >> pkg-descr &&\
echo "WWW: http://www.foswiki.org/Support/$$nnam" >> pkg-descr;\
+
done
diff --git a/www/foswiki/files/pkg-install.in b/www/foswiki/files/pkg-install.in
deleted file mode 100644
index 82244c5..0000000
--- a/www/foswiki/files/pkg-install.in
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-WWWDIR=%%WWWDIR%%
-FIND=%%FIND%%
-CHMOD=%%CHMOD%%
-CHOWN=%%CHOWN%%
-TOUCH=%%TOUCH%%
-WWWOWN=%%WWWOWN%%
-WWWGRP=%%WWWGRP%%
-
-case $2 in
- PRE-INSTALL)
- ;;
- POST-INSTALL)
- cd ${WWWDIR}/
- ${FIND} . -type d -print -exec ${CHMOD} 755 {} \;
- ${FIND} data -name '*.txt' -type f -exec ${CHMOD} 644 {} \;
- ${FIND} data pub -name '*,v' -type f -exec ${CHMOD} 444 {} \;
- ${FIND} lib -type f -exec ${CHMOD} 444 {} \;
- ${FIND} locale -type f -exec ${CHMOD} 444 {} \;
- ${FIND} pub -type f -exec ${CHMOD} 644 {} \;
- ${FIND} bin -type f -exec ${CHMOD} 555 {} \;
- ${FIND} templates -type f -exec ${CHMOD} 444 {} \;
- ${FIND} tools -type f -exec ${CHMOD} 555 {} \;
- ${TOUCH} data/.htpasswd
- ${CHMOD} 644 data/.htpasswd
- ${CHMOD} 644 data/mime.types
- ${CHMOD} 644 bin/LocalLib.cfg.txt bin/.htaccess.txt
- ${CHMOD} 444 bin/setlib.cfg
- ${CHMOD} 644 lib/LocalSite.cfg
- ${CHMOD} 444 tools/extender.pl
- ${CHMOD} 444 working/tmp/README working/README \
- working/registration_approvals/README \
- working/work_areas/README
- ${CHMOD} 660 working/.htaccess
- ${CHMOD} 444 AUTHORS COPYING COPYRIGHT index.html \
- INSTALL.html LICENSE pub-htaccess.txt readme.txt \
- robots.txt root-htaccess.txt subdir-htaccess.txt \
- foswiki_httpd_conf.txt ReleaseNotes01x01.html
- ${CHOWN} -R ${WWWOWN}:${WWWGRP} .
- ;;
- *)
- echo "Unexpected Argument $2!!!"
- exit 1
- ;;
-esac
-exit 0
diff --git a/www/foswiki/pkg-plist b/www/foswiki/pkg-plist
index 0d84bcc..54a0886 100644
--- a/www/foswiki/pkg-plist
+++ b/www/foswiki/pkg-plist
@@ -1,4 +1,6 @@
%%NOAPACHE%%%%CONFDIR%%/foswiki.conf.sample
+ at owner %%WWWOWN%%
+ at group %%WWWGRP%%
%%WWWDIR%%/AUTHORS
%%WWWDIR%%/COPYING
%%WWWDIR%%/COPYRIGHT
@@ -1141,7 +1143,9 @@
%%WWWDIR%%/lib/Foswiki/Validation.pm
%%WWWDIR%%/lib/Foswiki/ValidationException.pm
%%WWWDIR%%/lib/Foswiki/WebFilter.pm
- at unexec if [ "`md5 -q %D/%%WWWDIR%%/lib/LocalSite.cfg`" = "c648a70f925757e7e982a5a13d47cfe7" ]; then rm -f %D/%%WWWDIR%%/lib/LocalSite.cfg; fi
+ at unexec if cmp -s %D/%%WWWDIR%%/lib/LocalSite.cfg %D/%%WWWDIR%%/lib/LocalSite.cfg.sample; then rm -f %D/%%WWWDIR%%/lib/LocalSite.cfg; fi
+%%WWWDIR%%/lib/LocalSite.cfg.sample
+ at exec cp -n %D/%F %B/%%WWWDIR%%/lib/LocalSite.cfg
%%WWWDIR%%/lib/MANIFEST
%%WWWDIR%%/lib/Monitor.pm
%%WWWDIR%%/lib/TWiki.pm
@@ -6139,6 +6143,16 @@
%%WWWDIR%%/working/registration_approvals/README
%%WWWDIR%%/working/tmp/README
%%WWWDIR%%/working/work_areas/README
+ at exec find %%WWWDIR%% -type d -exec ${CHMOD} 755 {} \;
+ at exec find %%WWWDIR%%/data -name '*.txt' -type f -exec ${CHMOD} 644 {} \;
+ at exec find %%WWWDIR%%/data %%WWWDIR%%/pub -name '*,v' -type f -exec ${CHMOD} 444 {} \;
+ at exec find %%WWWDIR%%/lib -type f -exec ${CHMOD} 444 {} \;
+ at exec find %%WWWDIR%%/locale -type f -exec ${CHMOD} 444 {} \;
+ at exec find %%WWWDIR%%/pub -type f -exec ${CHMOD} 644 {} \;
+ at exec find %%WWWDIR%%/bin -type f -exec ${CHMOD} 555 {} \;
+ at exec find %%WWWDIR%%/templates -type f -exec ${CHMOD} 444 {} \;
+ at exec find %%WWWDIR%%/tools -type f -exec ${CHMOD} 555 {} \;
+ at exec chmod 644 %%WWWDIR%%/data/mime.types
@dirrmtry %%WWWDIR%%/working/work_areas
@dirrmtry %%WWWDIR%%/working/tmp
@dirrmtry %%WWWDIR%%/working/registration_approvals
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list