This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch master
in repository mapserver.

commit 85e0c99fafbd7ce868ae860a19e67a820572cfdf
Author: Bas Couwenberg <sebas...@xs4all.nl>
Date:   Fri Feb 28 20:38:47 2014 +0100

    Also build mapscript for Java.
---
 debian/changelog                    |  8 ++++++++
 debian/control                      | 16 ++++++++++++++++
 debian/libmapscript-java.install    |  2 ++
 debian/patches/java-hardening.patch | 38 +++++++++++++++++++++++++++++++++++++
 debian/patches/series               |  1 +
 debian/rules                        |  5 ++++-
 6 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index a8b5608..d729f4b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+mapserver (6.4.1-3) UNRELEASED; urgency=low
+
+  * Also build mapscript for Java.
+    Thanks Ezequiel Lara Gómez for the patch.
+    (closes: #740351)
+
+ -- Bas Couwenberg <sebas...@xs4all.nl>  Fri, 28 Feb 2014 20:38:22 +0100
+
 mapserver (6.4.1-2) unstable; urgency=low
 
   * Add gpb.conf to use pristine-tar by default.
diff --git a/debian/control b/debian/control
index f80c256..8be4905 100644
--- a/debian/control
+++ b/debian/control
@@ -29,6 +29,8 @@ Build-Depends: debhelper (>= 9),
                ruby,
                ruby-all-dev,
                gem2deb,
+               default-jdk,
+               ant,
                libfcgi-dev,
                libxml2-dev,
                libxslt1-dev,
@@ -249,3 +251,17 @@ Description: MapServer library for Ruby
  .
  MapServer is a CGI-based framework for Internet map services which
  supports Open Geospatial Consortium (OGC) standards.
+
+Package: libmapscript-java
+Architecture: any
+Section: java
+Depends: ${shlibs:Depends},
+         ${misc:Depends}
+Suggests: mapserver-bin,
+          mapserver-doc
+Description: Java library for MapServer
+ Java MapScript provides MapServer functions for Java applications.
+ .
+ MapServer is a CGI-based framework for Internet map services which
+ supports Open Geospatial Consortium (OGC) standards.
+
diff --git a/debian/libmapscript-java.install b/debian/libmapscript-java.install
new file mode 100644
index 0000000..6e81b2c
--- /dev/null
+++ b/debian/libmapscript-java.install
@@ -0,0 +1,2 @@
+usr/lib/jni/libjavamapscript.so
+usr/share/java/mapscript.jar
diff --git a/debian/patches/java-hardening.patch 
b/debian/patches/java-hardening.patch
new file mode 100644
index 0000000..2ffae30
--- /dev/null
+++ b/debian/patches/java-hardening.patch
@@ -0,0 +1,38 @@
+Description: fixes hardened java
+ Java doesn't compile with hardened options. Adapted from ruby mapscript
+Author: Ezequiel Lara Gómez <ezequiel.l...@qualitasremos.com>
+Bug-Debian: https://bugs.debian.org/740351
+--- a/mapscript/java/CMakeLists.txt
++++ b/mapscript/java/CMakeLists.txt
+@@ -15,6 +15,23 @@ SET (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_
+ 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")
++
+ SWIG_LINK_LIBRARIES(javamapscript ${MAPSERVER_LIBMAPSERVER})
+ 
+ ADD_CUSTOM_COMMAND(TARGET javamapscript
+@@ -26,5 +43,5 @@ ADD_CUSTOM_COMMAND(TARGET javamapscript
+                       )
+ 
+ get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_javamapscript_REAL_NAME} 
LOCATION)
+-install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+-
++install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION lib/jni)
++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mapscript.jar DESTINATION 
share/java)
diff --git a/debian/patches/series b/debian/patches/series
index 2b6db3c..ad99519 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ perl-mapscript-install.patch
 ruby-mapscript-install.patch
 cmake-mapserver-export.patch
 cmake-ruby2.patch
+java-hardening.patch
diff --git a/debian/rules b/debian/rules
index 4a947d5..54c06a4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -83,7 +83,7 @@ override_dh_auto_configure:
                             -DWITH_PHP=1 \
                             -DWITH_PERL=1 \
                             -DWITH_RUBY=0 \
-                            -DWITH_JAVA=0 \
+                            -DWITH_JAVA=1 \
                             -DWITH_CSHARP=0
 
        for RUBY in $(RUBYVERSIONS); do \
@@ -168,3 +168,6 @@ override_dh_python2:
 override_dh_perl:
        dh_perl -plibmapscript-perl
 
+override_dh_java:
+       dh_java -plibmapscript-java
+

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-grass/mapserver.git

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to