Update to 7.4.3

This commit is contained in:
Sandro Mani 2020-03-04 16:12:19 +01:00
parent 3f2267cd2c
commit de0ccf77b9
4 changed files with 242 additions and 46 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@
/mapserver-208bb3a10fccdc9c1bdab175915072270abb1b45.tar.gz
/mapserver-d5c22cd3113ba85f5b1f1c406fe4055f75d04ce3.tar.gz
/mapserver-7fe9b2b9f74796731cba2f7f09c8f41875f020e4.tar.gz
/mapserver-7.4.3.tar.gz

204
mapserver-swig-4.0.1.patch Normal file
View File

@ -0,0 +1,204 @@
diff -rupN --no-dereference mapserver-rel-7-4-3/mapscript/csharp/swig_csharp_extensions.i mapserver-rel-7-4-3-new/mapscript/csharp/swig_csharp_extensions.i
--- mapserver-rel-7-4-3/mapscript/csharp/swig_csharp_extensions.i 2019-12-16 18:59:03.000000000 +0100
+++ mapserver-rel-7-4-3-new/mapscript/csharp/swig_csharp_extensions.i 2020-03-03 18:55:31.278654827 +0100
@@ -224,17 +224,20 @@
}
%}
+#if SWIG_VERSION < 0x040000
%typemap(csfinalize) SWIGTYPE %{
/* %typemap(csfinalize) SWIGTYPE */
~$csclassname() {
Dispose();
}
%}
+#endif
%typemap(csconstruct, excode=SWIGEXCODE) SWIGTYPE %{: this($imcall, true, null) {$excode
}
%}
+#if SWIG_VERSION < 0x040000
%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") SWIGTYPE {
lock(this) {
if(swigCPtr.Handle != System.IntPtr.Zero && swigCMemOwn) {
@@ -246,6 +249,7 @@
System.GC.SuppressFinalize(this);
}
}
+#endif
%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE {
lock(this) {
diff -rupN --no-dereference mapserver-rel-7-4-3/mapscript/python/pyextend.i mapserver-rel-7-4-3-new/mapscript/python/pyextend.i
--- mapserver-rel-7-4-3/mapscript/python/pyextend.i 2019-12-16 18:59:03.000000000 +0100
+++ mapserver-rel-7-4-3-new/mapscript/python/pyextend.i 2020-03-03 18:55:31.277654829 +0100
@@ -13,6 +13,7 @@
*
*****************************************************************************/
+
/* fromstring: Factory for mapfile objects */
%pythoncode %{
@@ -222,15 +223,13 @@ def fromstring(data, mappath=None):
}
}
- def getItemDefinitions(self):
- return self._item_definitions
+ @property
+ def itemdefinitions(self):
+ return self._item_definitions
- def setItemDefinitions(self, item_definitions):
+ @itemdefinitions.setter
+ def itemdefinitions(self, item_definitions):
self._item_definitions = item_definitions
-
- __swig_getmethods__["itemdefinitions"] = getItemDefinitions
- __swig_setmethods__["itemdefinitions"] = setItemDefinitions
-
%}
}
@@ -426,25 +425,14 @@ def fromstring(data, mappath=None):
memcpy( *argout, self->pattern, sizeof(double) * *pnListSize);
}
- void patternlength_set2(int patternlength)
- {
- msSetError(MS_MISCERR, "pattern is read-only", "patternlength_set()");
- }
%pythoncode %{
- __swig_setmethods__["patternlength"] = _mapscript.styleObj_patternlength_set2
- __swig_getmethods__["patternlength"] = _mapscript.styleObj_patternlength_get
- if _newclass:patternlength = _swig_property(_mapscript.styleObj_patternlength_get, _mapscript.styleObj_patternlength_set2)
-
- __swig_setmethods__["pattern"] = _mapscript.styleObj_pattern_set
- __swig_getmethods__["pattern"] = _mapscript.styleObj_pattern_get
- if _newclass:pattern = _swig_property(_mapscript.styleObj_pattern_get, _mapscript.styleObj_pattern_set)
-%}
+pattern = property(pattern_get, pattern_set)
+%}
}
-
/******************************************************************************
* Extensions to hashTableObj - add dict methods
*****************************************************************************/
diff -rupN --no-dereference mapserver-rel-7-4-3/mapscript/python/pymodule.i mapserver-rel-7-4-3-new/mapscript/python/pymodule.i
--- mapserver-rel-7-4-3/mapscript/python/pymodule.i 2019-12-16 18:59:03.000000000 +0100
+++ mapserver-rel-7-4-3-new/mapscript/python/pymodule.i 2020-03-03 18:55:31.277654829 +0100
@@ -17,7 +17,7 @@
*****************************************************************************/
/* Translates Python None to C NULL for strings */
-%typemap(in,parse="z") char * "";
+//%typemap(in,parse="z") char * "";
/* To support imageObj::getBytes */
%typemap(out) gdBuffer {
@@ -210,33 +210,15 @@ MapServerError = _mapscript.MapServerErr
MapServerChildError = _mapscript.MapServerChildError
%}
-/* The bogus "if 1:" is to introduce a new scope to work around indentation
- handling with pythonappend in different versions. (#3180) */
-%feature("pythonappend") layerObj %{if 1:
- self.p_map=None
- try:
- # python 2.5
- if args and len(args)!=0:
- self.p_map=args[0]
- except NameError:
- # python 2.6
- if map:
- self.p_map=map
- %}
-
-/* The bogus "if 1:" is to introduce a new scope to work around indentation
- handling with pythonappend in different versions. (#3180) */
-%feature("pythonappend") classObj %{if 1:
- self.p_layer =None
- try:
- # python 2.5
- if args and len(args)!=0:
- self.p_layer=args[0]
- except NameError:
- # python 2.6
- if layer:
- self.p_layer=layer
- %}
+%feature("pythonappend") layerObj %{
+ self.p_map = None
+ if map:
+ self.p_map = map%}
+
+%feature("pythonappend") classObj %{
+ self.p_layer = None
+ if layer:
+ self.p_layer = layer%}
%feature("shadow") insertClass %{
def insertClass(*args):
diff -rupN --no-dereference mapserver-rel-7-4-3/mapscript/python/tests/cases/style_test.py mapserver-rel-7-4-3-new/mapscript/python/tests/cases/style_test.py
--- mapserver-rel-7-4-3/mapscript/python/tests/cases/style_test.py 2019-12-16 18:59:03.000000000 +0100
+++ mapserver-rel-7-4-3-new/mapscript/python/tests/cases/style_test.py 2020-03-03 18:55:31.278654827 +0100
@@ -175,6 +175,53 @@ class NewStylesTestCase(MapTestCase):
self.assertRaises(mapscript.MapServerChildError,
class0.insertStyle, None)
+ def testPattern(self):
+ """See https://github.com/mapserver/mapserver/issues/4943"""
+
+ si = mapscript.styleObj()
+ assert si.pattern == ()
+ assert si.patternlength == 0
+
+ def testPattern2(self):
+
+ si = mapscript.styleObj()
+ si.pattern = [2.0, 3, 4]
+ assert si.pattern == (2.0, 3.0, 4.0)
+ assert si.patternlength == 3
+
+ def testPattern3(self):
+ """a pattern must have at least 2 elements"""
+
+ si = mapscript.styleObj()
+ exception = None
+ try:
+ si.pattern = [1.0]
+ except Exception:
+ exception = True
+ assert exception is True
+
+ def testPattern4(self):
+ """a pattern can have a max of 10 elements
+ This is set in mapsymbol.h with #define MS_MAXPATTERNLENGTH 10"""
+
+ si = mapscript.styleObj()
+ exception = None
+ try:
+ si.pattern = [i for i in range(11)]
+ except Exception:
+ exception = True
+ assert exception is True
+
+ def testPattern5(self):
+ """pattern length is read-only"""
+ si = mapscript.styleObj()
+ exception = None
+ try:
+ si.patternlength = 0
+ except Exception:
+ exception = True
+ assert exception is True
+
class BrushCachingTestCase(MapTestCase):

View File

@ -3,23 +3,25 @@
%global project_name mapserver
# MapServer doesn't support PHP 7 yet. See:
# https://github.com/mapserver/mapserver/issues/5252
%global php_mapscript 0
%global php_mapscript 1
# MapServer should support Python 3 but still builds with Python 2.
# This should be investigated.
%global python_mapscript 0
%global python_mapscript 1
%global commit 7fe9b2b9f74796731cba2f7f09c8f41875f020e4
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: mapserver
Version: 7.2.2
Release: 5.git%{shortcommit}%{?dist}
Version: 7.4.3
Release: 1%{?dist}
Summary: Environment for building spatially-enabled internet applications
%global dashver %(echo %version | sed 's|\\.|-|g')
License: BSD
URL: http://www.mapserver.org
Source0: https://github.com/%{project_owner}/%{project_name}/archive/%{commit}/%{project_name}-%{commit}.tar.gz
Source0: https://github.com/%{project_owner}/%{project_name}/archive/rel-%{dashver}/%{project_name}-%{version}.tar.gz
# Fix build with swig-4.0.1
# https://github.com/mapserver/mapserver/pull/5983
Patch0: mapserver-swig-4.0.1.patch
Requires: httpd
Requires: dejavu-sans-fonts
@ -56,6 +58,9 @@ BuildRequires: proj-devel => 5.2.0
BuildRequires: readline-devel
BuildRequires: swig
BuildRequires: zlib-devel
# See %%prep below
BuildRequires: /usr/share/fonts/dejavu-sans-fonts/DejaVuSans.ttf
BuildRequires: /usr/share/fonts/dejavu-sans-fonts/DejaVuSans-Bold.ttf
%description
@ -90,7 +95,7 @@ Requires: php(api) = %{php_core_api}
%description -n php-%{name}
The PHP/Mapscript extension provides full map customization capabilities within
the PHP scripting language.
%endif # end php_mapscript
%endif
%package perl
@ -117,7 +122,7 @@ Requires: python3
%description -n python3-mapserver
The Python/Mapscript extension provides full map customization capabilities
within the Python programming language.
%endif # end python_mapscript
%endif
%package java
Summary: Java/Mapscript map making extensions to Java
@ -141,15 +146,11 @@ the ruby programming language.
%prep
%setup -q -n %{project_owner}-%{commit}
%autosetup -p1 -n %{project_owner}-rel-%{dashver}
# replace fonts for tests with symlinks
rm -rf tests/vera/Vera.ttf
rm -rf tests/vera/VeraBd.ttf
pushd tests/vera/
ln -sf /usr/share/fonts/dejavu/DejaVuSans.ttf Vera.ttf
ln -sf /usr/share/fonts/dejavu/DejaVuSans-Bold.ttf VeraBd.ttf
popd
ln -sf /usr/share/fonts/dejavu-sans-fonts/DejaVuSans.ttf tests/vera/Vera.ttf
ln -sf /usr/share/fonts/dejavu-sans-fonts/DejaVuSans-Bold.ttf tests/vera/VeraBd.ttf
# Force swig to regenerate the wrapper
rm -rf mapscript/perl/mapscript_wrap.c
@ -163,15 +164,9 @@ cd build
export CFLAGS="${CFLAGS} -ldl -fPIC -fno-strict-aliasing"
export CXXFLAGS="%{optflags} -fno-strict-aliasing"
cmake -DINSTALL_LIB_DIR=%{_libdir} \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
%cmake -DINSTALL_LIB_DIR=%{_libdir} \
-DCMAKE_SKIP_RPATH=ON \
-DCMAKE_CXX_FLAGS_RELEASE="%{optflags} -fno-strict-aliasing" \
-DCMAKE_C_FLAGS_RELEASE="%{optflags} -fno-strict-aliasing" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
-DCMAKE_SKIP_RPATH=ON \
-DWITH_CAIRO=TRUE \
-DWITH_CLIENT_WFS=TRUE \
-DWITH_CLIENT_WMS=TRUE \
@ -192,12 +187,12 @@ cmake -DINSTALL_LIB_DIR=%{_libdir} \
-DCUSTOM_PERL_SITE_ARCH_DIR="%{perl_vendorarch}" \
%if 0%{php_mapscript}
-DWITH_PHP=TRUE \
%endif # end php_mapscript
%endif
-DWITH_POSTGIS=TRUE \
-DWITH_PROJ=TRUE \
%if 0%{python_mapscript}
-DWITH_PYTHON=TRUE \
%endif # end python_mapscript
%endif
-DWITH_RUBY=TRUE \
-DWITH_V8=FALSE \
-DWITH_SOS=TRUE \
@ -219,20 +214,13 @@ cmake -DINSTALL_LIB_DIR=%{_libdir} \
-Wno-dev \
..
make %{?_smp_mflags}
%make_build
%install
mkdir -p %{buildroot}%{_libexecdir}
%if 0%{php_mapscript}
mkdir -p %{buildroot}%{php_inidir}
mkdir -p %{buildroot}%{php_extdir}
%endif # end php_mapscript
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_includedir}/%{name}/
%make_install -C build
mkdir -p %{buildroot}%{_datadir}/%{name}
install -p -m 644 xmlmapfile/mapfile.xsd %{buildroot}%{_datadir}/%{name}
install -p -m 644 xmlmapfile/mapfile.xsl %{buildroot}%{_datadir}/%{name}
@ -240,12 +228,6 @@ install -p -m 644 xmlmapfile/mapfile.xsl %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_javadir}
install -p -m 644 build/mapscript/java/mapscript.jar %{buildroot}%{_javadir}/
# install header
install -p -m 644 *.h %{buildroot}%{_includedir}/%{name}/
cd build
make DESTDIR=%{buildroot} install %{?_smp_mflags}
%if 0%{php_mapscript}
# install php config file
mkdir -p %{buildroot}%{php_inidir}
@ -253,7 +235,13 @@ cat > %{buildroot}%{php_inidir}/%{ini_name} <<EOF
; Enable %{name} extension module
extension=php_mapscript.so
EOF
%endif # end php_mapscript
%endif
# Move python bindings to sitearch
if [ "%{python3_sitelib}" != "%{python3_sitearch}" ]; then
mkdir -p %{buildroot}%{python3_sitearch}
mv %{buildroot}%{python3_sitelib}/* %{buildroot}%{python3_sitearch}
fi
%ldconfig_scriptlets libs
@ -289,7 +277,7 @@ EOF
%doc mapscript/php/examples
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/php_mapscript.so*
%endif # end php_mapscript
%endif
%files perl
%doc README.rst
@ -300,11 +288,11 @@ EOF
%if 0%{python_mapscript}
%files -n python3-mapserver
%doc mapscript/python/README
%doc mapscript/python/README.rst
%doc mapscript/python/examples
%doc mapscript/python/tests
%{python3_sitearch}/*mapscript*
%endif # end python_mapscript
%endif
%files java
%doc mapscript/java/README
@ -320,6 +308,9 @@ EOF
%changelog
* Wed Mar 04 2020 Sandro Mani <manisandro@gmail.com> - 7.4.3-1
- Update to 7.4.3
* Tue Mar 03 2020 Sandro Mani <manisandro@gmail.com> - 7.2.2-5.git7fe9b2b
- Rebuild (gdal)

View File

@ -1 +1 @@
SHA512 (mapserver-7fe9b2b9f74796731cba2f7f09c8f41875f020e4.tar.gz) = 119363d5ed5135c8363fcf305b702531350853cd3063f0cb946bbaddb0080c257594cf331e84ce7c24c8bfa04ff1d2308f07cea50ec185d35151a1cbd63330f4
SHA512 (mapserver-7.4.3.tar.gz) = 5943f976b8116f6c580e7c7e1ffea4bcc257d216d5105815167c7fb72542a45b7fa50ffe44c95b40eaf36647733a32ae92102c8688b6bef6dcd7a5a669bae498