Bug#740351: mapserver: Please enable mapscript java bindings

Ezequiel Lara Gómez ezequiel.lara at qualitasremos.com
Fri Feb 28 13:47:55 UTC 2014

Package: mapserver
Severity: wishlist

*** Please type your report below this line ***
I have succesfully enabled java mapscript bindings for a local backport
of 6.4.1 to squeeze. I attach the patch I used for disabling hardening
and deploying the jar to lib/jni (it modifying for wheezy for multilib);
besides them, I only needed adding DWITH_JAVA=1 and
dh_java -plibmapscript-java overrides to the rules file .


-- System Information:
Debian Release: 6.0.9
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable'), (1,
'stable-updates'), (1, 'experimental'), (1, 'unstable'), (1, 'testing'),
(1, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-0.bpo.4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
-------------- next part --------------
Description: fixes hardened java
 Java doesn't compile with hardened options. Adapted from ruby mapscript
--- a/mapscript/java/CMakeLists.txt
+++ b/mapscript/java/CMakeLists.txt
@@ -15,6 +15,23 @@
 SET(CMAKE_SWIG_FLAGS -package edu.umn.gis.mapscript)
 SWIG_ADD_MODULE(javamapscript java ../mapscript.i)
+# Java mapscript fails to build with -Werror=format-security
+if(${CMAKE_C_FLAGS} MATCHES "-Werror=format-security")
+  string(REPLACE "-Werror=format-security" "" TMP "${CMAKE_C_FLAGS}")
+  set(CMAKE_C_FLAGS "${TMP}")
+endif(${CMAKE_C_FLAGS} MATCHES "-Werror=format-security")
+if(${CMAKE_CXX_FLAGS} MATCHES "-Werror=format-security")
+  string(REPLACE "-Werror=format-security" "" TMP "${CMAKE_CXX_FLAGS}")
+  set(CMAKE_CXX_FLAGS "${TMP}")
+endif(${CMAKE_CXX_FLAGS} MATCHES "-Werror=format-security")
+if(${CMAKE_CPP_FLAGS} MATCHES "-Werror=format-security")
+  string(REPLACE "-Werror=format-security" "" TMP "${CMAKE_CPP_FLAGS}")
+  set(CMAKE_CPP_FLAGS "${TMP}")
+endif(${CMAKE_CPP_FLAGS} MATCHES "-Werror=format-security")
@@ -26,5 +43,5 @@
 get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_javamapscript_REAL_NAME} LOCATION)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mapscript.jar DESTINATION share/java)

More information about the Pkg-grass-devel mailing list