svn commit: r364817 - head/www/autoindex2
John Marino
marino at FreeBSD.org
Wed Aug 13 22:35:48 UTC 2014
Author: marino
Date: Wed Aug 13 22:35:47 2014
New Revision: 364817
URL: http://svnweb.freebsd.org/changeset/ports/364817
QAT: https://qat.redports.org/buildarchive/r364817/
Log:
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
Modified:
head/www/autoindex2/Makefile
head/www/autoindex2/pkg-plist
Modified: head/www/autoindex2/Makefile
==============================================================================
--- head/www/autoindex2/Makefile Wed Aug 13 22:07:33 2014 (r364816)
+++ head/www/autoindex2/Makefile Wed Aug 13 22:35:47 2014 (r364817)
@@ -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 at 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>
Modified: head/www/autoindex2/pkg-plist
==============================================================================
--- head/www/autoindex2/pkg-plist Wed Aug 13 22:07:33 2014 (r364816)
+++ head/www/autoindex2/pkg-plist Wed Aug 13 22:35:47 2014 (r364817)
@@ -1,5 +1,12 @@
-%%INSTALLDIR%%/.htpasswd.autoindex-dist
-%%INSTALLDIR%%/config.php
+ at owner %%WWWOWN%%
+ at group %%WWWGRP%%
+ at mode 644
+%%INSTALLDIR%%/.htpasswd.autoindex.sample
+ at mode 664
+ at 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
+ at exec if [ ! -f %D/%%INSTALLDIR%%/config.php ] ; then cp -p %D/%F %B/config.php; fi
+ at 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
+ at owner
+ at group
@dirrm %%INSTALLDIR%%/classes
@dirrm %%INSTALLDIR%%/index_icons/apache
@dirrm %%INSTALLDIR%%/index_icons/kde
More information about the svn-ports-head
mailing list