aboutsummaryrefslogtreecommitdiffstats
path: root/www/autoindex2
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2014-08-14 06:35:47 +0800
committermarino <marino@FreeBSD.org>2014-08-14 06:35:47 +0800
commit9c62d80c94c3e847f67634b90335a9eba2d584ec (patch)
tree543cd096ac2ec2f51d18dbac8b9884c3862a2083 /www/autoindex2
parent0cca7b2b897a4ff79284343b059c203e0c2f21d8 (diff)
downloadfreebsd-ports-gnome-9c62d80c94c3e847f67634b90335a9eba2d584ec.tar.gz
freebsd-ports-gnome-9c62d80c94c3e847f67634b90335a9eba2d584ec.tar.zst
freebsd-ports-gnome-9c62d80c94c3e847f67634b90335a9eba2d584ec.zip
Stage www/autoindex2
The original port had several issues with it beyond staging. For example, the INSTALLDIR mechanism didn't work because the PLIST_SUB was hardcoded for WWWDIR. All sorts of CHMOD'ing was going on because COPYTREE_SHARE hadn't been used. The config.php was installed directly and therefore overwritten and/or removed each time the port was de/reinstalled. The prefetch didn't work because it checked if INSTALLDIR was defined, but the makefile always defines it. The whole thing had to be reworked, so very little of provided patch actually got used. PR: 190009 Submitted by: Joe (thralling.com) Approved by: Nobody, maintainer was reset Lotsa TLC: marino
Diffstat (limited to 'www/autoindex2')
-rw-r--r--www/autoindex2/Makefile35
-rw-r--r--www/autoindex2/pkg-plist13
2 files changed, 20 insertions, 28 deletions
diff --git a/www/autoindex2/Makefile b/www/autoindex2/Makefile
index 07a059f5e578..79edc7a09052 100644
--- a/www/autoindex2/Makefile
+++ b/www/autoindex2/Makefile
@@ -3,47 +3,30 @@
PORTNAME= AutoIndex
PORTVERSION= 2.2.4
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= SF/${PORTNAME:tl}/${PORTNAME}%20PHP%20Script%202.x/${PORTNAME}%20PHP%20${PORTVERSION}
MAINTAINER= ports@FreeBSD.org
-COMMENT= PHP 5.x script that makes a table that lists the files in a directory
+COMMENT= PHP 5.x script that put a directory listing into a table
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
USES= dos2unix
USE_PHP= session
-DEFAULT_PHP_VER= 5
+DEFAULT_VERSIONS= php=5
CONFLICTS= AutoIndex-1*
LATEST_LINK= AutoIndex2
NO_BUILD= yes
-PLIST_SUB+= INSTALLDIR=${WWWDIR:S,^${PREFIX}/,,}
-
-NO_STAGE= yes
-pre-fetch:
-.if !defined(INSTALLDIR)
- @${ECHO_MSG} ""
- @${ECHO_MSG} "Define INSTALLDIR to override default of '${WWWDIR}'."
- @${ECHO_MSG} ""
-.endif
-
INSTALLDIR?= ${WWWDIR}
+PLIST_SUB= WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} \
+ INSTALLDIR=${INSTALLDIR:S,^${PREFIX}/,,}
do-install:
- @${MKDIR} ${INSTALLDIR}
- @${CP} -R ${WRKSRC}/* ${INSTALLDIR}
- @${CP} -p ${WRKSRC}/.htpasswd.autoindex ${INSTALLDIR}/.htpasswd.autoindex-dist
- @${CHOWN} -R ${WWWOWN}:${WWWGRP} ${INSTALLDIR}
- @${CHMOD} -R 644 ${INSTALLDIR}/* ${INSTALLDIR}/.htpasswd.autoindex-dist
- @${CHMOD} 755 ${INSTALLDIR}/classes ${INSTALLDIR}/index_icons ${INSTALLDIR}/languages ${INSTALLDIR}/templates
- @${CHMOD} 755 ${INSTALLDIR}/index_icons/* ${INSTALLDIR}/templates/default ${INSTALLDIR}/templates/simple_image_gallery
- @${CHMOD} 664 ${INSTALLDIR}/config.php
- @${ECHO_CMD} ""
-
-post-install:
-.if !defined(BATCH)
- @${CAT} ${PKGMESSAGE}
-.endif
+ @${MKDIR} ${STAGEDIR}${INSTALLDIR}
+ cd ${WRKSRC} && ${MV} config.php config.php.sample
+ cd ${WRKSRC} && ${MV} .htpasswd.autoindex .htpasswd.autoindex.sample
+ cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${INSTALLDIR}
.include <bsd.port.mk>
diff --git a/www/autoindex2/pkg-plist b/www/autoindex2/pkg-plist
index 9f1a4c9745c1..c6f6c1245a48 100644
--- a/www/autoindex2/pkg-plist
+++ b/www/autoindex2/pkg-plist
@@ -1,5 +1,12 @@
-%%INSTALLDIR%%/.htpasswd.autoindex-dist
-%%INSTALLDIR%%/config.php
+@owner %%WWWOWN%%
+@group %%WWWGRP%%
+@mode 644
+%%INSTALLDIR%%/.htpasswd.autoindex.sample
+@mode 664
+@unexec if cmp -s %D/%%INSTALLDIR%%/config.php.sample %D/%%INSTALLDIR%%/config.php; then rm -f %D/%%INSTALLDIR%%/config.php; fi
+%%INSTALLDIR%%/config.php.sample
+@exec if [ ! -f %D/%%INSTALLDIR%%/config.php ] ; then cp -p %D/%F %B/config.php; fi
+@mode
%%INSTALLDIR%%/hidden_files
%%INSTALLDIR%%/change_log.html
%%INSTALLDIR%%/index.php
@@ -223,6 +230,8 @@
%%INSTALLDIR%%/templates/simple_image_gallery/table_footer.tpl
%%INSTALLDIR%%/templates/simple_image_gallery/table_header.tpl
%%INSTALLDIR%%/templates/readme.html
+@owner
+@group
@dirrm %%INSTALLDIR%%/classes
@dirrm %%INSTALLDIR%%/index_icons/apache
@dirrm %%INSTALLDIR%%/index_icons/kde