[Git][java-team/openhft-chronicle-bytes][master] 5 commits: Initial packaging
Andrej Shadura
gitlab at salsa.debian.org
Thu Feb 28 16:11:07 GMT 2019
Andrej Shadura pushed to branch master at Debian Java Maintainers / openhft-chronicle-bytes
Commits:
36d7bd24 by Emmanuel Bourg at 2016-07-31T12:48:44Z
Initial packaging
- - - - -
a442ccaa by Emmanuel Bourg at 2016-07-31T12:48:47Z
Merge tag 'upstream/1.1.15'
Upstream version 1.1.15
- - - - -
13cd1f85 by Andrej Shadura at 2019-02-28T13:17:54Z
Java 9 compatibility
- - - - -
6d9b43e0 by Andrej Shadura at 2019-02-28T13:20:26Z
Ignore test failures
- - - - -
0d8ef144 by Andrej Shadura at 2019-02-28T13:20:55Z
Update the changelog
- - - - -
14 changed files:
- + debian/README.source
- + debian/changelog
- + debian/compat
- + debian/control
- + debian/copyright
- + debian/libopenhft-chronicle-bytes-java.poms
- + debian/maven.ignoreRules
- + debian/maven.properties
- + debian/maven.rules
- + debian/patches/java9.patch
- + debian/patches/series
- + debian/rules
- + debian/source/format
- + debian/watch
Changes:
=====================================
debian/README.source
=====================================
@@ -0,0 +1,9 @@
+Information about openhft-chronicle-bytes
+-----------------------------------------
+
+This package was debianized using the mh_make command
+from the maven-debian-helper package.
+
+The build system uses Maven but prevents it from downloading
+anything from the Internet, making the build compliant with
+the Debian policy.
=====================================
debian/changelog
=====================================
@@ -0,0 +1,12 @@
+openhft-chronicle-bytes (1.1.15-2) unstable; urgency=medium
+
+ * Fix Java 9 compatibility.
+ * Ignore test failures (Closes: #921291).
+
+ -- Andrej Shadura <andrewsh at debian.org> Thu, 28 Feb 2019 14:20:34 +0100
+
+openhft-chronicle-bytes (1.1.15-1) unstable; urgency=medium
+
+ * Initial release (Closes: #832915)
+
+ -- Emmanuel Bourg <ebourg at apache.org> Sun, 31 Jul 2016 14:46:47 +0200
=====================================
debian/compat
=====================================
@@ -0,0 +1 @@
+9
=====================================
debian/control
=====================================
@@ -0,0 +1,37 @@
+Source: openhft-chronicle-bytes
+Section: java
+Priority: optional
+Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
+Uploaders: Emmanuel Bourg <ebourg at apache.org>
+Build-Depends:
+ debhelper (>= 9),
+ default-jdk,
+ junit4,
+ libintellij-annotations-java,
+ libmaven-bundle-plugin-java,
+ libmockito-java,
+ libopenhft-chronicle-core-java,
+ libslf4j-java,
+ libsnappy-java,
+ maven-debian-helper (>= 2.1)
+Standards-Version: 3.9.8
+Vcs-Git: https://anonscm.debian.org/git/pkg-java/openhft-chronicle-bytes.git
+Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/openhft-chronicle-bytes.git
+Homepage: https://github.com/OpenHFT/Chronicle-Bytes
+
+Package: libopenhft-chronicle-bytes-java
+Architecture: all
+Depends: ${maven:Depends}, ${misc:Depends}
+Suggests: ${maven:OptionalDepends}
+Description: OpenHFT byte buffer library
+ Chronicle Bytes has a similar purpose to Java NIO's ByteBuffer with some
+ extensions. It's build on Chronicle Core's direct memory and OS system
+ call access and contains all the low level memory access wrappers.
+ The API supports:
+ * 64-bit sizes
+ * UTF-8 and ISO-8859-1 encoded strings.
+ * thread safe off heap memory operations.
+ * deterministic release of resources via reference counting.
+ * compressed data types such as stop bit encoding.
+ * elastic ByteBuffer wrappers which resize as required.
+ * parsing text and writing text directly to off heap bytes.
=====================================
debian/copyright
=====================================
@@ -0,0 +1,16 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: OpenHFT Chronicle Bytes
+Source: https://github.com/OpenHFT/Chronicle-Bytes
+Files-Excluded: *.iml
+
+Files: *
+Copyright: 2014-2015, Higher Frequency Trading
+License: LGPL-3
+ On Debian systems, the full text of the LGPL-3 license
+ can be found in the file '/usr/share/common-licenses/LGPL-3'
+
+Files: debian/*
+Copyright: 2016, Emmanuel Bourg <ebourg at apache.org>
+License: Apache-2.0
+ On Debian systems, the full text of the Apache-2.0 license
+ can be found in the file '/usr/share/common-licenses/Apache-2.0'
=====================================
debian/libopenhft-chronicle-bytes-java.poms
=====================================
@@ -0,0 +1,28 @@
+# List of POM files for the package
+# Format of this file is:
+# <path to pom file> [option]*
+# where option can be:
+# --ignore: ignore this POM and its artifact if any
+# --ignore-pom: don't install the POM. To use on POM files that are created
+# temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms]
+# --no-parent: remove the <parent> tag from the POM
+# --package=<package>: an alternative package to use when installing this POM
+# and its artifact
+# --has-package-version: to indicate that the original version of the POM is the same as the upstream part
+# of the version for the package.
+# --keep-elements=<elem1,elem2>: a list of XML elements to keep in the POM
+# during a clean operation with mh_cleanpom or mh_installpom
+# --artifact=<path>: path to the build artifact associated with this POM,
+# it will be installed when using the command mh_install. [mh_install]
+# --java-lib: install the jar into /usr/share/java to comply with Debian
+# packaging guidelines
+# --usj-name=<name>: name to use when installing the library in /usr/share/java
+# --usj-version=<version>: version to use when installing the library in /usr/share/java
+# --no-usj-versionless: don't install the versionless link in /usr/share/java
+# --dest-jar=<path>: the destination for the real jar.
+# It will be installed with mh_install. [mh_install]
+# --classifier=<classifier>: Optional, the classifier for the jar. Empty by default.
+# --site-xml=<location>: Optional, the location for site.xml if it needs to be installed.
+# Empty by default. [mh_install]
+#
+pom.xml --no-parent --has-package-version --usj-name=openhft-chronicle-bytes
=====================================
debian/maven.ignoreRules
=====================================
@@ -0,0 +1,5 @@
+
+net.openhft chronicle-bom * * * *
+net.openhft third-party-bom * * * *
+org.apache.maven.plugins maven-scm-publish-plugin * * * *
+org.apache.servicemix.tooling depends-maven-plugin * * * *
=====================================
debian/maven.properties
=====================================
@@ -0,0 +1,4 @@
+# Include here properties to pass to Maven during the build.
+# For example:
+# maven.test.skip=true
+
=====================================
debian/maven.rules
=====================================
@@ -0,0 +1,2 @@
+
+junit junit jar s/.*/4.x/ * *
=====================================
debian/patches/java9.patch
=====================================
@@ -0,0 +1,191 @@
+--- a/pom.xml
++++ b/pom.xml
+@@ -111,10 +111,16 @@
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+- <compilerArgument>-Xlint:deprecation</compilerArgument>
+- <source>1.8</source>
+- <target>1.8</target>
++ <source>1.9</source>
++ <target>1.9</target>
++ <fork>true</fork>
+ <encoding>UTF-8</encoding>
++ <compilerArgs>
++ <arg>-Xlint:deprecation</arg>
++ <arg>--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED</arg>
++ <arg>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</arg>
++ <arg>--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</arg>
++ </compilerArgs>
+ </configuration>
+ </plugin>
+ <!--
+--- a/src/main/java/net/openhft/chronicle/bytes/NativeBytesStore.java
++++ b/src/main/java/net/openhft/chronicle/bytes/NativeBytesStore.java
+@@ -19,17 +19,22 @@
+ import net.openhft.chronicle.core.*;
+ import net.openhft.chronicle.core.annotation.ForceInline;
+ import net.openhft.chronicle.core.io.IORuntimeException;
++import net.openhft.chronicle.core.Jvm;
+ import org.jetbrains.annotations.NotNull;
+ import org.jetbrains.annotations.Nullable;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+-import sun.misc.Cleaner;
++import java.lang.ref.Cleaner;
+ import sun.nio.ch.DirectBuffer;
++import sun.misc.Unsafe;
+
+ import java.lang.reflect.Field;
++import java.lang.reflect.Method;
+ import java.nio.BufferOverflowException;
+ import java.nio.BufferUnderflowException;
+ import java.nio.ByteBuffer;
++import java.security.AccessController;
++import java.security.PrivilegedAction;
+
+ @SuppressWarnings("sunapi")
+ public class NativeBytesStore<Underlying>
+@@ -37,11 +42,22 @@
+ private static final long MEMORY_MAPPED_SIZE = 128 << 10;
+ private static final Logger LOGGER = LoggerFactory.getLogger(NativeBytesStore.class);
+ private static final Field BB_ADDRESS, BB_CAPACITY;
++ private static final Unsafe UNSAFE;
++ private static final Method invokeCleaner;
+
+ static {
+ Class directBB = ByteBuffer.allocateDirect(0).getClass();
+ BB_ADDRESS = Jvm.getField(directBB, "address");
+ BB_CAPACITY = Jvm.getField(directBB, "capacity");
++ UNSAFE = getUnsafe();
++ Method tmpCleaner;
++ try {
++ tmpCleaner = UNSAFE.getClass().getDeclaredMethod("invokeCleaner", ByteBuffer.class);
++ tmpCleaner.setAccessible(true);
++ } catch (Throwable t) {
++ tmpCleaner = null;
++ }
++ invokeCleaner = tmpCleaner;
+ }
+
+ @Nullable
+@@ -52,12 +68,13 @@
+ protected long address;
+ long maximumLimit;
+ @Nullable
+- private Cleaner cleaner;
++ private final static Cleaner cleaner = Cleaner.create();
++ private Cleaner.Cleanable cleanable;
+ private final ReferenceCounter refCount = ReferenceCounter.onReleased(this::performRelease);
+ private boolean elastic;
+ @Nullable
+ private Underlying underlyingObject;
+- private Error releasedHere;
++ Error releasedHere;
+
+ private NativeBytesStore() {
+ }
+@@ -75,7 +92,11 @@
+ long address, long maximumLimit, @Nullable Runnable deallocator, boolean elastic) {
+ setAddress(address);
+ this.maximumLimit = maximumLimit;
+- cleaner = deallocator == null ? null : Cleaner.create(this, deallocator);
++ if (deallocator != null) {
++ cleanable = cleaner.register(this, deallocator);
++ } else {
++ cleanable = null;
++ }
+ underlyingObject = null;
+ this.elastic = elastic;
+ }
+@@ -141,14 +162,27 @@
+ underlyingObject = (Underlying) bb;
+ setAddress(((DirectBuffer) bb).address());
+ this.maximumLimit = bb.capacity();
+- cleaner = ((DirectBuffer) bb).cleaner();
++ if (invokeCleaner != null) {
++ cleanable = cleaner.register(this, new Runnable() {
++ @Override
++ public void run() {
++ try {
++ invokeCleaner.invoke(UNSAFE, bb);
++ } catch (Throwable e) {
++
++ }
++ }
++ });
++ } else {
++ cleanable = null;
++ }
+ }
+
+ public void uninit() {
+ underlyingObject = null;
+ address = 0;
+ maximumLimit = 0;
+- cleaner = null;
++ cleanable = null;
+ }
+
+ @NotNull
+@@ -423,7 +457,7 @@
+ public void write(
+ long offsetInRDO, @NotNull ByteBuffer bytes, int offset, int length) {
+ if (bytes.isDirect()) {
+- memory.copyMemory(((DirectBuffer) bytes).address(),
++ memory.copyMemory(((DirectBuffer) bytes).address() + offset,
+ address + translate(offsetInRDO), length);
+
+ } else {
+@@ -450,19 +484,21 @@
+
+ @Override
+ public long address(long offset) throws UnsupportedOperationException {
+- if (offset < start() || offset >= capacity())
++ if (offset < start() || offset > capacity())
+ throw new IllegalArgumentException();
+ return address + translate(offset);
+ }
+
+ private void performRelease() {
++ memory = null;
+ if (refCount.get() > 0) {
+ LOGGER.info("NativeBytesStore discarded without releasing ", createdHere);
+ }
+
+- memory = null;
+- if (cleaner != null)
+- cleaner.clean();
++ if (releasedHere == null)
++ releasedHere = new Error();
++ if (cleanable != null)
++ cleanable.clean();
+ }
+
+ @NotNull
+@@ -626,4 +662,25 @@
+ }
+
+ }
++
++ private static Unsafe getUnsafe() {
++ if (System.getSecurityManager() != null) {
++ return AccessController.doPrivileged(new PrivilegedAction<Unsafe>() {
++ public Unsafe run() {
++ return getUnsafe0();
++ }
++ });
++ }
++ return getUnsafe0();
++ }
++
++ private static Unsafe getUnsafe0() {
++ try {
++ Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
++ theUnsafe.setAccessible(true);
++ return (Unsafe) theUnsafe.get(null);
++ } catch (Throwable t) {
++ throw new RuntimeException("JDK did not allow accessing unsafe", t);
++ }
++ }
+ }
=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+java9.patch
=====================================
debian/rules
=====================================
@@ -0,0 +1,14 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@ --buildsystem=maven
+
+override_dh_auto_clean:
+ dh_auto_clean
+ rm -f *.bin
+
+override_dh_auto_test:
+ -dh_auto_test
+
+get-orig-source:
+ uscan --download-current-version --force-download --repack --rename --compression xz
=====================================
debian/source/format
=====================================
@@ -0,0 +1 @@
+3.0 (quilt)
=====================================
debian/watch
=====================================
@@ -0,0 +1,2 @@
+version=3
+https://github.com/OpenHFT/Chronicle-Bytes/tags .*/chronicle-bytes-(.*).tar.gz
View it on GitLab: https://salsa.debian.org/java-team/openhft-chronicle-bytes/compare/c18c20a7816ec60c7250d48685c34122d2547cfb...0d8ef144a9600f0cc689e7a63cc493cc76bad3f5
--
View it on GitLab: https://salsa.debian.org/java-team/openhft-chronicle-bytes/compare/c18c20a7816ec60c7250d48685c34122d2547cfb...0d8ef144a9600f0cc689e7a63cc493cc76bad3f5
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/20190228/64f09905/attachment.html>
More information about the pkg-java-commits
mailing list