Bug 169067 - [MAINTAINER] www/pivotx: PivotX is broken on PHP 5.4
Summary: [MAINTAINER] www/pivotx: PivotX is broken on PHP 5.4
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: Michael Scheidell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-14 13:50 UTC by fumifumi
Modified: 2012-07-03 12:00 UTC (History)
0 users

See Also:


Attachments
pivotx-2.3.3_1.patch (1.10 KB, patch)
2012-06-14 13:50 UTC, fumifumi
no flags Details | Diff
pivotx-2.3.3_1.patch (1.62 KB, patch)
2012-06-25 07:34 UTC, fumifumi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fumifumi 2012-06-14 13:50:01 UTC
Hi,

Add patch for PHP 5.4.
http://forum.pivotx.net/viewtopic.php?f=2&t=2905

Added file(s):
- files/patch-module_smarty.php

Thanks,

Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: ports)
Comment 1 Michael Scheidell freebsd_committer freebsd_triage 2012-06-16 13:47:51 UTC
Responsible Changed
From-To: freebsd-ports-bugs->scheidell

I'll take it.
Comment 2 Michael Scheidell freebsd_committer freebsd_triage 2012-06-16 13:53:18 UTC
State Changed
From-To: open->feedback

Did you want that patch for php52,php53 and php5 (5.4?) or as an 'extra-patch' for php54+ ? 
is this patch downward compatible with 5.3 and 5.2? 
Did you want to ask for WANT_PHP_VER 53+ 52+ 54+ if you don't want to support older version?
Comment 3 Michael Scheidell freebsd_committer freebsd_triage 2012-06-16 14:37:19 UTC
List of extra files and directories in / (not present on clean system 
but present after everything was deinstalled)
320     9141475 8 drwxr-xr-x 2 root wheel 512 Jun 16 13:21 
usr/local/share/doc/pivotx
321     5169121 352 -r--r--r-- 2 root wheel 179456 Apr 12 15:04 
usr/local/share/doc/pivotx/module_smarty.php.orig

-- 
Michael Scheidell, CTO
 >*| * SECNAP Network Security Corporation
d: +1.561.948.2259
w: http://people.freebsd.org/~scheidell
Comment 4 Michael Scheidell 2012-06-23 10:57:01 UTC
ping:

List of extra files and directories in / (not present on clean system
but present after everything was deinstalled)
320 9141475 8 drwxr-xr-x 2 root wheel 512 Jun 16 13:21
usr/local/share/doc/pivotx
321 5169121 352 -r--r--r-- 2 root wheel 179456 Apr 12 15:04
usr/local/share/doc/pivotx/module_smarty.php.orig


-- 
Michael Scheidell, CTO
o: 561-999-5000
d: 561-948-2259
 >*| *SECNAP Network Security Corporation

    * Best Mobile Solutions Product of 2011
    * Best Intrusion Prevention Product
    * Hot Company Finalist 2011
    * Best Email Security Product
    * Certified SNORT Integrator


______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.spammertrap.com/
______________________________________________________________________  
  
Comment 5 fumifumi 2012-06-25 07:34:33 UTC
Hi,

Thank you for taking care of this.

> List of extra files and directories in / (not present on clean system
> but present after everything was deinstalled)

Sorry, I've tested on the host with NOPORTDOCS=yes.

>> Did you want to ask for WANT_PHP_VER 53+ 52+ 54+ if you don't want to
support older version?
>Please add WANT_PHP_VER= 52+

This PivotX supports all PHP versions on the current FreeBSD ports
system, so ignore this.

Please use the attached patch instead.

Thank you,
Comment 6 Michael Scheidell freebsd_committer freebsd_triage 2012-06-25 11:57:23 UTC
On 6/25/12 2:34 AM, Fumiyuki Shimizu wrote:
> Hi,
>
> Thank you for taking care of this.
>
>> List of extra files and directories in / (not present on clean system
>> but present after everything was deinstalled)
> Sorry, I've tested on the host with NOPORTDOCS=yes.
>
so, let me ask a stupid question:

 %%PORTDOCS%%%%DOCSDIR%%/data.php.orig
