[Pkg-phototools-commits] [SCM] openjpeg packaging branch, master, updated. 1.3+dfsg-4-59-g8ed7612

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Apr 19 11:08:56 UTC 2012


The following commit has been merged in the master branch:
commit 8ed761201c87c60bf6ca02c98b8a06027ef828a5
Author: Mathieu Malaterre <mathieu.malaterre at gmail.com>
Date:   Thu Apr 19 13:05:47 2012 +0200

    Start working on next upload, adding java binding

diff --git a/debian/changelog b/debian/changelog
index 7c1fb3b..dafb7b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+openjpeg (1.5.0-2) UNRELEASED; urgency=low
+
+  * Adding libopenjpeg-java. Closes: #510443
+
+ -- Mathieu Malaterre <malat at debian.org>  Thu, 19 Apr 2012 13:05:06 +0200
+
 openjpeg (1.5.0-1) experimental; urgency=low
 
   [ Robin Cornelius ]
diff --git a/debian/control b/debian/control
index 99adc6d..4b77dff 100644
--- a/debian/control
+++ b/debian/control
@@ -45,6 +45,14 @@ Depends:
 Description: JPEG 2000 image compression/decompression library
  OpenJPEG is a library for handling the JPEG 2000 image compression format.
 
+Package: libopenjpeg-java
+Section: java
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${java:Depends}
+Description: java bindings for libopenjpeg, a JPEG 2000 image library
+ This package contains the java binding to match the runtime component of the
+ OpenJPEG library, allowing java program to use OpenJPEG.
+
 Package: libopenjpeg5-dbg
 Section: debug
 Architecture: any
