diff --git a/www/twms/Makefile b/www/twms/Makefile index 9961f12add77..575444a6f505 100644 --- a/www/twms/Makefile +++ b/www/twms/Makefile @@ -3,6 +3,7 @@ PORTNAME= twms PORTVERSION= 0.02w +PORTREVISION= 1 CATEGORIES= www astro MASTER_SITES= GOOGLE_CODE @@ -16,7 +17,7 @@ RUN_DEPENDS= ${PYTHON_SITELIBDIR}/pyproj/__init__.py:${PORTSDIR}/graphics/py-pyp ${PYTHON_SITELIBDIR}/web/__init__.py:${PORTSDIR}/www/webpy \ ${PYTHON_SITELIBDIR}/PIL/__init__.py:${PORTSDIR}/graphics/py-imaging -USE_BZIP2= yes +USES= tar:bzip2 USE_PYTHON= yes NO_BUILD= yes @@ -32,7 +33,6 @@ USE_RC_SUBR= twms USERS= ${TWMS_USER} GROUPS= ${TWMS_GROUP} -NO_STAGE= yes post-patch: @${REINPLACE_CMD} -e '1,1 s|/usr/bin/python|/usr/bin/env python|' ${WRKSRC}/twms.py @${REINPLACE_CMD} -e 's|/etc/twms/twms.conf|${PREFIX}/etc/twms.conf|' ${WRKSRC}/twms/twms.py @@ -42,17 +42,11 @@ post-patch: s|import fetchers|from twms &|' ${WRKSRC}/twms/twms.conf do-install: - ${MKDIR} ${PYTHONPREFIX_SITELIBDIR}/twms - ${INSTALL_DATA} ${WRKSRC}/twms/*.py ${PYTHONPREFIX_SITELIBDIR}/twms/ - ${INSTALL_SCRIPT} ${WRKSRC}/twms.py ${PREFIX}/bin/twms - ${MKDIR} ${DATADIR} - ${INSTALL_DATA} ${WRKSRC}/*.jpg ${DATADIR}/ - ${INSTALL_DATA} ${WRKSRC}/twms/twms.conf ${PREFIX}/etc/twms.conf.default - @if [ ! -f ${PREFIX}/etc/twms.conf ]; then \ - ${CP} -p ${PREFIX}/etc/twms.conf.default ${PREFIX}/etc/twms.conf ; \ - fi - -post-install: - @PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + ${MKDIR} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/twms + ${INSTALL_DATA} ${WRKSRC}/twms/*.py ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/twms/ + ${INSTALL_SCRIPT} ${WRKSRC}/twms.py ${STAGEDIR}${PREFIX}/bin/twms + ${MKDIR} ${STAGEDIR}${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/*.jpg ${STAGEDIR}${DATADIR}/ + ${INSTALL_DATA} ${WRKSRC}/twms/twms.conf ${STAGEDIR}${PREFIX}/etc/twms.conf.default .include diff --git a/www/twms/files/pkg-deinstall.in b/www/twms/files/pkg-deinstall.in index a47d8248d78a..6390d2d09a40 100644 --- a/www/twms/files/pkg-deinstall.in +++ b/www/twms/files/pkg-deinstall.in @@ -1,16 +1,12 @@ #!/bin/sh -USER=%%USER%% -GROUP=%%GROUP%% -CACHEDIR=%%CACHEDIR%% - if [ "$2" = "POST-DEINSTALL" ]; then echo "===> Removing tWMS cache directory" rm -rf "%%CACHEDIR%%" || exit 1 echo "===> Removing tWMS user and group" - if pw usershow "${USER}" >/dev/null 2>&1; then - pw userdel "${USER}" || exit 1 + if pw usershow "%%USER%%" >/dev/null 2>&1; then + pw userdel "%%USER%%" || exit 1 fi fi diff --git a/www/twms/files/pkg-install.in b/www/twms/files/pkg-install.in index 93c0a096c250..077cce10d7e2 100644 --- a/www/twms/files/pkg-install.in +++ b/www/twms/files/pkg-install.in @@ -1,14 +1,10 @@ #!/bin/sh -USER=%%USER%% -GROUP=%%GROUP%% -CACHEDIR=%%CACHEDIR%% - if [ "$2" = "POST-INSTALL" ]; then if [ ! -d "%%CACHEDIR%%" ]; then mkdir -p "%%CACHEDIR%%/cache" || exit 1 mkdir -p "%%CACHEDIR%%/traces" || exit 1 - chown -R "$USER:$GROUP" "%%CACHEDIR%%" || exit 1 + chown -R "%%USER%%:%%GROUP%%" "%%CACHEDIR%%" || exit 1 chmod -R 0775 "%%CACHEDIR%%" || exit 1 fi fi diff --git a/www/twms/files/twms.in b/www/twms/files/twms.in index c36c31a2c6e6..a2663e299362 100644 --- a/www/twms/files/twms.in +++ b/www/twms/files/twms.in @@ -24,7 +24,7 @@ load_rc_config $name twms_start() { - su -m ${twms_user} -c "nohup $command >/dev/null 2>&1 & ; echo \$! " | tail -1 > ${pidfile} + su -m ${twms_user} -c "nohup $command >/dev/null 2>&1 & echo \$! " | tail -1 > ${pidfile} } twms_stop()