1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

- Stage support

- Add a second MASTER_SITE
- Suffix patch and resulting files for .htaccess and .htpasswd with ".sample"

PR:		ports/187798
Submitted by:	Lukasz Wasikowski <lukasz@wasikowski.net> (maintainer)
This commit is contained in:
Rene Ladan 2014-04-06 15:15:52 +00:00
parent 0318479619
commit 5c1d26756b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=350365
5 changed files with 17 additions and 32 deletions

View File

@ -4,7 +4,8 @@
PORTNAME= sgwi
PORTVERSION= 1.1.6
CATEGORIES= mail www
MASTER_SITES= http://www.vanheusden.com/sgwi/
MASTER_SITES= http://www.vanheusden.com/sgwi/ \
http://lukasz.wasikowski.net/files/
DISTNAME= sqlgreywebinterface-${PORTVERSION}
EXTRACT_SUFX= .tgz
@ -25,7 +26,6 @@ PGSQL_DESC= PostgreSQL back-end (use pgsql PHP extension)
OPTIONS_DEFAULT=MYSQL
NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MMYSQL}
@ -42,31 +42,14 @@ post-patch:
${FIND} ${WRKSRC} -name '*.orig' -delete
do-install:
@[ ! -f ${WRKSRC}/.htpasswd ] || ${MV} ${WRKSRC}/.htpasswd ${WRKSRC}/.htpasswd.sample
@[ ! -f ${WRKSRC}/.htaccess ] || ${MV} ${WRKSRC}/.htaccess ${WRKSRC}/.htaccess.sample
@[ ! -f ${WRKSRC}/includes/config.inc.php ] || ${MV} ${WRKSRC}/includes/config.inc.php ${WRKSRC}/includes/config.inc.php.sample
@${MKDIR} ${WWWDIR}
@${MKDIR} ${WWWDIR}/includes
${INSTALL_DATA} ${WRKSRC}/*.php ${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/*.txt ${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/*.css ${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/.ht* ${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/includes/*.sample ${WWWDIR}/includes/
${INSTALL_DATA} ${WRKSRC}/includes/*.php ${WWWDIR}/includes/
@if [ -f ${WWWDIR}/config.inc.php ]; then \
${MV} ${WWWDIR}/config.inc.php ${WWWDIR}/includes/config.inc.php; \
fi
@[ -f ${WWWDIR}/includes/config.inc.php ] || \
${CP} ${WWWDIR}/includes/config.inc.php.sample ${WWWDIR}/includes/config.inc.php
@[ -f ${WWWDIR}/.htpasswd ] || \
${CP} ${WWWDIR}/.htpasswd.sample ${WWWDIR}/.htpasswd
@[ -f ${WWWDIR}/.htaccess ] || \
${CP} ${WWWDIR}/.htaccess.sample ${WWWDIR}/.htaccess
post-install:
@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${WWWDIR}/
@${CHOWN} root ${WWWDIR}/.ht* ${WWWDIR}/includes/config.inc.php*
@${CHMOD} -R 0640 ${WWWDIR}/*.php ${WWWDIR}/*.txt ${WWWDIR}/*.css ${WWWDIR}/.ht* ${WWWDIR}/includes/*.php ${WWWDIR}/includes/*.sample
@${CAT} ${PKGMESSAGE}
@${MV} ${WRKSRC}/includes/config.inc.php ${WRKSRC}/includes/config.inc.php.sample
@${MKDIR} ${STAGEDIR}${WWWDIR}
@${MKDIR} ${STAGEDIR}${WWWDIR}/includes
${INSTALL_DATA} ${WRKSRC}/*.php ${STAGEDIR}${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/*.txt ${STAGEDIR}${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/*.css ${STAGEDIR}${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/.ht* ${STAGEDIR}${WWWDIR}
${INSTALL_DATA} ${WRKSRC}/includes/*.sample ${STAGEDIR}${WWWDIR}/includes/
${INSTALL_DATA} ${WRKSRC}/includes/*.php ${STAGEDIR}${WWWDIR}/includes/
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
--- /dev/null 2008-03-11 22:05:01.000000000 +0100
+++ .htaccess 2008-03-11 22:03:36.000000000 +0100
+++ .htaccess.sample 2008-03-11 22:03:36.000000000 +0100
@@ -0,0 +1,8 @@
+AuthUserFile /usr/local/www/sgwi/.htpasswd
+AuthGroupFile /dev/null

View File

@ -1,4 +1,4 @@
--- /dev/null 2008-03-11 22:05:01.000000000 +0100
+++ .htpasswd 2008-03-11 22:02:21.000000000 +0100
+++ .htpasswd.sample 2008-03-11 22:02:21.000000000 +0100
@@ -0,0 +1 @@
+admin:1Cm2R1zl5.LII

View File

@ -7,6 +7,7 @@ WWWGRP=%%WWWGRP%%
if [ "$2" != "POST-INSTALL" ]; then
exit 0
else
/usr/sbin/chown ${WWWOWN}:${WWWGRP} ${WWWDIR}/includes/
/usr/bin/chgrp ${WWWGRP} ${WWWDIR}/.ht* ${WWWDIR}/includes/config.inc.php
/usr/sbin/chown -R ${WWWOWN}:${WWWGRP} ${WWWDIR}
/usr/sbin/chown root:${WWWGRP} ${WWWDIR}/.ht* ${WWWDIR}/includes/config.inc.php*
/bin/chmod -R 0640 ${STAGEDIR}${WWWDIR}/*.php ${STAGEDIR}${WWWDIR}/*.txt ${STAGEDIR}${WWWDIR}/*.css ${STAGEDIR}${WWWDIR}/.ht* ${STAGEDIR}${WWWDIR}/includes/*.php ${STAGEDIR}${WWWDIR}/includes/*.sample
fi

View File

@ -7,6 +7,7 @@ www/sgwi/.htpasswd.sample
www/sgwi/awl.php
www/sgwi/connect.php
www/sgwi/includes/awl.inc.php
@exec [ -f %D/www/sgwi/config.inc.php ] && mv -f %D/www/sgwi/config.inc.php %D/www/sgwi/includes/config.inc.php
@unexec if cmp -s %D/www/sgwi/includes/config.inc.php %D/www/sgwi/includes/config.inc.php.sample; then rm -f %D/www/sgwi/includes/config.inc.php; fi
www/sgwi/includes/config.inc.php.sample
@exec [ -f %B/config.inc.php ] || cp %B/%f %B/config.inc.php