mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-21 00:25:50 +00:00
net-mgmt/rackmonkey: stage
PR: 191742 (with slight modifications) Submitted by: ecrist@secure-computing.net (maintainer)
This commit is contained in:
parent
cd5f5641c9
commit
e2b87648a3
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=361324
@ -11,7 +11,7 @@ MASTER_SITES= SF \
|
||||
DISTNAME= ${PORTNAME}-${PORTVERSION}-1
|
||||
|
||||
MAINTAINER= ecrist@secure-computing.net
|
||||
COMMENT= A web-based tool for managing racks of equipment
|
||||
COMMENT= Web-based tool for managing racks of equipment
|
||||
|
||||
RUN_DEPENDS= p5-DBI>=0:${PORTSDIR}/databases/p5-DBI \
|
||||
p5-HTML-Template>=0:${PORTSDIR}/www/p5-HTML-Template \
|
||||
@ -22,7 +22,7 @@ RUN_DEPENDS= p5-DBI>=0:${PORTSDIR}/databases/p5-DBI \
|
||||
OPTIONS_DEFINE= SQLITE MYSQL PGSQL INIT_DB SAMPLE
|
||||
OPTIONS_DEFAULT= SQLITE INIT_DB SAMPLE
|
||||
INIT_DB_DESC= Initialize DB at installation (SQLite Only)
|
||||
SAMPLE_DESC= Install sample data (SQLite Only)
|
||||
SAMPLE_DESC= Install sample data (SQLite Only)
|
||||
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-1
|
||||
NO_BUILD= YES
|
||||
@ -32,7 +32,6 @@ USE_PERL5= run
|
||||
|
||||
SUB_FILES= pkg-message
|
||||
|
||||
NO_STAGE= yes
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
.if ${PORT_OPTIONS:MSQLITE}
|
||||
@ -60,32 +59,32 @@ SAMPLE= yes
|
||||
.endif
|
||||
|
||||
do-install:
|
||||
${MKDIR} ${WWWDIR}/
|
||||
${INSTALL} ${WRKSRC}/perl/rackmonkey.pl ${WRKSRC}/perl/rack2xls.pl ${WRKSRC}/perl/rackdns.pl ${WWWDIR}/
|
||||
cd ${WRKSRC}/www && ${COPYTREE_SHARE} \* ${WWWDIR}/
|
||||
cd ${WRKSRC} && ${COPYTREE_SHARE} tmpl ${WWWDIR}/
|
||||
cd ${WRKSRC}/perl && ${COPYTREE_SHARE} RackMonkey ${WWWDIR}/
|
||||
${MKDIR} ${STAGEDIR}${WWWDIR}/
|
||||
${INSTALL} ${WRKSRC}/perl/rackmonkey.pl ${WRKSRC}/perl/rack2xls.pl ${WRKSRC}/perl/rackdns.pl ${STAGEDIR}${WWWDIR}/
|
||||
cd ${WRKSRC}/www && ${COPYTREE_SHARE} \* ${STAGEDIR}${WWWDIR}/
|
||||
cd ${WRKSRC} && ${COPYTREE_SHARE} tmpl ${STAGEDIR}${WWWDIR}/
|
||||
cd ${WRKSRC}/perl && ${COPYTREE_SHARE} RackMonkey ${STAGEDIR}${WWWDIR}/
|
||||
${MKDIR} ${WRKDIR}/build_conf; \
|
||||
${CP} ${WRKSRC}/conf/rackmonkey.conf-default ${WRKDIR}/build_conf/rackmonkey.conf; \
|
||||
if [ "${USE_SQLITE}" ]; then \
|
||||
${ECHO} "Building with SQLite............."; \
|
||||
${SED} -i '' -e 's%dbconnect =%dbconnect = dbi:SQLite:dbname=${WWWDIR}/rackmonkey.db%' ${WRKDIR}/build_conf/rackmonkey.conf; \
|
||||
if [ "${INIT_DB}" ]; then \
|
||||
if [ -e "${WWWDIR}/rackmonkey.db" ]; then \
|
||||
if [ -e "${STAGEDIR}${WWWDIR}/rackmonkey.db" ]; then \
|
||||
${ECHO} "Database exists, skipping initalization..."; \
|
||||
else \
|
||||
${LOCALBASE}/bin/sqlite3 ${WWWDIR}/rackmonkey.db < ${WRKSRC}/sql/schema/schema.sqlite.sql; \
|
||||
${LOCALBASE}/bin/sqlite3 ${WWWDIR}/rackmonkey.db < ${WRKSRC}/sql/data/default_data.sql; \
|
||||
${LOCALBASE}/bin/sqlite3 ${STAGEDIR}${WWWDIR}/rackmonkey.db < ${WRKSRC}/sql/schema/schema.sqlite.sql; \
|
||||
${LOCALBASE}/bin/sqlite3 ${STAGEDIR}${WWWDIR}/rackmonkey.db < ${WRKSRC}/sql/data/default_data.sql; \
|
||||
if [ "${SAMPLE}" ]; then \
|
||||
${LOCALBASE}/bin/sqlite3 ${WWWDIR}/rackmonkey.db < ${WRKSRC}/sql/data/sample_data.sql; \
|
||||
${LOCALBASE}/bin/sqlite3 ${STAGEDIR}${WWWDIR}/rackmonkey.db < ${WRKSRC}/sql/data/sample_data.sql; \
|
||||
fi \
|
||||
fi \
|
||||
fi \
|
||||
elif [ "${USE_MYSQL}" -o "${USE_PGSQL}" ]; then \
|
||||
${INSTALL} ${WRKSRC}/conf/rackmonkey.conf-default ${WWWDIR}/; \
|
||||
${INSTALL} ${WRKSRC}/conf/rackmonkey.conf-default ${STAGEDIR}${WWWDIR}/; \
|
||||
fi
|
||||
if [ -e "${WWWDIR}/rackmonkey.conf" ]; then \
|
||||
${MV} ${WWWDIR}/rackmonkey.conf ${WWWDIR}/rackmonkey.conf.old; \
|
||||
${MV} ${WWWDIR}/rackmonkey.conf ${STAGEDIR}${WWWDIR}/rackmonkey.conf.old; \
|
||||
fi
|
||||
${SED} -i '' \
|
||||
-e 's/#plugin_xls/plugin_xls/' \
|
||||
@ -93,11 +92,9 @@ do-install:
|
||||
-e 's%tmplpath =%tmplpath = ${WWWDIR}/tmpl%' \
|
||||
-e 's%wwwpath =%wwwpath = /rackmonkey%' \
|
||||
${WRKDIR}/build_conf/rackmonkey.conf
|
||||
${INSTALL} ${WRKDIR}/build_conf/rackmonkey.conf ${WWWDIR}/
|
||||
${INSTALL} ${WRKDIR}/build_conf/rackmonkey.conf ${WWWDIR}/rackmonkey.conf-default
|
||||
cd ${WRKSRC} && ${COPYTREE_SHARE} sql ${WWWDIR}/
|
||||
cd ${WRKSRC} && ${COPYTREE_SHARE} doc ${WWWDIR}/
|
||||
${CHOWN} -R 80:80 ${WWWDIR}
|
||||
cd ${WRKSRC} && ${COPYTREE_SHARE} sql ${STAGEDIR}${WWWDIR}/
|
||||
cd ${WRKSRC} && ${COPYTREE_SHARE} doc ${STAGEDIR}${WWWDIR}/
|
||||
${CHOWN} -R 80:80 ${STAGEDIR}${WWWDIR}
|
||||
${CAT} ${PKGMESSAGE}
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -127,7 +127,7 @@
|
||||
%%WWWDIR%%/doc/troubleshooting.txt
|
||||
%%WWWDIR%%/doc/upgrade.txt
|
||||
@unexec if cmp -s %D/%%WWWDIR%%/rackmonkey.conf-default %D/%%WWWDIR%%/rackmonkey.conf; then rm -f %D/%%WWWDIR%%/rackmonkey.conf; fi
|
||||
%%WWWDIR%%/rackmonkey.conf-default
|
||||
@exec if [ ! -f %D/%%WWWDIR%%/rackmonkey.conf ] ; then cp -p %D/%F %B/%%WWWDIR%%/rackmonkey.conf; fi
|
||||
@dirrmtry %%WWWDIR%%/graphics/help
|
||||
@dirrmtry %%WWWDIR%%/graphics/icons
|
||||
@dirrmtry %%WWWDIR%%/graphics
|
||||
|
Loading…
Reference in New Issue
Block a user