diff --git a/debian/libopenjpeg-java.install b/debian/libopenjpeg-java.install
new file mode 100644
index 0000000..39f47f9
--- /dev/null
+++ b/debian/libopenjpeg-java.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/*/libopenjpegjni.so
diff --git a/debian/libopenjpeg-java.jlibs b/debian/libopenjpeg-java.jlibs
new file mode 100644
index 0000000..73f75db
--- /dev/null
+++ b/debian/libopenjpeg-java.jlibs
@@ -0,0 +1 @@
+debian/tmp/usr/lib/*/openjpeg.jar
diff --git a/debian/patches/installjava.patch b/debian/patches/installjava.patch
new file mode 100644
index 0000000..688238a
--- /dev/null
+++ b/debian/patches/installjava.patch
@@ -0,0 +1,41 @@
+Index: openjpeg-1.5.0/applications/JavaOpenJPEG/CMakeLists.txt
+===================================================================
+--- openjpeg-1.5.0.orig/applications/JavaOpenJPEG/CMakeLists.txt	2012-04-19 12:54:35.481899188 +0200
++++ openjpeg-1.5.0/applications/JavaOpenJPEG/CMakeLists.txt	2012-04-19 12:57:20.257452866 +0200
+@@ -4,6 +4,9 @@
+ SET(openjpegjni_SRCS
+   JavaOpenJPEGDecoder.c
+   JavaOpenJPEG.c
++  ../codec/index.c
++  ../codec/convert.c
++${OPENJPEG_SOURCE_DIR}/applications/common/opj_getopt.c
+   )
+ 
+ # JNI binding:
+@@ -20,6 +23,18 @@
+ add_library(openjpegjni MODULE
+   ${openjpegjni_SRCS}
+   )
++TARGET_LINK_LIBRARIES(openjpegjni ${OPENJPEG_LIBRARY_NAME})
++
++IF(WIN32)
++  SET(OPENJPEG_INSTALL_JNI_DIR ${OPENJPEG_INSTALL_BIN_DIR})
++ELSE()
++  SET(OPENJPEG_INSTALL_JNI_DIR ${OPENJPEG_INSTALL_LIB_DIR})
++ENDIF()
++
++INSTALL(TARGETS openjpegjni
++  EXPORT OpenJPEGTargets
++  LIBRARY DESTINATION ${OPENJPEG_INSTALL_JNI_DIR} COMPONENT Libraries
++)
+ 
+ # build jar:
+ FIND_PACKAGE(Java 1.5 REQUIRED) # javac, jar
+@@ -45,3 +60,7 @@
+   DEPENDS ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
+   COMMENT "building openjpeg.jar"
+ )
++
++INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/openjpeg.jar
++  DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT JavaModule
++)
diff --git a/debian/patches/relativeincludepath.patch b/debian/patches/relativeincludepath.patch
new file mode 100644
index 0000000..bee04db
--- /dev/null
+++ b/debian/patches/relativeincludepath.patch
@@ -0,0 +1,60 @@
+Index: openjpeg-1.5.0/CMake/OpenJPEGConfig.cmake.in
+===================================================================
+--- openjpeg-1.5.0.orig/CMake/OpenJPEGConfig.cmake.in	2012-04-19 12:38:27.933915198 +0200
++++ openjpeg-1.5.0/CMake/OpenJPEGConfig.cmake.in	2012-04-19 12:39:13.641453115 +0200
+@@ -11,22 +11,28 @@
+ SET(OPENJPEG_BUILD_VERSION "@OPENJPEG_VERSION_BUILD@")
+ 
+ # The libraries.
+-SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARIES@")
++SET(OPENJPEG_LIBRARIES "@OPENJPEG_LIBRARY_NAME@")
+ 
+ # The CMake macros dir.
+-SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_CMAKE_DIR_CONFIG@")
++SET(OPENJPEG_CMAKE_DIR "@OPENJPEG_INSTALL_PACKAGE_DIR@")
+ 
+ # The configuration options.
+-SET(OPENJPEG_BUILD_SHARED_LIBS "@OPENJPEG_BUILD_SHARED_LIBS@")
++SET(OPENJPEG_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
+ 
+ # The "use" file.
+ SET(OPENJPEG_USE_FILE "@OPENJPEG_USE_FILE_CONFIG@")
+ 
+ get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
++# The following is inspired from:
++# http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Packaging_and_Exporting
++# However the following is difficult to handle:
++# get_filename_component(myproj_INCLUDE_DIRS "${SELF_DIR}/../../include/myproj" ABSOLUTE)
++# it asssumes a non multi-arch system, where 'include' is located '../include' from lib
++# therefore we need to take into account the number of subdirs in OPENJPEG_INSTALL_LIB_DIR
+ if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
+   # This is an install tree
+   include(${SELF_DIR}/OpenJPEGTargets.cmake)
+-  get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/../../@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE)
++  get_filename_component(OPENJPEG_INCLUDE_ROOT "${SELF_DIR}/@relative_parent@/@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE)
+   set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_ROOT})
+ 
+ else(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake)
+Index: openjpeg-1.5.0/CMakeLists.txt
+===================================================================
+--- openjpeg-1.5.0.orig/CMakeLists.txt	2012-04-19 12:39:27.165942506 +0200
++++ openjpeg-1.5.0/CMakeLists.txt	2012-04-19 12:39:41.069394025 +0200
+@@ -103,6 +103,18 @@
+   SET(OPENJPEG_INSTALL_LIB_DIR "lib")
+ ENDIF(NOT OPENJPEG_INSTALL_LIB_DIR)
+ 
++# The following will compute the amount of parent dir to go
++# from include to lib. it works nicely with 
++# OPENJPEG_INSTALL_LIB_DIR=lib
++# OPENJPEG_INSTALL_LIB_DIR=lib/
++# OPENJPEG_INSTALL_LIB_DIR=/lib
++# OPENJPEG_INSTALL_LIB_DIR=lib/gnu-linux-x64
++STRING(REPLACE "/" ";" relative_to_lib ${OPENJPEG_INSTALL_LIB_DIR})
++set(relative_parent "..")
++foreach( elem ${relative_to_lib})
++  set( relative_parent "${relative_parent}/.." )
++endforeach()
++
+ IF(NOT OPENJPEG_INSTALL_SHARE_DIR)
+   SET(OPENJPEG_INSTALL_SHARE_DIR "share")
+ ENDIF(NOT OPENJPEG_INSTALL_SHARE_DIR)
diff --git a/debian/patches/series b/debian/patches/series
index a378958..397640a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
 addmathlib.patch
 fixsoname.patch
+installjava.patch
+relativeincludepath.patch
diff --git a/debian/rules b/debian/rules
index 6a9ea8e..605c3c6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,9 +6,10 @@
 
 CURVER := $(shell dpkg-parsechangelog | grep ^Version | awk '{print $$2}' | cut -d- -f1 | cut -d+ -f1)
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+JAVA_HOME=/usr/lib/jvm/default-java
 
 %:
-	dh $@ --buildsystem=cmake --parallel
+	dh $@ --buildsystem=cmake --parallel --with javahelper
 
 CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_RPATH=ON \
 	-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
@@ -17,6 +18,7 @@ CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_RPATH=ON \
 	-DBUILD_JPIP:BOOL=ON \
 	-DBUILD_JPIP_SERVER:BOOL=OFF \
 	-DBUILD_JPWL:BOOL=ON \
+	-DBUILD_JAVA:BOOL=ON \
 	-DBUILD_MJ2:BOOL=ON \
 	-DBUILD_SHARED_LIBS:BOOL=ON \
 	-DBUILD_TESTING:BOOL=OFF \

-- 
openjpeg packaging



More information about the Pkg-phototools-commits mailing list