debian/0000775000000000000000000000000012264561163007176 5ustar debian/source/0000775000000000000000000000000012141565221010467 5ustar debian/source/format0000664000000000000000000000001412141565221011675 0ustar 3.0 (quilt) debian/copyright0000664000000000000000000000121412141565221011120 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Native-platform for Java Upstream-Contact: https://github.com/adammurdoch/native-platform Source: git://github.com/adammurdoch/native-platform.git Files: * Copyright: Copyright 2012 Adam Murdoch License: Apache-2.0 On Debian systems, the full text of Apache License version 2 can be found in the file /usr/share/common-licenses/Apache-2. Files: debian/* Copyright: 2012, Damien Raude-Morvan License: Apache-2.0 On Debian systems, the full text of Apache License version 2 can be found in the file /usr/share/common-licenses/Apache-2. debian/changelog0000664000000000000000000000355612264561163011061 0ustar libnative-platform-java (0.3~rc2-2ubuntu1) trusty; urgency=low * debian/patches/make_buildsystem.diff: move ld libs to end of linking command (LP: #1238322) -- أحمد المحمودي (Ahmed El-Mahmoudy) Sun, 12 Jan 2014 20:33:29 +0200 libnative-platform-java (0.3~rc2-2) unstable; urgency=low * Upload to unstable. * d/control: Force Build-Depends on default-jdk (>= 1:1.6) to exclude any platform which may use GCJ as Java runtime (Closes: #704677). * d/watch: Include Bart Martens version. Thanks! -- Damien Raude-Morvan Mon, 06 May 2013 01:20:35 +0200 libnative-platform-java (0.3~rc2-1) experimental; urgency=low * New upstream release (from git tag 0.3-rc-2). * Refresh patches. -- Damien Raude-Morvan Tue, 26 Feb 2013 00:55:01 +0100 libnative-platform-java (0.3~rc1-1) experimental; urgency=low * New upstream release (from git tag 0.3-rc-1). * d/control: Bump Standards-Version to 3.9.4, no changes needed. * d/control: Fix Vcs-* headers to use anon. -- Damien Raude-Morvan Sun, 24 Feb 2013 17:32:06 +0100 libnative-platform-java (0.3~git20120207-1) experimental; urgency=low * New upstream Git snapshot (on 2012-02-07): - Drop d/patches/include_locale_h.patch, merged upstream. - Refresh others patches. * Also build -curses library. -- Damien Raude-Morvan Sun, 10 Feb 2013 19:21:57 +0100 libnative-platform-java (0.3~git20120103-2) experimental; urgency=low * Fix packages inclusion rule for JAR. * Force -source and -target during javac call. -- Damien Raude-Morvan Sat, 12 Jan 2013 16:18:49 +0100 libnative-platform-java (0.3~git20120103-1) experimental; urgency=low * Initial release (Closes: #697984). -- Damien Raude-Morvan Sat, 12 Jan 2013 14:22:07 +0100 debian/compat0000664000000000000000000000000212141565221010365 0ustar 9 debian/patches/0000775000000000000000000000000012264557563010636 5ustar debian/patches/native_locator_usr_lib_first.patch0000664000000000000000000000171612141565221017603 0ustar Description: Try to load native library first from /usr/lib/jni instead of extractDir or classpath. Author: Damien Raude-Morvan Last-Update: 2013-01-12 Forwarded: no --- a/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java +++ b/src/main/java/net/rubygrapefruit/platform/internal/NativeLibraryLocator.java @@ -31,6 +31,13 @@ } public File find(String libraryFileName) throws IOException { + // Try to load /usr/lib/jni/libnative-platform.so first + // before extractDir or classpath + File usrLibFile = new File("/usr/lib/jni/" + libraryFileName); + if (usrLibFile.isFile()) { + return usrLibFile; + } + if (extractDir != null) { File libFile = new File(extractDir, String.format("%s/%s", NativeLibraryFunctions.VERSION, libraryFileName)); File lockFile = new File(libFile.getParentFile(), libFile.getName() + ".lock"); debian/patches/series0000664000000000000000000000010612141565221012030 0ustar native_locator_usr_lib_first.patch make_buildsystem.diff libname.diff debian/patches/libname.diff0000664000000000000000000000201112141565221013051 0ustar --- a/src/main/java/net/rubygrapefruit/platform/internal/Platform.java +++ b/src/main/java/net/rubygrapefruit/platform/internal/Platform.java @@ -168,24 +168,24 @@ private static class Linux32Bit extends Linux { @Override public String getLibraryName() { - return "libnative-platform-linux-i386.so"; + return "libnative-platform.so"; } @Override String getCursesLibraryName() { - return "libnative-platform-curses-linux-i386.so"; + return "libnative-platform.so"; } } private static class Linux64Bit extends Linux { @Override public String getLibraryName() { - return "libnative-platform-linux-amd64.so"; + return "libnative-platform.so"; } @Override String getCursesLibraryName() { - return "libnative-platform-curses-linux-amd64.so"; + return "libnative-platform-curses.so"; } } debian/patches/make_buildsystem.diff0000664000000000000000000000526112264455612015025 0ustar Description: Use make as buildsystem instead of Gradle to avoid a circular dependencies between gradle and native-platform. This is very minimalistic Makefile so it will only work for Debian use case for now. Author: Damien Raude-Morvan Last-Update: 2013-01-12 Forwarded: no --- /dev/null +++ b/Makefile @@ -0,0 +1,66 @@ +IDIR=src/main/headers +SRCDIR=src/main/cpp +JSRCDIR=src/main/java +BUILD=build +IGEN=$(BUILD)/headers +JCLASSESDIR=$(BUILD)/classes +JDOCDIR=$(BUILD)/docs/javadoc +ODIR=$(BUILD)/binaries +JAR=$(BUILD)/native-platform.jar + +JTARGET=1.5 +JSOURCE=1.5 + +INCLUDE=-I$(IDIR) -I$(IGEN) -I/usr/include -I/usr/lib/jvm/default-java/include +#LDLIBS=-lncurses + +_OBJ_STD = generic.o generic_posix.o linux.o osx.o posix.o win.o +_OBJ_CURSES = generic.o generic_posix.o curses.o +OBJ_STD = $(patsubst %,$(ODIR)/%,$(_OBJ_STD)) +OBJ_CURSES = $(patsubst %,$(ODIR)/%,$(_OBJ_CURSES)) +_JAVA = $(shell find $(JSRCDIR) -name "*.java" -print) + +.PHONY: clean jar javadoc + +build: $(ODIR)/libnative-platform.so $(ODIR)/libnative-platform-curses.so jar javadoc + +$(ODIR)/libnative-platform.so: $(OBJ_STD) + $(CXX) $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -o $@ $^ + +$(ODIR)/libnative-platform-curses.so: $(OBJ_CURSES) + $(CXX) $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -o $@ $^ -lcurses + +$(JCLASSESDIR)/%.class: javafiles-list + mkdir -p $(JCLASSESDIR) + $(JAVA_HOME)/bin/javac -source $(JTARGET) -target $(JSOURCE) -d $(JCLASSESDIR) -classpath /usr/share/java/joptsimple.jar @javafiles-list + +javafiles-list: $(_JAVA) + echo $^ > javafiles-list + +javadoc: javafiles-list + mkdir -p $(JDOCDIR) + $(JAVA_HOME)/bin/javadoc -d $(JDOCDIR) -classpath /usr/share/java/joptsimple.jar @javafiles-list + +jar: $(JCLASSESDIR)/%.class + mkdir -p $(JDOCDIR) + (cd $(JCLASSESDIR) ; $(JAVA_HOME)/bin/jar cf ../../$(JAR) .) + +$(ODIR)/%.o: $(SRCDIR)/%.cpp $(IGEN)/native.h + mkdir -p $(ODIR) + $(CXX) $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(INCLUDE) -fPIC -c -o $@ $< + +$(IGEN)/native.h: $(JCLASSESDIR)/%.class + mkdir -p $(IGEN) + $(JAVA_HOME)/bin/javah -o $(IGEN)/native.h -classpath $(JCLASSESDIR) \ + net.rubygrapefruit.platform.internal.jni.NativeLibraryFunctions \ + net.rubygrapefruit.platform.internal.jni.PosixFileFunctions \ + net.rubygrapefruit.platform.internal.jni.PosixFileSystemFunctions \ + net.rubygrapefruit.platform.internal.jni.PosixProcessFunctions \ + net.rubygrapefruit.platform.internal.jni.PosixTerminalFunctions \ + net.rubygrapefruit.platform.internal.jni.TerminfoFunctions \ + net.rubygrapefruit.platform.internal.jni.WindowsConsoleFunctions \ + net.rubygrapefruit.platform.internal.jni.WindowsHandleFunctions + +clean: + -rm javafiles-list + -rm -Rf $(BUILD) debian/native-platform.pom0000664000000000000000000000111312141565221013010 0ustar 4.0.0 net.rubygrapefruit native-platform 0.3 org.spockframework spock-core 0.6-groovy-1.8 test debian/watch0000664000000000000000000000050612141565221010221 0ustar version=3 opts=uversionmangle=s/(\d)[\.\-]?((?:rc|RC|pre)(?:\.|-)?\d+(?:-\d+)?)$/$1~$2/,dversionmangle=s/^(0\.3~rc)(\d+)$/$1-$2/ \ https://github.com/adammurdoch/native-platform/tags \ .*/archive/(?:upstream/)?(?:v||version-|release-|X|R|r)(\d\S*)\.tar\.gz # Bart Martens Sat, 04 May 2013 09:06:25 +0000 debian/rules0000775000000000000000000000160112141565221010245 0ustar #!/usr/bin/make -f export JAVA_HOME := /usr/lib/jvm/default-java DEB_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p') DEB_DIR=libnative-platform-java-$(DEB_VERSION) VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*[+~]git([0-9a-z]+).*,\1,p') INDEP_DIR := net/rubygrapefruit/native-platform %: dh $@ --with maven_repo_helper override_dh_auto_install: dh_install -plibnative-platform-jni build/binaries/libnative-platform*.so /usr/lib/jni/ dh_install -plibnative-platform-java-doc build/docs/javadoc/* /usr/share/doc/libnative-platform-java/api/ get-orig-source: # Extract version from github git clone git://github.com/adammurdoch/native-platform.git temp/ (cd temp/; \ git archive --prefix $(DEB_DIR)/ HEAD | tar --wildcards --delete '*/gradle/*' | gzip -9 > ../../libnative-platform-java_$(DEB_VERSION).orig.tar.gz; \ ) rm -rf temp/ debian/libnative-platform-java.poms0000664000000000000000000000014112141565221014601 0ustar debian/native-platform.pom --has-package-version --artifact=build/native-platform.jar --java-lib debian/control0000664000000000000000000000365712141565221010605 0ustar Source: libnative-platform-java Section: java Priority: optional Maintainer: Debian Java Maintainers Uploaders: Damien Raude-Morvan Build-Depends: ant, debhelper (>= 9), default-jdk (>= 1:1.6), libjoptsimple-java, libncurses5-dev, maven-repo-helper (>= 1.5~) Standards-Version: 3.9.4 Homepage: https://github.com/adammurdoch/native-platform Vcs-Git: git://anonscm.debian.org/pkg-java/libnative-platform-java.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-java/libnative-platform-java.git Package: libnative-platform-java Architecture: all Depends: libnative-platform-jni (>= ${source:Version}), ${misc:Depends} Description: Java bindings for various native APIs A collection of cross-platform Java APIs for various native APIs. Supports OS X, Linux, Solaris and Windows. . These APIs support Java 5 and later. Some of these APIs overlap with APIs available in later Java versions. Package: libnative-platform-jni Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} Description: Java bindings for various native APIs - JNI library A collection of cross-platform Java APIs for various native APIs. Supports OS X, Linux, Solaris and Windows. . These APIs support Java 5 and later. Some of these APIs overlap with APIs available in later Java versions. . This package contains the java JNI library. Package: libnative-platform-java-doc Architecture: all Section: doc Depends: ${misc:Depends} Suggests: libnative-platform-java Description: testing and specification framework for Java and Groovy - Docs A collection of cross-platform Java APIs for various native APIs. Supports OS X, Linux, Solaris and Windows. . These APIs support Java 5 and later. Some of these APIs overlap with APIs available in later Java versions. . This package contains Javadoc API for libnative-platform-java.