+%%PORTDOCS%%%%DOCSDIR%%/module_smarty.php.orig

do you REALLY want the original (unpatched) php files in DOCSDIR?
or did you just put these in pkg-plist to keep pkg_delete quiet?
are these files that the user would want to see, ever? as part of documentation?

What I have seen in the past, is running something like this, post patch:
find {dir} -name '*.orig' -delete

(then you don't have to worry about keeping up with pkg-plist)

Did you want me to fix that part? or did you intend for *.orig files to be distributed with the package?


-- 
Michael Scheidell, CTO
>*| * SECNAP Network Security Corporation
d: +1.561.948.2259
w: http://people.freebsd.org/~scheidell
Comment 7 fumifumi 2012-06-25 14:52:12 UTC
----Next_Part(Mon_Jun_25_22_52_12_2012_631)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

 > %%PORTDOCS%%%%DOCSDIR%%/data.php.orig
 > +%%PORTDOCS%%%%DOCSDIR%%/module_smarty.php.orig

 > do you REALLY want the original (unpatched) php files in DOCSDIR?
 > or did you just put these in pkg-plist to keep pkg_delete quiet?
 > are these files that the user would want to see, ever? as part of
 > documentation?

 > What I have seen in the past, is running something like this, post patch:
 > find {dir} -name '*.orig' -delete

 > (then you don't have to worry about keeping up with pkg-plist)

You are absolutely right, and I've done it. Please use the attached
patch instead.

. Fix for PHP5.4 (Compatible with all PHP on the current FreeBSD ports)
. Stop copying original scripts before patching.
. Separate examples from documents.
. Supply default .htaccess unless exists.

Sorry for bothering times, and thank you and best regards,
---
Fumiyuki Shimizu

----Next_Part(Mon_Jun_25_22_52_12_2012_631)--
Content-Type: Application/Octet-Stream
Content-Transfer-Encoding: quoted-printable
Content-Description: pivotx-2.3.3_1.patch
Content-Disposition: attachment; filename="pivotx-2.3.3_1.patch"

--- pivotx-2.3.3_1.patch begins here ---
diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/Makefile ./Makefile
--- /usr/ports/www/pivotx/Makefile	2012-05-14 19:43:39.000000000 +0900
+++ ./Makefile	2012-06-25 22:24:27.000000000 +0900
@@ -7,6 +7,7 @@
 =

 PORTNAME=3D	pivotx
 PORTVERSION=3D	2.3.3
+PORTREVISION=3D	1
 CATEGORIES=3D	www
 MASTER_SITES=3D	SF/pivot-weblog/PivotX \
 		http://pivotx.net/files/ \
@@ -19,8 +20,8 @@
 =

 LICENSE=3D	GPLv2
 =

-DOCS=3D		LICENSE.txt README.txt example.htaccess
-DOCS_WRKSRC=3D	${WRKDIR}/${PORTNAME}-${PORTVERSION}-${PORTREVISION}-do=
cs
+DOCS=3D		LICENSE.txt README.txt
+EXAMPLES=3D	example.htaccess
 =

 # Requirements:
 # http://book.pivotx.net/index.php?page=3Dapp-e#anchor-determining-if-=
your-server-meets-pivotxs-requirements
@@ -68,13 +69,17 @@
 	@${MKDIR} '${TEMP_WRKSRC}'
 	@${MV} '${WRKDIR}/'* '${TEMP_WRKSRC}'
 	@${MV} '${TEMP_WRKSRC}' '${WRKSRC}'
-	@${MKDIR} '${DOCS_WRKSRC}'
+	@${MKDIR} '${TEMP_WRKSRC}'
 .for FILES in ${DOCS}
-	@${MV} '${WRKSRC}/${FILES}' '${DOCS_WRKSRC}'
+	@${MV} '${WRKSRC}/${FILES}' '${TEMP_WRKSRC}'
 .endfor
 =

 post-patch:
-	@cd '${WRKSRC}' && { ${FIND} . -type f -name '*.orig' -print0 | ${XAR=
GS} -0 -J % ${MV} % '${DOCS_WRKSRC}'; }
+.for FILES in ${EXAMPLES}
+	@${SED} -e 's#%%BLOGURL%%#${BLOGURL}#g' '${WRKSRC}/${FILES}' >'${TEMP=
_WRKSRC}/${FILES}'
+	@${RM} -f '${WRKSRC}/${FILES}'
+.endfor
+	@cd '${WRKSRC}' && ${FIND} . -type f -name '*.orig' -delete
 =

 do-install:
 	@if ${TEST} -e '${TEMP_DIFF}'; then ${RM} -f '${TEMP_DIFF}'; fi
@@ -96,10 +101,19 @@
 	 fi
 .if !defined(NOPORTDOCS)
 	@${MKDIR} '${DOCSDIR}'
-	@cd '${DOCS_WRKSRC}' && ${COPYTREE_SHARE} . '${DOCSDIR}'
+.for FILES in ${DOCS}
+	@${INSTALL_DATA} '${TEMP_WRKSRC}/${FILES}' '${DOCSDIR}'
+.endfor
+.endif
+.if !defined(NOPORTEXAMPLES)
+	@${MKDIR} '${EXAMPLESDIR}'
+.for FILES in ${EXAMPLES}
+	@${INSTALL_DATA} '${TEMP_WRKSRC}/${FILES}' '${EXAMPLESDIR}'
+.endfor
 .endif
 	@${MKDIR} '${WWWDIR}'
 	@cd '${WRKSRC}' && ${COPYTREE_SHARE} . '${WWWDIR}'
+	@if ! ${TEST} -e '${WWWDIR}/.htaccess'; then ${INSTALL_DATA} '${TEMP_=
WRKSRC}/example.htaccess' '${WWWDIR}/.htaccess'; fi
 .for DIR in ${WRITABLEDIRS}
 	@${CHOWN} -R '${WWWOWN}:${WWWGRP}' '${WWWDIR}/${DIR}'
 	@${FIND} '${WWWDIR}/${DIR}' -type d -print0 | ${XARGS} -0 ${CHMOD} u=3D=
