[Git][java-team/zstd-jni-java][master] Initial commit

Olek Wojnar (@olek) gitlab at salsa.debian.org
Tue Nov 8 20:31:37 GMT 2022



Olek Wojnar pushed to branch master at Debian Java Maintainers / zstd-jni-java


Commits:
76118f5e by Olek Wojnar at 2022-11-08T15:29:25-05:00
Initial commit

- - - - -


24 changed files:

- + debian/README.source
- + debian/changelog
- + debian/control
- + debian/copyright
- + debian/docs
- + debian/libzstd-jni-java.lintian-overrides
- + debian/libzstd-jni-java.poms
- + debian/libzstd-jni1.lintian-overrides
- + debian/libzstd-jni1.symbols
- + debian/maven.properties
- + debian/patches/fix_cmake.patch
- + debian/patches/import_pom.patch
- + debian/patches/modify_pom.patch
- + debian/patches/properly_version_so.patch
- + debian/patches/series
- + debian/rules
- + debian/salsa-ci.yml
- + debian/source/format
- + debian/source/lintian-overrides
- + debian/tests/ZstdTest
- + debian/tests/ZstdTest.java
- + debian/tests/control
- + debian/upstream/metadata
- + debian/watch


Changes:

=====================================
debian/README.source
=====================================
@@ -0,0 +1,5 @@
+This package is one of the dependencies for the Bazel Build System.[1] Due to the tight interdependencies between a number of the Google ecosystem Java packages that Bazel depends on, please coordinate on the Debian Java Team mailing list [2] and the Debian Bazel Team mailing list [3] before team-uploading this package. This coordination will avoid unanticipated breakages and the Bazel Team greatly appreciates your assistance.
+
+[1] https://salsa.debian.org/bazel-team/meta/-/wikis/Bazel-Dependencies
+[2] debian-java at lists.debian.org
+[3] bazel-team at lists.launchpad.net


