Skip to content

Commit 563e91b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into add-redis-cache
2 parents 1fffe1b + 447c0c6 commit 563e91b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+17155
-3644
lines changed

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# point to OSGeo sponsor page
2+
github: [OSGeo]
3+
# point to PayPal directly
4+
custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MS7JAL9R268D2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.*.swp
22
nbproject/
33
/build/
4+
/build_vagrant/
5+
/.vagrant/

.travis.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
matrix:
2+
fast_finish: true
3+
include:
4+
- os: linux
5+
dist: xenial
6+
language: c
7+
sudo: required
8+
env:
9+
- DISTRO=xenial
10+
- BUILD_TYPE=maximum
11+
12+
- os: linux
13+
dist: xenial
14+
language: c
15+
sudo: required
16+
env:
17+
- DISTRO=xenial
18+
- BUILD_TYPE=minimum
19+
20+
- os: linux
21+
language: c
22+
sudo: required
23+
env:
24+
- DISTRO=precise
25+
- BUILD_TYPE=maximum
26+
27+
language: c
28+
29+
before_install:
30+
- sudo mv /etc/apt/sources.list.d/pgdg* /tmp
31+
- sudo apt-get purge -y libgdal* libgeos* libspatialite*
32+
- sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
33+
- sudo apt-get update
34+
- sudo apt-get install cmake libspatialite-dev libfcgi-dev libproj-dev libgeos-dev libgdal-dev libtiff-dev libgeotiff-dev apache2-dev libpcre3-dev libsqlite3-dev libdb-dev
35+
# For testing
36+
- sudo apt-get install libxml2-utils apache2 gdal-bin
37+
38+
script:
39+
- mkdir build
40+
- cd build
41+
- if test "$BUILD_TYPE" = "maximum"; then cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TIFF=ON -DWITH_GEOTIFF=ON -DWITH_TIFF_WRITE_SUPPORT=ON -DWITH_PCRE=ON -DWITH_SQLITE=ON -DWITH_BERKELEY_DB=ON; else cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TIFF=OFF -DWITH_GEOTIFF=OFF -DWITH_TIFF_WRITE_SUPPORT=OFF -DWITH_PCRE=OFF -DWITH_SQLITE=OFF -DWITH_BERKELEY_DB=OFF -DWITH_GDAL=OFF -DWITH_GEOS=OFF -DWITH_FCGI=OFF -DWITH_CGI=OFF -DWITH_APACHE=OFF -DWITH_OGR=OFF -DWITH_MAPSERVER=OFF -DWITH_MAPCACHE_DETAIL=OFF; fi
42+
- make -j3
43+
- sudo make install
44+
# Only test with Apache 2.4
45+
- if test "$DISTRO" = "xenial" -a "$BUILD_TYPE" = "maximum"; then cd ../tests; sh ./travis_setup.sh; sh ./run_tests.sh; fi
46+
47+
48+
#notifications:
49+
# email:
50+
# recipients:
51+
52+
# irc:
53+
# channels:
54+
# - "irc.freenode.org#mapserver"
55+
# use_notice: true
56+

CMakeLists.txt

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
cmake_minimum_required (VERSION 2.6)
22

3-
project (MapCache)
3+
project (MapCache C)
44

55
include(CheckFunctionExists)
66
include(CheckIncludeFile)
77
include(CheckCSourceCompiles)
88

9-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
109
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
1110
add_definitions(-DDEBUG)
1211
endif ()
1312

1413

1514
set (MAPCACHE_VERSION_MAJOR 1)
16-
set (MAPCACHE_VERSION_MINOR 3)
15+
set (MAPCACHE_VERSION_MINOR 11)
1716
set (MAPCACHE_VERSION_REVISION 0)
1817

19-
2018
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
2119
set(CMAKE_INSTALL_LIBDIR lib)
2220
endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
@@ -58,22 +56,37 @@ endmacro()
5856

5957
check_function_exists("strncasecmp" HAVE_STRNCASECMP)
6058
check_function_exists("symlink" HAVE_SYMLINK)
61-
59+
check_function_exists ("timegm" HAVE_TIMEGM)
60+
check_function_exists ("strptime" HAVE_STRPTIME)
6261

6362
set(CMAKE_SKIP_BUILD_RPATH FALSE)
63+
if(APPLE)
64+
set(CMAKE_MACOSX_RPATH ON)
65+
endif()
6466
set(CMAKE_LINK_INTERFACE_LIBRARY "")
6567

