diff options
author | amdmi3 <amdmi3@FreeBSD.org> | 2010-09-08 23:27:32 +0800 |
---|---|---|
committer | amdmi3 <amdmi3@FreeBSD.org> | 2010-09-08 23:27:32 +0800 |
commit | 619f31df4f9f80981619a8622a12871c9b373d6b (patch) | |
tree | 4bcf4f38a88b7aee92d5257846e0920c6c38aef2 /www/twms | |
parent | cf47ac64ffd25c1d4cd9da28879ff2338f008bc9 (diff) | |
download | freebsd-ports-gnome-619f31df4f9f80981619a8622a12871c9b373d6b.tar.gz freebsd-ports-gnome-619f31df4f9f80981619a8622a12871c9b373d6b.tar.zst freebsd-ports-gnome-619f31df4f9f80981619a8622a12871c9b373d6b.zip |
tWMS is a tiny WMS server written in Python and using tiles as a
backend storage
WWW: http://code.google.com/p/twms/
Diffstat (limited to 'www/twms')
-rw-r--r-- | www/twms/Makefile | 61 | ||||
-rw-r--r-- | www/twms/distinfo | 3 | ||||
-rw-r--r-- | www/twms/files/pkg-deinstall.in | 17 | ||||
-rw-r--r-- | www/twms/files/pkg-install.in | 16 | ||||
-rw-r--r-- | www/twms/files/twms.in | 40 | ||||
-rw-r--r-- | www/twms/pkg-descr | 4 | ||||
-rw-r--r-- | www/twms/pkg-plist | 23 |
7 files changed, 164 insertions, 0 deletions
diff --git a/www/twms/Makefile b/www/twms/Makefile new file mode 100644 index 000000000000..e9ccc37c062e --- /dev/null +++ b/www/twms/Makefile @@ -0,0 +1,61 @@ +# New ports collection makefile for: twms +# Date created: 01 Sep 2010 +# Whom: Dmitry Marakasov <amdmi3@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= twms +PORTVERSION= 0.02w +CATEGORIES= www astro +MASTER_SITES= GOOGLE_CODE + +MAINTAINER= amdmi3@FreeBSD.org +COMMENT= Tiny WMS server + +RUN_DEPENDS= ${PYTHON_SITELIBDIR}/pyproj/__init__.py:${PORTSDIR}/graphics/py-pyproj \ + ${PYTHON_SITELIBDIR}/web/__init__.py:${PORTSDIR}/www/webpy \ + ${PYTHON_SITELIBDIR}/PIL/__init__.py:${PORTSDIR}/graphics/py-imaging + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/COPYING + +USE_BZIP2= yes +USE_PYTHON= 2.6+ +NO_BUILD= yes + +TWMS_USER?= twms +TWMS_GROUP?= twms +TWMS_CACHEDIR?= /var/cache/twms + +SUB_FILES= pkg-install pkg-deinstall +SUB_LIST+= USER=${TWMS_USER} GROUP=${TWMS_GROUP} CACHEDIR=${TWMS_CACHEDIR} + +USE_RC_SUBR= twms + +USERS= ${TWMS_USER} +GROUPS= ${TWMS_GROUP} + +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 + @${REINPLACE_CMD} -e '/tiles_cache =/ s|".*"|"${TWMS_CACHEDIR}/cache/"|; \ + /install_path =/ s|".*"|"${DATADIR}/"|; \ + /gpx_cache =/ s|".*"|"${TWMS_CACHEDIR}/traces/"|; \ + 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 + +.include <bsd.port.mk> diff --git a/www/twms/distinfo b/www/twms/distinfo new file mode 100644 index 000000000000..bbc977f808e7 --- /dev/null +++ b/www/twms/distinfo @@ -0,0 +1,3 @@ +MD5 (twms-0.02w.tar.bz2) = 98b30a3800231b1b6757ffdd9d4370fe +SHA256 (twms-0.02w.tar.bz2) = 085f0635e0535387e5e343106740be60e7f49ac75483dfc4f461b1d1c4c207c1 +SIZE (twms-0.02w.tar.bz2) = 35010 diff --git a/www/twms/files/pkg-deinstall.in b/www/twms/files/pkg-deinstall.in new file mode 100644 index 000000000000..a47d8248d78a --- /dev/null +++ b/www/twms/files/pkg-deinstall.in @@ -0,0 +1,17 @@ +#!/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 + fi +fi + +exit 0 diff --git a/www/twms/files/pkg-install.in b/www/twms/files/pkg-install.in new file mode 100644 index 000000000000..93c0a096c250 --- /dev/null +++ b/www/twms/files/pkg-install.in @@ -0,0 +1,16 @@ +#!/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 + chmod -R 0775 "%%CACHEDIR%%" || exit 1 + fi +fi + +exit 0 diff --git a/www/twms/files/twms.in b/www/twms/files/twms.in new file mode 100644 index 000000000000..d6b8120713a6 --- /dev/null +++ b/www/twms/files/twms.in @@ -0,0 +1,40 @@ +#!/bin/sh +# +# PROVIDE: twms +# REQUIRE: DAEMON NETWORKING LOGIN +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable twms: +# twms_enable="YES" + +. /etc/rc.subr + +name=twms +rcvar=`set_rcvar` + +twms_enable=${twms_enable:-"NO"} +twms_user=%%USER%% +twms_group=%%GROUP%% +start_cmd="${name}_start" +stop_cmd="${name}_stop" +pidfile="/var/run/${name}.pid" +command="%%PREFIX%%/bin/twms" + +load_rc_config $name + +twms_start() +{ + su -m ${twms_user} -c "nohup $command >/dev/null 2>&1 & ; echo \$! " | tail -1 > ${pidfile} +} + +twms_stop() +{ + if [ -f ${pidfile} ]; then + rc_pid=`cat ${pidfile}` + kill -TERM $rc_pid + wait_for_pids $rc_pid + rm ${pidfile} + fi +} + +run_rc_command "$1" diff --git a/www/twms/pkg-descr b/www/twms/pkg-descr new file mode 100644 index 000000000000..4badc0fc3128 --- /dev/null +++ b/www/twms/pkg-descr @@ -0,0 +1,4 @@ +tWMS is a tiny WMS server written in Python and using tiles as a +backend storage + +WWW: http://code.google.com/p/twms/ diff --git a/www/twms/pkg-plist b/www/twms/pkg-plist new file mode 100644 index 000000000000..369094c45ba6 --- /dev/null +++ b/www/twms/pkg-plist @@ -0,0 +1,23 @@ +bin/twms +@unexec if cmp -s %D/etc/twms.conf.default %D/etc/twms.conf; then rm -f %D/etc/twms.conf; fi +etc/twms.conf.default +@exec if [ ! -f %D/etc/twms.conf ] ; then cp -p %D/%F %B/twms.conf; fi +%%PYTHON_SITELIBDIR%%/twms/__init__.py +%%PYTHON_SITELIBDIR%%/twms/bbox.py +%%PYTHON_SITELIBDIR%%/twms/canvas.py +%%PYTHON_SITELIBDIR%%/twms/capabilities.py +%%PYTHON_SITELIBDIR%%/twms/correctify.py +%%PYTHON_SITELIBDIR%%/twms/drawing.py +%%PYTHON_SITELIBDIR%%/twms/fetchers.py +%%PYTHON_SITELIBDIR%%/twms/filter.py +%%PYTHON_SITELIBDIR%%/twms/gpxparse.py +%%PYTHON_SITELIBDIR%%/twms/overview.py +%%PYTHON_SITELIBDIR%%/twms/projections.py +%%PYTHON_SITELIBDIR%%/twms/reproject.py +%%PYTHON_SITELIBDIR%%/twms/sketch.py +%%PYTHON_SITELIBDIR%%/twms/twms.py +%%DATADIR%%/irs_nxt.jpg +%%DATADIR%%/yahoo_nxt.jpg +%%DATADIR%%/yandex_nxt.jpg +@dirrm %%DATADIR%% +@dirrm %%PYTHON_SITELIBDIR%%/twms |