tWMS is a tiny WMS server written in Python and using tiles as a

backend storage

WWW:	http://code.google.com/p/twms/
This commit is contained in:
Dmitry Marakasov 2010-09-08 15:27:32 +00:00
parent 63807bd02b
commit dd1a6fcb2b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=260770
10 changed files with 168 additions and 1 deletions

1
GIDs
View file

@ -78,6 +78,7 @@ sfs:*:171:
agk:*:172:
polipo:*:173:
flowtools:*:174:
twms:*:175:
rt:*:180:
nagios:*:181:
noc:*:182:

1
UIDs
View file

@ -87,6 +87,7 @@ sfs:*:171:171::0:0:Self-Certifying File System:/nonexistent:/usr/sbin/nologin
agk:*:172:172::0:0:AquaGateKeeper:/nonexistent:/nonexistent
polipo:*:173:173::0:0:polipo web cache:/nonexistent:/usr/sbin/nologin
flowtools:*:174:174::0:0:Flow-tools collector pseudo-user:/nonexistent:/usr/sbin/nologin
twms:*:175:175::0:0:tWMS pseudo-user:/nonexistent:/usr/sbin/nologin
nagios:*:181:181::0:0:Nagios pseudo-user:/var/spool/nagios:/usr/sbin/nologin
noc:*:182:182::0:0:NOC pseudo-user:/usr/local/noc:/bin/sh
moinmoin:*:192:192::0:0:MoinMoin User:/nonexistent:/usr/sbin/nologin

View file

@ -1552,8 +1552,8 @@
SUBDIR += rubygem-rack-mount
SUBDIR += rubygem-rack-test
SUBDIR += rubygem-rails
SUBDIR += rubygem-railties
SUBDIR += rubygem-rails-app-installer
SUBDIR += rubygem-railties
SUBDIR += rubygem-ramaze
SUBDIR += rubygem-redcloth
SUBDIR += rubygem-rfacebook
@ -1754,6 +1754,7 @@
SUBDIR += twiki-TwistyPlugin
SUBDIR += twiki-WysiwygPlugin
SUBDIR += twill
SUBDIR += twms
SUBDIR += typo
SUBDIR += typo3
SUBDIR += typolight

61
www/twms/Makefile Normal file
View file

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

3
www/twms/distinfo Normal file
View file

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

View file

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

View file

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

40
www/twms/files/twms.in Normal file
View file

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

4
www/twms/pkg-descr Normal file
View file

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

23
www/twms/pkg-plist Normal file
View file

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