1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

- Stagify

- Fix rc.d script
- Convert USE_BZIP2 to USES
This commit is contained in:
Dmitry Marakasov 2014-05-20 23:24:53 +00:00
parent 45fdaf26b0
commit 7a66c8b4de
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=354696
4 changed files with 12 additions and 26 deletions

View File

@ -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 <bsd.port.mk>

View File

@ -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

View File

@ -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

View File

@ -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()