diff --git a/geo/mapcache/Makefile b/geo/mapcache/Makefile new file mode 100644 index 00000000000..5d3e1d40eee --- /dev/null +++ b/geo/mapcache/Makefile @@ -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 + +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 diff --git a/geo/mapcache/distinfo b/geo/mapcache/distinfo new file mode 100644 index 00000000000..734a72f1481 --- /dev/null +++ b/geo/mapcache/distinfo @@ -0,0 +1,2 @@ +SHA256 (mapcache-rel-1-2-1.tar.gz) = McbAdDJPYJ7aaXQ7KIkmw2uyOCbra/CQ8RRqrzG1nCA= +SIZE (mapcache-rel-1-2-1.tar.gz) = 253897 diff --git a/geo/mapcache/patches/patch-util_mapcache_seed_c b/geo/mapcache/patches/patch-util_mapcache_seed_c new file mode 100644 index 00000000000..c33ee58e3d7 --- /dev/null +++ b/geo/mapcache/patches/patch-util_mapcache_seed_c @@ -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 + #include + ++#include + #include + #ifndef _WIN32 + #include diff --git a/geo/mapcache/pkg/DESCR b/geo/mapcache/pkg/DESCR new file mode 100644 index 00000000000..824db9b8563 --- /dev/null +++ b/geo/mapcache/pkg/DESCR @@ -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. diff --git a/geo/mapcache/pkg/PLIST b/geo/mapcache/pkg/PLIST new file mode 100644 index 00000000000..daf1ae1ef6e --- /dev/null +++ b/geo/mapcache/pkg/PLIST @@ -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} diff --git a/geo/mapcache/pkg/README b/geo/mapcache/pkg/README new file mode 100644 index 00000000000..195eab0c3a8 --- /dev/null +++ b/geo/mapcache/pkg/README @@ -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. diff --git a/geo/mapcache/pkg/mapcache.rc b/geo/mapcache/pkg/mapcache.rc new file mode 100644 index 00000000000..c92e65cd60a --- /dev/null +++ b/geo/mapcache/pkg/mapcache.rc @@ -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