=====================================
debian/changelog
=====================================
@@ -0,0 +1,5 @@
+zstd-jni-java (1.5.2-5+ds-1) unstable; urgency=medium
+
+  * Initial release (Closes: #1021949)
+
+ -- Olek Wojnar <olek at debian.org>  Thu, 20 Oct 2022 14:30:09 -0400


=====================================
debian/control
=====================================
@@ -0,0 +1,45 @@
+Source: zstd-jni-java
+Section: java
+Priority: optional
+Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
+Uploaders: Olek Wojnar <olek at debian.org>,
+Build-Depends: debhelper-compat (= 13),
+               cmake,
+               default-jdk,
+               javahelper,
+               libzstd-dev,
+               maven-debian-helper,
+               maven-repo-helper,
+               pkg-config,
+Standards-Version: 4.6.1
+Rules-Requires-Root: no
+Homepage: https://github.com/luben/zstd-jni
+Vcs-Browser: https://salsa.debian.org/java-team/zstd-jni-java
+Vcs-Git: https://salsa.debian.org/java-team/zstd-jni-java.git
+
+Package: libzstd-jni-java
+Architecture: all
+Multi-Arch: foreign
+Depends: libzstd-jni1, ${maven:CompileDepends}, ${misc:Depends}
+Description: JNI bindings for Zstd (Java files)
+ Native library that provides a fast and high-compression lossless algorithm
+ for Android, Java, and all JVM languages. It features static
+ compress/decompress methods, implementation of InputStream and OutputStream
+ for transparent compression of data streams fully compatible with the "zstd"
+ program, and minimal performance overhead.
+ .
+ This package contains the required Java files.
+
+Package: libzstd-jni1
+Section: libs
+Architecture: any
+Multi-Arch: same
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: JNI bindings for Zstd (Architecture-specific files)
+ Native library that provides a fast and high-compression lossless algorithm
+ for Android, Java, and all JVM languages. It features static
+ compress/decompress methods, implementation of InputStream and OutputStream
+ for transparent compression of data streams fully compatible with the "zstd"
+ program, and minimal performance overhead.
+ .
+ This package contains the required architecture-specific files.


=====================================
debian/copyright
=====================================
@@ -0,0 +1,81 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: zstd-jni
+Source: https://github.com/luben/zstd-jni
+Files-Excluded: .github/*
+                .gitignore
+                 gradle/*
+                 jni/*
+                 src/androidTest/*
+                 src/main/native/common/*
+                 src/main/native/compress/*
+                 src/main/native/decompress/*
+                 src/main/native/dictBuilder/*
+                 src/main/native/legacy/*
+                 src/main/native/COPYING
+                 src/main/native/LICENSE
+                 src/main/native/README.md
+                 src/main/native/*.h
+                 src/test/*
+                 src/windows/*
+Comment: Exclude files required for building zstd. It is already separately
+ packaged in Debian and some source files have ambiguous licensing.
+
+Files: *
+Copyright: 2015-2022 Luben Karavelov
+License: BSD-2-clause
+
+Files: sbt
+Copyright: 2011 Paul Phillips
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ .
+     * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+     * Neither the name of the author nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: debian/*
+Copyright: 2022 Olek Wojnar <olek at debian.org>
+License: BSD-2-clause
+
+License: BSD-2-clause
+ BSD License
+ .
+ Redistribution and use in source and binary forms, with or without 
+ modification, are permitted provided that the following conditions are met:
+ .
+ * Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+ .
+ * Redistributions in binary form must reproduce the above copyright notice, 
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


=====================================
debian/docs
=====================================
@@ -0,0 +1 @@
+README.md


=====================================
debian/libzstd-jni-java.lintian-overrides
=====================================
@@ -0,0 +1,3 @@
+# False positive. Bug reported:
+# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1022792
+libzstd-jni-java: bad-jar-name


=====================================
debian/libzstd-jni-java.poms
=====================================
@@ -0,0 +1 @@
+pom.xml --no-parent --java-lib


=====================================
debian/libzstd-jni1.lintian-overrides
=====================================
@@ -0,0 +1,3 @@
+# The .so link would be the only file in a -dev package, therefore it is
+# included in the main library package.
+link-to-shared-library-in-wrong-package


=====================================
debian/libzstd-jni1.symbols
=====================================
@@ -0,0 +1,118 @@
+libzstd-jni.so.1 libzstd-jni1 #MINVER#
+* Build-Depends-Package: libzstd-jni1
+ Java_com_github_luben_zstd_ZstdCompressCtx_compressByteArray0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_compressDirectByteBuffer0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_compressDirectByteBufferStream0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_free at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_init at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_loadCDict0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_loadCDictFast0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_reset0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_setChecksum0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_setContentSize0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_setDictID0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_setLevel0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdCompressCtx_setPledgedSrcSize0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDecompressCtx_decompressByteArray0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDecompressCtx_decompressDirectByteBuffer0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDecompressCtx_decompressDirectByteBufferStream0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDecompressCtx_free at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDecompressCtx_init at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDecompressCtx_loadDDict0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDecompressCtx_loadDDictFast0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDecompressCtx_reset0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDictCompress_free at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDictCompress_init at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDictDecompress_free at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDictDecompress_init at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferCompressingStreamNoFinalizer_compressDirectByteBuffer at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferCompressingStreamNoFinalizer_createCStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferCompressingStreamNoFinalizer_endStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferCompressingStreamNoFinalizer_flushStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferCompressingStreamNoFinalizer_freeCStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferCompressingStreamNoFinalizer_initCStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferCompressingStreamNoFinalizer_initCStreamWithDict at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferCompressingStreamNoFinalizer_initCStreamWithFastDict at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferCompressingStreamNoFinalizer_recommendedCOutSize at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferDecompressingStreamNoFinalizer_createDStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferDecompressingStreamNoFinalizer_decompressStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferDecompressingStreamNoFinalizer_freeDStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferDecompressingStreamNoFinalizer_initDStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdDirectBufferDecompressingStreamNoFinalizer_recommendedDOutSize at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdInputStreamNoFinalizer_createDStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdInputStreamNoFinalizer_decompressStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdInputStreamNoFinalizer_freeDStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdInputStreamNoFinalizer_initDStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdInputStreamNoFinalizer_recommendedDInSize at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdInputStreamNoFinalizer_recommendedDOutSize at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdOutputStreamNoFinalizer_compressStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdOutputStreamNoFinalizer_createCStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdOutputStreamNoFinalizer_endStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdOutputStreamNoFinalizer_flushStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdOutputStreamNoFinalizer_freeCStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdOutputStreamNoFinalizer_recommendedCOutSize at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_ZstdOutputStreamNoFinalizer_resetCStream at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_blockSizeMax at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_chainLogMax at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_chainLogMin at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_compressBound at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_compressDirectByteBufferFastDict0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_compressFastDict0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_compressUnsafe at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_decompressDirectByteBufferFastDict0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_decompressFastDict0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_decompressUnsafe at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_decompressedDirectByteBufferSize at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_decompressedSize0 at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_defaultCompressionLevel at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errChecksumWrong at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errCorruptionDetected at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errDictionaryCorrupted at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errDictionaryCreationFailed at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errDictionaryWrong at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errDstBufferNull at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errDstSizeTooSmall at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errFrameParameterUnsupported at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errFrameParameterWindowTooLarge at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errGeneric at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errInitMissing at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errMaxSymbolValueTooLarge at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errMaxSymbolValueTooSmall at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errMemoryAllocation at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errNoError at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errParameterOutOfBound at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errParameterUnsupported at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errPrefixUnknown at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errSrcSizeWrong at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errStageWrong at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errTableLogTooLarge at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errVersionUnsupported at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_errWorkSpaceTooSmall at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_getDictIdFromDict at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_getDictIdFromFrame at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_getDictIdFromFrameBuffer at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_getErrorCode at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_getErrorName at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_hashLogMax at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_hashLogMin at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_isError at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_loadDictCompress at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_loadDictDecompress at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_loadFastDictCompress at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_loadFastDictDecompress at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_magicNumber at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_maxCompressionLevel at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_minCompressionLevel at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_searchLogMax at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_searchLogMin at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_setCompressionChecksums at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_setCompressionLevel at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_setCompressionLong at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_setCompressionMagicless at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_setCompressionWorkers at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_setDecompressionLongMax at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_setDecompressionMagicless at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_trainFromBuffer at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_trainFromBufferDirect at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_windowLogMax at Base 1.5.2-5+ds
+ Java_com_github_luben_zstd_Zstd_windowLogMin at Base 1.5.2-5+ds


=====================================
debian/maven.properties
=====================================
@@ -0,0 +1,5 @@
+project.build.sourceEncoding=UTF-8
+maven.test.skip=true
+maven.compiler.source=1.8
+maven.compiler.target=1.8
+maven.compiler.verbose=true


=====================================
debian/patches/fix_cmake.patch
=====================================
@@ -0,0 +1,36 @@
+Description: Modify upstream CMakeLists to allow Debian build
+Author: Olek Wojnar <olek at debian.org>
+Forwarded: not-needed
+Last-Update: 2022-10-20
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,14 +1,25 @@
+-cmake_minimum_required(VERSION 3.5)
++cmake_minimum_required(VERSION 3.6)
+ include(CheckCCompilerFlag)
+ project(zstd-jni C ASM)
+ file(STRINGS "version" NATIVE_VERSION)
++string(REPLACE "." ";" NATIVE_VERSION_LIST ${NATIVE_VERSION})
++list(GET NATIVE_VERSION_LIST 0 NATIVE_VERSION_MAJOR)
+ find_package(JNI)
+-include_directories("src/main/native" "src/main/native/common" "src/main/native/compress" "src/main/native/decompress" "src/main/native/dictBuilder" "src/main/native/legacy")
++include_directories("src/main/native")
+ if (JNI_FOUND)
+     include_directories(${JNI_INCLUDE_DIRS})
+ endif (JNI_FOUND)
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(ZSTD REQUIRED IMPORTED_TARGET libzstd)
++if (ZSTD_FOUND)
++    include_directories(${ZSTD_INCLUDE_DIRS})
++endif (ZSTD_FOUND)
+ file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "src/*.[cS]")
+-add_library(zstd-jni-${NATIVE_VERSION} SHARED ${SOURCES})
++add_library(zstd-jni SHARED ${SOURCES})
++set_target_properties(zstd-jni PROPERTIES VERSION ${NATIVE_VERSION}
++    SOVERSION ${NATIVE_VERSION_MAJOR} )
++target_link_libraries(zstd-jni PkgConfig::ZSTD)
++install(TARGETS zstd-jni)
+ add_definitions("-DZSTD_MULTITHREAD=1")
+ add_definitions("-DZSTD_LEGACY_SUPPORT=4")
+ CHECK_C_COMPILER_FLAG(-Oz COMPILER_SUPPORTS_OZ)


=====================================
debian/patches/import_pom.patch
=====================================
@@ -0,0 +1,57 @@
+Description: Import Maven upstream pom
+ To allow Maven builds and avoid the unnecessary pain of sbt.
+Source: https://repo1.maven.org/maven2/com/github/luben/zstd-jni/1.5.2-5/zstd-jni-1.5.2-5.pom
+Forwarded: not-needed
+Last-Update: 2022-10-20
+
+--- /dev/null
++++ b/pom.xml
+@@ -0,0 +1,48 @@
++<?xml version='1.0' encoding='UTF-8'?>
++<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
++    <modelVersion>4.0.0</modelVersion>
++    <groupId>com.github.luben</groupId>
++    <artifactId>zstd-jni</artifactId>
++    <packaging>jar</packaging>
++    <description>JNI bindings for Zstd native library that provides fast and high compression lossless algorithm for Java and all JVM languages.</description>
++    <version>1.5.2-5</version>
++    <licenses>
++        <license>
++            <name>BSD 2-Clause License</name>
++            <url>https://opensource.org/licenses/BSD-2-Clause</url>
++            <distribution>repo</distribution>
++        </license>
++    </licenses>
++    <name>zstd-jni</name>
++    <organization>
++        <name>com.github.luben</name>
++    </organization>
++    <url>https://github.com/luben/zstd-jni</url>
++    <scm>
++        <url>git at github.com:luben/zstd-jni.git</url>
++        <connection>scm:git:git at github.com:luben/zstd-jni.git</connection>
++    </scm>
++    <developers>
++        <developer>
++            <id>karavelov</id>
++            <name>Luben Karavelov</name>
++            <email>karavelov at gmail.com</email>
++            <organization>com.github.luben</organization>
++            <organizationUrl>https://github.com/luben</organizationUrl>
++        </developer>
++    </developers>
++    <dependencies>
++        <dependency>
++            <groupId>org.scalatest</groupId>
++            <artifactId>scalatest_2.12</artifactId>
++            <version>3.0.5</version>
++            <scope>test</scope>
++        </dependency>
++        <dependency>
++            <groupId>org.scalacheck</groupId>
++            <artifactId>scalacheck_2.12</artifactId>
++            <version>1.15.4</version>
++            <scope>test</scope>
++        </dependency>
++    </dependencies>
++</project>


=====================================
debian/patches/modify_pom.patch
=====================================
@@ -0,0 +1,58 @@
+Description: Modify upstream pom to allow Debian build
+Author: Olek Wojnar <olek at debian.org>
+Forwarded: not-needed
+Last-Update: 2022-10-20
+
+--- a/pom.xml
++++ b/pom.xml
+@@ -31,18 +31,36 @@
+             <organizationUrl>https://github.com/luben</organizationUrl>
+         </developer>
+     </developers>
+-    <dependencies>
+-        <dependency>
+-            <groupId>org.scalatest</groupId>
+-            <artifactId>scalatest_2.12</artifactId>
+-            <version>3.0.5</version>
+-            <scope>test</scope>
+-        </dependency>
+-        <dependency>
+-            <groupId>org.scalacheck</groupId>
+-            <artifactId>scalacheck_2.12</artifactId>
+-            <version>1.15.4</version>
+-            <scope>test</scope>
+-        </dependency>
+-    </dependencies>
++    <build>
++      <plugins>
++        <plugin>
++          <groupId>org.apache.maven.plugins</groupId>
++          <artifactId>maven-compiler-plugin</artifactId>
++          <version>3.8.1</version>
++          <configuration>
++            <source>1.8</source>
++            <target>1.8</target>
++            <compilerArgument>-Xlint:all</compilerArgument>
++            <compilerArgument>-Xdiags:verbose</compilerArgument>
++            <showWarnings>true</showWarnings>
++            <showDeprecation>true</showDeprecation>
++          </configuration>
++        </plugin>
++        <plugin>
++          <groupId>org.apache.maven.plugins</groupId>
++          <artifactId>maven-jar-plugin</artifactId>
++          <version>3.3.0</version>
++        </plugin>
++        <plugin>
++          <groupId>org.apache.maven.plugins</groupId>
++          <artifactId>maven-resources-plugin</artifactId>
++          <version>3.1.0</version>
++        </plugin>
++        <plugin>
++          <groupId>org.apache.maven.plugins</groupId>
++          <artifactId>maven-surefire-plugin</artifactId>
++          <version>2.22.3</version>
++        </plugin>
++      </plugins>
++    </build>
+ </project>


=====================================
debian/patches/properly_version_so.patch
=====================================
@@ -0,0 +1,20 @@
+Description: Modify native library name to comply with Debian policy
+ Also allows proper functioning of SONAME system as implemented in
+ fix_cmake.patch. This is required because upstream bundles the native binary
+ into the JAR file by default. Shipping the native binary separately adheres
+ better to Debian library standards and the patches are fairly trivial.
+Author: Olek Wojnar <olek at debian.org>
+Forwarded: not-needed
+Last-Update: 2022-10-20
+
+--- a/src/main/java/com/github/luben/zstd/util/Native.java
++++ b/src/main/java/com/github/luben/zstd/util/Native.java
+@@ -10,7 +10,7 @@
+     ;
+ 
+     private static final String nativePathOverride = "ZstdNativePath";
+-    private static final String libnameShort = "zstd-jni-" + ZstdVersion.VERSION;
++    private static final String libnameShort = "zstd-jni";
+     private static final String libname = "lib" + libnameShort;
+     private static final String errorMsg = "Unsupported OS/arch, cannot find " +
+         resourceName() + " or load " + libnameShort + " from system libraries. Please " +


=====================================
debian/patches/series
=====================================
@@ -0,0 +1,4 @@
+import_pom.patch
+modify_pom.patch
+fix_cmake.patch
+properly_version_so.patch


=====================================
debian/rules
=====================================
@@ -0,0 +1,26 @@
+#!/usr/bin/make -f
+
+export DH_VERBOSE = 1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export UTIL_DIR = src/main/java/com/github/luben/zstd/util
+export PKG_VER = $(shell cat version)
+%:
+	dh $@ --buildsystem=maven --with javahelper --with maven_repo_helper
+
+execute_before_dh_auto_configure:
+	dh_auto_configure --buildsystem=cmake --package=libzstd-jni1
+
+execute_before_dh_auto_build:
+	dh_auto_build --buildsystem=cmake --package=libzstd-jni1
+	printf "package com.github.luben.zstd.util;\n\npublic class ZstdVersion\
+		\n{\n\tpublic static final String VERSION = \"${PKG_VER}\";\n}\
+		\n" > ${UTIL_DIR}/ZstdVersion.java
+
+execute_before_dh_auto_install:
+	dh_auto_install --buildsystem=cmake --package=libzstd-jni1 \
+		--destdir=debian/libzstd-jni1
+
+override_dh_auto_test:
+
+execute_before_dh_auto_clean:
+	rm -f ${UTIL_DIR}/ZstdVersion.java


=====================================
debian/salsa-ci.yml
=====================================
@@ -0,0 +1,4 @@
+---
+include:
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml


=====================================
debian/source/format
=====================================
@@ -0,0 +1 @@
+3.0 (quilt)


=====================================
debian/source/lintian-overrides
=====================================
@@ -0,0 +1,6 @@
+# Upstream has a reasonable explanation for using a hyphen in their
+# version numbers:
+# Zstd-jni version uses the base Zstd version with Zstd-jni release
+# appended with a dash, e.g. "1.2.0-2" is the second Zstd-jni release
+# based on Zstd version 1.2.0.
+zstd-jni-java: hyphen-in-upstream-part-of-debian-changelog-version
\ No newline at end of file


=====================================
debian/tests/ZstdTest
=====================================
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+
+javac -cp /usr/share/java/zstd-jni.jar:/usr/share/java/junit4.jar\
+  debian/tests/ZstdTest.java
+
+java -cp /usr/share/java/zstd-jni.jar:/usr/share/java/junit4.jar:debian/tests\
+  ZstdTest
+
+rm -f debian/tests/ZstdTest.class


=====================================
debian/tests/ZstdTest.java
=====================================
@@ -0,0 +1,16 @@
+import com.github.luben.zstd.Zstd;
+import java.util.Arrays;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ZstdTest {
+  @Test
+  public static void main(String[] args) {
+    final String testString = "testing for Bazel in Debian";
+    final byte[] testStringToBytes = testString.getBytes();
+    final int originalSize = testStringToBytes.length;
+    final byte[] testBytesCompressed = Zstd.compress(testStringToBytes);
+    final byte[] testBytesDecompressed = Zstd.decompress(testBytesCompressed, originalSize);
+    Assert.assertEquals(testString, new String(testBytesDecompressed));
+  }
+}


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,3 @@
+Tests: ZstdTest
+Depends: @, default-jdk, junit4
+Restrictions: rw-build-tree
\ No newline at end of file


=====================================
debian/upstream/metadata
=====================================
@@ -0,0 +1,3 @@
+Bug-Database: https://github.com/luben/zstd-jni/issues
+Repository: https://github.com/luben/zstd-jni.git
+Repository-Browse: https://github.com/luben/zstd-jni


=====================================
debian/watch
=====================================
@@ -0,0 +1,4 @@
+version=4
+opts="repack, repacksuffix=+ds, dversionmangle=s/\+ds\d*$//" \
+   https://github.com/luben/zstd-jni/tags \
+   .*/(?:c|v)(\d[\d\.]*-[\d]+).tar.gz debian



View it on GitLab: https://salsa.debian.org/java-team/zstd-jni-java/-/commit/76118f5efd6a200f402973818fb2947f113a78d4

-- 
View it on GitLab: https://salsa.debian.org/java-team/zstd-jni-java/-/commit/76118f5efd6a200f402973818fb2947f113a78d4
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20221108/89507b5d/attachment.htm>


More information about the pkg-java-commits mailing list