Import mapcache 1.2.1.

MapCache is a WMTS/TMS server that implements tile caching to speed up
access to WMS layers. The primary objectives are to be fast and easily
deployable, while offering the essential features (and more!) expected
from a tile caching solution.

ok ajacoutot@ sthen@
This commit is contained in:
landry 2014-08-26 18:38:49 +00:00
parent 32420fa9ae
commit b2f90af0a3
7 changed files with 139 additions and 0 deletions

44
geo/mapcache/Makefile Normal file
View File

@ -0,0 +1,44 @@
# $OpenBSD: Makefile,v 1.1.1.1 2014/08/26 18:38:49 landry Exp $
SHARED_ONLY= Yes
COMMENT= GIS WMTS/TMS tile caching server
GH_TAGNAME = rel-1-2-1
GH_ACCOUNT = mapserver
GH_COMMIT = 70d3c3c7140c7e97953fabd3df670de82db1c8cb
GH_PROJECT = mapcache
DISTNAME = ${GH_PROJECT}-${GH_TAGNAME}
PKGNAME = ${GH_PROJECT}-1.2.1
SHARED_LIBS += mapcache 0.0
CATEGORIES= geo www
HOMEPAGE= http://www.mapserver.org/
# MIT
PERMIT_PACKAGE_CDROM= Yes
MAINTAINER= Landry Breuil <landry@openbsd.org>
MODULES= devel/cmake
RUN_DEPENDS = www/spawn-fcgi
NO_TEST = Yes
LIB_DEPENDS= devel/apr-util \
geo/gdal \
geo/geos \
www/fcgi
WANTLIB += apr-1 aprutil-1 c curl fcgi gdal geos_c jpeg m pixman-1
WANTLIB += png pthread sqlite3
CONFIGURE_ARGS += -DWITH_APACHE:Bool=Off
post-install:
${INSTALL_DATA_DIR} ${WRKINST}/${VARBASE}/www/cgi-bin
${INSTALL_DATA_DIR} ${WRKINST}/${VARBASE}/www/conf
${INSTALL_PROGRAM} ${PREFIX}/bin/mapcache.fcgi ${WRKINST}/${VARBASE}/www/cgi-bin/mapcache
${INSTALL_DATA} ${WRKSRC}/mapcache.xml ${WRKINST}/${VARBASE}/www/conf/mapcache.xml
.include <bsd.port.mk>

2
geo/mapcache/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (mapcache-rel-1-2-1.tar.gz) = McbAdDJPYJ7aaXQ7KIkmw2uyOCbra/CQ8RRqrzG1nCA=
SIZE (mapcache-rel-1-2-1.tar.gz) = 253897

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-util_mapcache_seed_c,v 1.1.1.1 2014/08/26 18:38:49 landry Exp $
/usr/obj/ports/mapcache-1.2.1/mapcache-rel-1-2-1/util/mapcache_seed.c:1182: error: 'S_IRUSR' undeclared (first use in this function)
/usr/obj/ports/mapcache-1.2.1/mapcache-rel-1-2-1/util/mapcache_seed.c:1182: error: (Each undeclared identifier is reported only once
/usr/obj/ports/mapcache-1.2.1/mapcache-rel-1-2-1/util/mapcache_seed.c:1182: error: for each function it appears in.)
/usr/obj/ports/mapcache-1.2.1/mapcache-rel-1-2-1/util/mapcache_seed.c:1182: error: 'S_IWUSR' undeclared (first use in this function)
--- util/mapcache_seed.c.orig Mon May 19 22:30:46 2014
+++ util/mapcache_seed.c Mon May 19 22:31:00 2014
@@ -34,6 +34,7 @@
#include <apr_getopt.h>
#include <signal.h>
+#include <sys/stat.h>
#include <time.h>
#ifndef _WIN32
#include <unistd.h>

4
geo/mapcache/pkg/DESCR Normal file
View File

@ -0,0 +1,4 @@
MapCache is a WMTS/TMS server that implements tile caching to speed up
access to WMS layers. The primary objectives are to be fast and easily
deployable, while offering the essential features (and more!) expected
from a tile caching solution.

11
geo/mapcache/pkg/PLIST Normal file
View File

@ -0,0 +1,11 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2014/08/26 18:38:49 landry Exp $
@cwd /var/www/
@bin cgi-bin/mapcache
conf/mapcache.xml
@cwd ${LOCALBASE}
@bin bin/mapcache.fcgi
@bin bin/mapcache_seed
@lib lib/libmapcache.so.${LIBmapcache_VERSION}
@rcscript ${RCDIR}/mapcache
@cwd ${LOCALBASE}/share/doc/pkg-readmes
${FULLPKGNAME}

43
geo/mapcache/pkg/README Normal file
View File

@ -0,0 +1,43 @@
# $OpenBSD: README,v 1.1.1.1 2014/08/26 18:38:49 landry Exp $
+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------
If you plan to use mapcache CGI with a chrooted web server, make sure to
copy the libs needed by mapcache binary from ${LOCALBASE}/lib. If you
copy them keeping the same directory hierarchy (with lib, local/lib and
X11R6/lib, you need to make sure there's a ld.so.hints file inside the
chroot pointing to those dirs. You can do all this with:
# mkdir -p /var/www/usr/{libexec,{,local,X11R6}/lib}
# ldd /var/www/cgi-bin/mapcache | awk '/lib/ { print $7 }' | while read f ; do cp $f /var/www/$f ; done
# cp /sbin/ldconfig /var/www \
&& mkdir -p /var/www/var/run \
&& chroot /var/www ./ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib \
&& rm /var/www/ldconfig
You also need to ensure mapcache can write to its cache directory, /tmp
in the chroot by default:
# install -d -o www /var/www/tmp
If you would like to use FastCGI with nginx from base, use the provided rc.d(8)
script and add the following lines to your nginx.conf:
location /cgi-bin/mapcache {
fastcgi_pass unix:run/mapcache.sock;
fastcgi_split_path_info ^(/cgi-bin/mapcache)(.*)$;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
You also need to set the path to the mapcache configuration file via a
login.conf class:
mapcache:\
:setenv=MAPCACHE_CONFIG_FILE=conf/mapcache.xml:\
:tc=daemon:
and then visit http://localhost/cgi-bin/mapcache/demo.

View File

@ -0,0 +1,19 @@
#!/bin/sh
#
# $OpenBSD: mapcache.rc,v 1.1.1.1 2014/08/26 18:38:49 landry Exp $
daemon="${LOCALBASE}/bin/spawn-fcgi"
# chroot version
daemon_flags="-c /var/www -s run/mapcache.sock -u www -- /cgi-bin/mapcache"
# non-chroot version
# daemon_flags="-s /var/www/run/mapcache.sock -u www -- /var/www/cgi-bin/mapcache"
daemon_class=mapcache
. /etc/rc.d/rc.subr
# chroot version
pexp="/cgi-bin/mapcache"
# non-chroot version
# pexp="/var/www/cgi-bin/mapcache"
rc_cmd $1