6668
file(GLOB mapcache_SOURCES lib/*.c )
69+
file(GLOB mapcache_HEADERS include/*.h)
6770

68-
add_library(mapcache SHARED ${mapcache_SOURCES})
71+
add_library(mapcache SHARED ${mapcache_SOURCES} ${mapcache_HEADERS})
6972
set_target_properties(mapcache PROPERTIES
7073
VERSION ${MAPCACHE_VERSION_STRING}
7174
SOVERSION 1
7275
)
7376

77+
# Add compiler flags for warnings
78+
if(CMAKE_COMPILER_IS_GNUCC)
79+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror=declaration-after-statement")
80+
endif()
81+
82+
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
83+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror=declaration-after-statement -std=c89 -Wno-comment")
84+
endif()
85+
7486
#options suported by the cmake builder
7587
option(WITH_PIXMAN "Use pixman for SSE optimized image manipulations" ON)
76-
option(WITH_SQLITE "Use sqlite as a cache backend" ON)
88+
option(WITH_SQLITE "Use sqlite as a cache/dimension backend" ON)
89+
option(WITH_POSTGRESQL "Use PostgreSQL as a dimension backend" OFF)
7790
option(WITH_BERKELEY_DB "Use Berkeley DB as a cache backend" OFF)
7891
option(WITH_MEMCACHE "Use memcache as a cache backend (requires recent apr-util)" OFF)
7992
option(WITH_REDIS "Use redis as a cache backend (requires hiredis library)" OFF)
@@ -82,11 +95,14 @@ option(WITH_TIFF_WRITE_SUPPORT "Enable (experimental) support for writable TIFF
8295
option(WITH_GEOTIFF "Allow GeoTIFF metadata creation for TIFF cache backends" OFF)
8396
option(WITH_PCRE "Use PCRE for regex tests" OFF)
8497
option(WITH_MAPSERVER "Enable (experimental) support for the mapserver library" OFF)
98+
option(WITH_RIAK "Use Riak as a cache backend" OFF)
99+
option(WITH_GDAL "Choose if GDAL raster support should be built in" ON)
100+
option(WITH_MAPCACHE_DETAIL "Build coverage analysis tool for SQLite caches" ON)
85101

86102
find_package(PNG)
87103
if(PNG_FOUND)
88104
include_directories(${PNG_INCLUDE_DIR})
89-
target_link_libraries(mapcache ${PNG_LIBRARY})
105+
target_link_libraries(mapcache ${PNG_LIBRARIES})
90106
else(PNG_FOUND)
91107
report_mandatory_not_found(PNG)
92108
endif(PNG_FOUND)
@@ -162,12 +178,24 @@ if(WITH_PIXMAN)
162178
endif(PIXMAN_FOUND)
163179
endif (WITH_PIXMAN)
164180

181+
if(WITH_GDAL)
182+
find_package(GDAL)
183+
if(GDAL_FOUND)
184+
include_directories(${GDAL_INCLUDE_DIR})
185+
target_link_libraries(mapcache ${GDAL_LIBRARY})
186+
set (USE_GDAL 1)
187+
else(GDAL_FOUND)
188+
report_optional_not_found(GDAL)
189+
endif(GDAL_FOUND)
190+
endif(WITH_GDAL)
191+
165192
if(WITH_PCRE)
166193
find_package(PCRE)
167194
if(PCRE_FOUND)
168195
include_directories(${PCRE_INCLUDE_DIR})
169196
target_link_libraries(mapcache ${PCRE_LIBRARY})
170197
set (USE_PCRE 1)
198+
add_definitions(-DPCRE_STATIC)
171199
else(PCRE_FOUND)
172200
report_optional_not_found(PCRE)
173201
endif(PCRE_FOUND)
@@ -184,6 +212,17 @@ if(WITH_SQLITE)
184212
endif(SQLITE_FOUND)
185213
endif (WITH_SQLITE)
186214

215+
if(WITH_POSTGRESQL)
216+
find_package(PostgreSQL)
217+
if(PostgreSQL_FOUND)
218+
include_directories(${PostgreSQL_INCLUDE_DIR})
219+
target_link_libraries(mapcache ${PostgreSQL_LIBRARY})
220+
set (USE_POSTGRESQL 1)
221+
else(POSTGRESQL_FOUND)
222+
report_optional_not_found(POSTGRESQL)
223+
endif(PostgreSQL_FOUND)
224+
endif (WITH_POSTGRESQL)
225+
187226
if(WITH_BERKELEY_DB)
188227
if(NOT BERKELEYDB_FIND_VERSION)
189228
set(BERKELEYDB_FIND_VERSION "4.6")
@@ -240,6 +279,16 @@ if(WITH_MAPSERVER)
240279
endif(MAPSERVER_FOUND)
241280
endif (WITH_MAPSERVER)
242281

282+
if(WITH_RIAK)
283+
find_package(RIAK)
284+
if(RIAK_FOUND)
285+
include_directories(${RIAK_INCLUDE_DIR})
286+
target_link_libraries(mapcache ${RIAK_LIBRARY})
287+
set (USE_RIAK 1)
288+
else(RIAK_FOUND)
289+
report_optional_not_found(RIAK)
290+
endif(RIAK_FOUND)
291+
endif (WITH_RIAK)
243292

244293
if(UNIX)
245294
target_link_libraries(mapcache ${CMAKE_DL_LIBS} m )
@@ -265,7 +314,7 @@ macro(status_optional_component component enabled libpath)
265314
endif()
266315
endmacro()
267316
macro(status_optional_feature feature enabled)
268-
if("${enabled}" EQUAL "1")
317+
if("${enabled}" EQUAL "1" OR "${enabled}" STREQUAL "ON")
269318
message(STATUS " * ${feature}: ENABLED")
270319
else()
271320
message(STATUS " * ${feature}: disabled")
@@ -281,6 +330,7 @@ message(STATUS " * Apr: ${APR_LIBRARY}")
281330
message(STATUS " * Optional components")
282331
status_optional_component("PIXMAN" "${USE_PIXMAN}" "${PIXMAN_LIBRARY}")
283332
status_optional_component("SQLITE" "${USE_SQLITE}" "${SQLITE_LIBRARY}")
333+
status_optional_component("POSTGRESQL" "${USE_POSTGRESQL}" "${PostgreSQL_LIBRARY}")
284334
status_optional_component("Berkeley DB" "${USE_BDB}" "${BERKELEYDB_LIBRARY}")
285335
status_optional_component("Memcache" "${USE_MEMCACHE}" "${APU_LIBRARY}")
286336
status_optional_component("Redis" "${USE_REDIS}" "${HIREDIS_LIBRARIES} ${HIREDIS_INCLUDE_DIR}")
@@ -289,10 +339,18 @@ status_optional_component("GeoTIFF" "${USE_GEOTIFF}" "${GEOTIFF_LIBRARY}")
289339
status_optional_component("Experimental TIFF write support" "${USE_TIFF_WRITE}" "${TIFF_LIBRARY}")
290340
status_optional_component("PCRE" "${USE_PCRE}" "${PCRE_LIBRARY}")
291341
status_optional_component("Experimental mapserver support" "${USE_MAPSERVER}" "${MAPSERVER_LIBRARY}")
342+
status_optional_component("RIAK" "${USE_RIAK}" "${RIAK_LIBRARY}")
343+
status_optional_component("GDAL" "${USE_GDAL}" "${GDAL_LIBRARY}")
344+
message(STATUS " * Optional features")
345+
status_optional_feature("MAPCACHE_DETAIL" "${WITH_MAPCACHE_DETAIL}")
292346

293347
INSTALL(TARGETS mapcache DESTINATION ${CMAKE_INSTALL_LIBDIR})
294348

295349
add_subdirectory(util)
296350
add_subdirectory(cgi)
297351
add_subdirectory(apache)
298352
add_subdirectory(nginx)
353+
354+
if (WITH_MAPCACHE_DETAIL)
355+
add_subdirectory(contrib/mapcache_detail)
356+
endif (WITH_MAPCACHE_DETAIL)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Author: Thomas Bonfort and the MapServer team.
77
*
88
******************************************************************************
9-
* Copyright (c) 1996-2012 Regents of the University of Minnesota.
9+
* Copyright (c) 1996-2019 Regents of the University of Minnesota.
1010
*
1111
* Permission is hereby granted, free of charge, to any person obtaining a
1212
* copy of this software and associated documentation files (the "Software"),

MIGRATION_GUIDE.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Migrating from Mapcache 1.8 to 1.10
2+
===================================
3+
4+
* No backward compatibility issue is expected.
5+
See [MapCache 1.10 Changelog](https://mapserver.org/development/changelog/mapcache/changelog-1-10.html)
6+
for a list of bug fixes and new features.
7+
8+
Migrating from Mapcache 1.6 to 1.8
9+
===================================
10+
11+
* <dimensions type="time" ...>...<query>SQL</query> should be replaced by
12+
<dimensions type="time" ...>...<validate_query>SQL</validate_query><list_query>...</list_query> or
13+
<dimensions type="sqlite" time="true" ...>...<validate_query>SQL</validate_query><list_query>...</list_query>
14+
(see [RFC-121](http://mapserver.org/development/rfc/ms-rfc-121.html) for full examples)
15+
16+
Migrating from Mapcache 1.4 to 1.6
17+
===================================
18+
19+
* The <timedimension> tileset child has been removed. Time dimensions are now added with <dimension type="time">
20+
21+
* <dimension type="values" ...>val1,val2,val3</dimension> should be replaced by
22+
<dimension type="values"><value>val1</value><value>val2</value><value>val3</value></dimension>
23+
24+
* <dimension type="values" case_sensitive="true">...</dimension> should be replaced by
25+
<dimension type="values"><case_sensitive>true</case_sensitive>....</dimension>
26+
27+
* <dimension type="regex" ...>^abc$</dimension> should be replaced by
28+
<dimension type="regex"><regex>^abc$</regex></dimension>
29+
30+
* <dimension ... assembly="stack">...</dimension> should be replaced by
31+
<dimensions><assembly_type>stack</assembly_type><dimension ...>....</dimension></dimensions>

README

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
MapCache
2+
========
3+
4+
| |Build Status| |Appveyor Build Status|
5+
6+
-------
7+
Summary
8+
-------
9+
10+
MapCache is a server that implements tile caching to speed up access to WMS layers. The primary objectives are to be fast and easily deployable,
11+
while offering the essential features (and more!) expected from a tile caching solution.
12+
13+
For more information and complete documentation please
14+
visit:
15+
16+
http://mapserver.org/mapcache/
17+
18+
Questions relating to MapCache use and development can be asked on the MapServer mailing lists:
19+
20+
http://www.mapserver.org/community/lists.html
21+
22+
License
23+
-------
24+
25+
::
26+
27+
/******************************************************************************
28+
*
29+
* Project: MapServer
30+
* Purpose: MapCache tile caching program.
31+
* Author: Thomas Bonfort and the MapServer team.
32+
*
33+
******************************************************************************
34+
* Copyright (c) 1996-2019 Regents of the University of Minnesota.
35+
*
36+
* Permission is hereby granted, free of charge, to any person obtaining a
37+
* copy of this software and associated documentation files (the "Software"),
38+
* to deal in the Software without restriction, including without limitation
39+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
40+
* and/or sell copies of the Software, and to permit persons to whom the
41+
* Software is furnished to do so, subject to the following conditions:
42+
*
43+
* The above copyright notice and this permission notice shall be included in
44+
* all copies of this Software or works derived from this Software.
45+
*
46+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
47+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
49+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
50+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
51+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
52+
* DEALINGS IN THE SOFTWARE.
53+
*****************************************************************************/
54+
55+
56+
.. |Build Status| image:: https://travis-ci.org/mapserver/mapcache.svg?branch=master
57+
:target: https://travis-ci.org/mapserver/mapcache
58+
59+
.. |Appveyor Build Status| image:: https://ci.appveyor.com/api/projects/status/7al5utxjh83ig71v?svg=true
60+
:target: https://ci.appveyor.com/project/mapserver/mapcache

Vagrantfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
require 'socket'
5+
6+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
7+
VAGRANTFILE_API_VERSION = "2"
8+
9+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
10+
config.vm.box = "precise64"
11+
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
12+
13+
config.vm.hostname = "mapcache-vagrant"
14+
15+
config.vm.network :forwarded_port, guest: 80, host: 8080
16+
17+
config.vm.provider "virtualbox" do |v|
18+
v.customize ["modifyvm", :id, "--memory", 1024, "--cpus", 2]
19+
v.customize ["modifyvm", :id, "--ioapic", "on", "--largepages", "off", "--vtxvpid", "off"]
20+
v.name = "mapcache-vagrant"
21+
end
22+
23+
config.vm.provision "shell", path: "scripts/vagrant/virtualbox-fix.sh"
24+
config.vm.provision "shell", path: "scripts/vagrant/packages.sh"
25+
config.vm.provision "shell", path: "scripts/vagrant/mapcache.sh"
26+
27+
end

0 commit comments

Comments
 (0)