rwx,go=3Drx
diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/files/patch-example.hta=
ccess ./files/patch-example.htaccess
--- /usr/ports/www/pivotx/files/patch-example.htaccess	1970-01-01 09:00=
:00.000000000 +0900
+++ ./files/patch-example.htaccess	2012-06-25 21:18:54.000000000 +0900
@@ -0,0 +1,11 @@
+--- example.htaccess.orig	2012-01-23 01:55:33.000000000 +0900
++++ example.htaccess	2012-06-25 20:28:53.000000000 +0900
+@@ -13,7 +13,7 @@
+ #php_flag magic_quotes_gpc 0
+ =

+ RewriteEngine On
+-# RewriteBase /
++RewriteBase /%%BLOGURL%%
+ =

+ # Standard PivotX rules for non-crufty URLs. The rules always work, b=
ut non-crufty
+ # URL must be enabled in the PivotX configuration too before they are=
 actually used. =

diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/files/patch-module_smar=
ty.php ./files/patch-module_smarty.php
--- /usr/ports/www/pivotx/files/patch-module_smarty.php	1970-01-01 09:0=
0:00.000000000 +0900
+++ ./files/patch-module_smarty.php	2012-06-14 21:03:20.000000000 +0900=

@@ -0,0 +1,11 @@
+--- pivotx/modules/module_smarty.php.orig	2012-04-13 00:04:12.00000000=
0 +0900
++++ pivotx/modules/module_smarty.php	2012-06-14 20:57:40.000000000 +09=
00
+@@ -5439,7 +5439,7 @@
+ /**
+  * @see $smarty->register_resource
+  */
+-function dbGetTemplate($tpl_name, $tpl_source, &$smarty_obj) {
++function dbGetTemplate($tpl_name, &$tpl_source, &$smarty_obj) {
+ =

+     if (isset($smarty_obj->custom_template[ $tpl_name ])) {
+         $tpl_source =3D $smarty_obj->custom_template[ $tpl_name ];
diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/files/pkg-message.in ./=
files/pkg-message.in
--- /usr/ports/www/pivotx/files/pkg-message.in	2011-03-17 22:13:04.0000=
00000 +0900
+++ ./files/pkg-message.in	2012-06-25 21:58:40.000000000 +0900
@@ -26,7 +26,7 @@
   http://localhost/%%BLOGURL%%/pivotx/
 Use usernames that are hard to guess.
 =

-%%DOCSDIR%%/example.htaccess is a sample .htaccess for %%WWWDIR%%.
+%%EXAMPLESDIR%%/example.htaccess is a sample .htaccess for %%WWWDIR%%.=

 =

 Setting date.timezone of %%PREFIX%%/etc/php.ini in POSIX style may
 ease your life.
diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/pkg-plist ./pkg-plist
--- /usr/ports/www/pivotx/pkg-plist	2012-05-14 19:43:39.000000000 +0900=

+++ ./pkg-plist	2012-06-25 22:29:02.000000000 +0900
@@ -1,7 +1,7 @@
 %%PORTDOCS%%%%DOCSDIR%%/LICENSE.txt
 %%PORTDOCS%%%%DOCSDIR%%/README.txt
-%%PORTDOCS%%%%DOCSDIR%%/example.htaccess
-%%PORTDOCS%%%%DOCSDIR%%/data.php.orig
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example.htaccess
+%%WWWDIR%%/.htaccess
 %%WWWDIR%%/images/index.html
 %%WWWDIR%%/index.php
 %%WWWDIR%%/pivotx/ajaxhelper.php
@@ -962,3 +962,4 @@
 @dirrm %%WWWDIR%%/images
 @dirrmtry %%WWWDIR%%
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
--- pivotx-2.3.3_1.patch ends here ---

----Next_Part(Mon_Jun_25_22_52_12_2012_631)----
Comment 8 fumifumi 2012-06-25 16:34:10 UTC
----Next_Part(Tue_Jun_26_00_34_10_2012_872)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

 > . Supply default .htaccess unless exists.

Cancelled, since this is excessive and incomplete. Please use the
attached patch. Sorry for one more bothering.

. Fix for PHP5.4 (Compatible with all PHP on the current FreeBSD ports)
. Stop copying original scripts before patching.
. Separate examples from documents.

Thank you and best regards,
---
Fumiyuki Shimizu

----Next_Part(Tue_Jun_26_00_34_10_2012_872)--
Content-Type: Application/Octet-Stream
Content-Transfer-Encoding: quoted-printable
Content-Description: pivotx-2.3.3_1.patch
Content-Disposition: attachment; filename="pivotx-2.3.3_1.patch"

--- pivotx-2.3.3_1.patch begins here ---
diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/Makefile ./Makefile
--- /usr/ports/www/pivotx/Makefile	2012-05-14 19:43:39.000000000 +0900
+++ ./Makefile	2012-06-26 00:15:01.000000000 +0900
@@ -7,6 +7,7 @@
 =

 PORTNAME=3D	pivotx
 PORTVERSION=3D	2.3.3
+PORTREVISION=3D	1
 CATEGORIES=3D	www
 MASTER_SITES=3D	SF/pivot-weblog/PivotX \
 		http://pivotx.net/files/ \
@@ -19,8 +20,8 @@
 =

 LICENSE=3D	GPLv2
 =

-DOCS=3D		LICENSE.txt README.txt example.htaccess
-DOCS_WRKSRC=3D	${WRKDIR}/${PORTNAME}-${PORTVERSION}-${PORTREVISION}-do=
cs
+DOCS=3D		LICENSE.txt README.txt
+EXAMPLES=3D	example.htaccess
 =

 # Requirements:
 # http://book.pivotx.net/index.php?page=3Dapp-e#anchor-determining-if-=
your-server-meets-pivotxs-requirements
@@ -68,13 +69,17 @@
 	@${MKDIR} '${TEMP_WRKSRC}'
 	@${MV} '${WRKDIR}/'* '${TEMP_WRKSRC}'
 	@${MV} '${TEMP_WRKSRC}' '${WRKSRC}'
-	@${MKDIR} '${DOCS_WRKSRC}'
+	@${MKDIR} '${TEMP_WRKSRC}'
 .for FILES in ${DOCS}
-	@${MV} '${WRKSRC}/${FILES}' '${DOCS_WRKSRC}'
+	@${MV} '${WRKSRC}/${FILES}' '${TEMP_WRKSRC}'
 .endfor
 =

 post-patch:
-	@cd '${WRKSRC}' && { ${FIND} . -type f -name '*.orig' -print0 | ${XAR=
GS} -0 -J % ${MV} % '${DOCS_WRKSRC}'; }
+.for FILES in ${EXAMPLES}
+	@${SED} -e 's#%%BLOGURL%%#${BLOGURL}#g' '${WRKSRC}/${FILES}' >'${TEMP=
_WRKSRC}/${FILES}'
+	@${RM} -f '${WRKSRC}/${FILES}'
+.endfor
+	@cd '${WRKSRC}' && ${FIND} . -type f -name '*.orig' -delete
 =

 do-install:
 	@if ${TEST} -e '${TEMP_DIFF}'; then ${RM} -f '${TEMP_DIFF}'; fi
@@ -96,7 +101,15 @@
 	 fi
 .if !defined(NOPORTDOCS)
 	@${MKDIR} '${DOCSDIR}'
-	@cd '${DOCS_WRKSRC}' && ${COPYTREE_SHARE} . '${DOCSDIR}'
+.for FILES in ${DOCS}
+	@${INSTALL_DATA} '${TEMP_WRKSRC}/${FILES}' '${DOCSDIR}'
+.endfor
+.endif
+.if !defined(NOPORTEXAMPLES)
+	@${MKDIR} '${EXAMPLESDIR}'
+.for FILES in ${EXAMPLES}
+	@${INSTALL_DATA} '${TEMP_WRKSRC}/${FILES}' '${EXAMPLESDIR}'
+.endfor
 .endif
 	@${MKDIR} '${WWWDIR}'
 	@cd '${WRKSRC}' && ${COPYTREE_SHARE} . '${WWWDIR}'
diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/files/patch-example.hta=
ccess ./files/patch-example.htaccess
--- /usr/ports/www/pivotx/files/patch-example.htaccess	1970-01-01 09:00=
:00.000000000 +0900
+++ ./files/patch-example.htaccess	2012-06-25 21:18:54.000000000 +0900
@@ -0,0 +1,11 @@
+--- example.htaccess.orig	2012-01-23 01:55:33.000000000 +0900
++++ example.htaccess	2012-06-25 20:28:53.000000000 +0900
+@@ -13,7 +13,7 @@
+ #php_flag magic_quotes_gpc 0
+ =

+ RewriteEngine On
+-# RewriteBase /
++RewriteBase /%%BLOGURL%%
+ =

+ # Standard PivotX rules for non-crufty URLs. The rules always work, b=
ut non-crufty
+ # URL must be enabled in the PivotX configuration too before they are=
 actually used. =

diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/files/patch-module_smar=
ty.php ./files/patch-module_smarty.php
--- /usr/ports/www/pivotx/files/patch-module_smarty.php	1970-01-01 09:0=
0:00.000000000 +0900
+++ ./files/patch-module_smarty.php	2012-06-14 21:03:20.000000000 +0900=

@@ -0,0 +1,11 @@
+--- pivotx/modules/module_smarty.php.orig	2012-04-13 00:04:12.00000000=
0 +0900
++++ pivotx/modules/module_smarty.php	2012-06-14 20:57:40.000000000 +09=
00
+@@ -5439,7 +5439,7 @@
+ /**
+  * @see $smarty->register_resource
+  */
+-function dbGetTemplate($tpl_name, $tpl_source, &$smarty_obj) {
++function dbGetTemplate($tpl_name, &$tpl_source, &$smarty_obj) {
+ =

+     if (isset($smarty_obj->custom_template[ $tpl_name ])) {
+         $tpl_source =3D $smarty_obj->custom_template[ $tpl_name ];
diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/files/pkg-message.in ./=
files/pkg-message.in
--- /usr/ports/www/pivotx/files/pkg-message.in	2011-03-17 22:13:04.0000=
00000 +0900
+++ ./files/pkg-message.in	2012-06-25 21:58:40.000000000 +0900
@@ -26,7 +26,7 @@
   http://localhost/%%BLOGURL%%/pivotx/
 Use usernames that are hard to guess.
 =

-%%DOCSDIR%%/example.htaccess is a sample .htaccess for %%WWWDIR%%.
+%%EXAMPLESDIR%%/example.htaccess is a sample .htaccess for %%WWWDIR%%.=

 =

 Setting date.timezone of %%PREFIX%%/etc/php.ini in POSIX style may
 ease your life.
diff -ruN --exclude=3DCVS /usr/ports/www/pivotx/pkg-plist ./pkg-plist
--- /usr/ports/www/pivotx/pkg-plist	2012-05-14 19:43:39.000000000 +0900=

+++ ./pkg-plist	2012-06-26 00:14:26.000000000 +0900
@@ -1,7 +1,6 @@
 %%PORTDOCS%%%%DOCSDIR%%/LICENSE.txt
 %%PORTDOCS%%%%DOCSDIR%%/README.txt
-%%PORTDOCS%%%%DOCSDIR%%/example.htaccess
-%%PORTDOCS%%%%DOCSDIR%%/data.php.orig
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/example.htaccess
 %%WWWDIR%%/images/index.html
 %%WWWDIR%%/index.php
 %%WWWDIR%%/pivotx/ajaxhelper.php
@@ -962,3 +961,4 @@
 @dirrm %%WWWDIR%%/images
 @dirrmtry %%WWWDIR%%
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
--- pivotx-2.3.3_1.patch ends here ---

----Next_Part(Tue_Jun_26_00_34_10_2012_872)----
Comment 9 dfilter service freebsd_committer freebsd_triage 2012-07-03 11:54:13 UTC
scheidell    2012-07-03 10:53:59 UTC

  FreeBSD ports repository

  Modified files:
    www/pivotx           Makefile pkg-plist 
    www/pivotx/files     pkg-message.in 
  Added files:
    www/pivotx/files     patch-example.htaccess 
                         patch-module_smarty.php 
  Log:
  - Unbreak on PHP 5.4 [1]
  - Supply default .htaccess in PORTEXAMPLES [1]
  - Use PORT(DOCS|EXAMPLES) MACRO's for pkg-plist [2]
  
  PR:             ports/169067 [1]
  Submitted by:   Fumiyuki Shimizu <fumifumi@abacustech.jp> (maintainer) [1]
  Reviewed by:    scheidell@ (me) [2]
  
  Revision  Changes    Path
  1.9       +20 -7     ports/www/pivotx/Makefile
  1.1       +11 -0     ports/www/pivotx/files/patch-example.htaccess (new)
  1.1       +11 -0     ports/www/pivotx/files/patch-module_smarty.php (new)
  1.3       +1 -1      ports/www/pivotx/files/pkg-message.in
  1.8       +1 -6      ports/www/pivotx/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 10 Michael Scheidell freebsd_committer freebsd_triage 2012-07-03 11:55:21 UTC
State Changed
From-To: feedback->closed

Committed, with two minor changes. DOCS->PORTDOCS, (and EXAMPLES), then 
you don't need to put them in pkg-plist.  Built in macro's will keep 
pkg-plist up to date.  See my changes to pkg-plist, and yes, it works.