From d36345772c3b60c66b192205223019dbe87b9ca2c9d5a4b42c526a5868ba30ae Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 24 Mar 2020 14:54:33 +0000 Subject: [PATCH] Accepting request 787830 from Application:Geo lets move this package where it belongs OBS-URL: https://build.opensuse.org/request/show/787830 OBS-URL: https://build.opensuse.org/package/show/Java:packages/rxtx-java?expand=0&rev=1 --- .gitattributes | 23 +++ .gitignore | 1 + rxtx-2.2pre2.zip | 3 + rxtx-java-38400.patch | 21 +++ rxtx-java-arduinouno.diff | 12 ++ rxtx-java-disable-crazy-version-tests.diff | 45 +++++ rxtx-java-error.diff | 25 +++ rxtx-java-formatstring.patch | 42 +++++ rxtx-java-missing-javah.patch | 44 +++++ rxtx-java-sysio.patch | 27 +++ rxtx-java-version.patch | 12 ++ rxtx-java.changes | 107 ++++++++++++ rxtx-java.spec | 190 +++++++++++++++++++++ rxtx-osgi.bnd | 2 + 14 files changed, 554 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 rxtx-2.2pre2.zip create mode 100644 rxtx-java-38400.patch create mode 100644 rxtx-java-arduinouno.diff create mode 100644 rxtx-java-disable-crazy-version-tests.diff create mode 100644 rxtx-java-error.diff create mode 100644 rxtx-java-formatstring.patch create mode 100644 rxtx-java-missing-javah.patch create mode 100644 rxtx-java-sysio.patch create mode 100644 rxtx-java-version.patch create mode 100644 rxtx-java.changes create mode 100644 rxtx-java.spec create mode 100644 rxtx-osgi.bnd diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/rxtx-2.2pre2.zip b/rxtx-2.2pre2.zip new file mode 100644 index 0000000..17ddbf8 --- /dev/null +++ b/rxtx-2.2pre2.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c30373e760f444def3650c76c5a00ae12fb1d860ec008750d084f4880495b03 +size 1491209 diff --git a/rxtx-java-38400.patch b/rxtx-java-38400.patch new file mode 100644 index 0000000..a09f955 --- /dev/null +++ b/rxtx-java-38400.patch @@ -0,0 +1,21 @@ +diff -up ./src/SerialImp.c.orig ./src/SerialImp.c +--- ./src/SerialImp.c.orig 2015-05-04 20:12:01.000000000 +0200 ++++ ./src/SerialImp.c 2015-05-04 20:14:58.580336504 +0200 +@@ -872,13 +872,13 @@ int set_port_params( JNIEnv *env, int fd + + See the next ifdef below for the divisor. + */ +-#if defined(TIOCGSERIAL) +- if ( cspeed == B38400 ) +- cspeed = 38400; +-#endif /* TIOCGSERIAL */ + if( cfsetispeed( &ttyset, cspeed ) < 0 || + cfsetospeed( &ttyset, cspeed ) < 0 ) + { ++#if defined(TIOCGSERIAL) ++ if ( cspeed == B38400 ) ++ cspeed = 38400; ++#endif /* TIOCGSERIAL */ + /* + Some people need to set the baud rate to ones not defined + in termios.h diff --git a/rxtx-java-arduinouno.diff b/rxtx-java-arduinouno.diff new file mode 100644 index 0000000..0f9d375 --- /dev/null +++ b/rxtx-java-arduinouno.diff @@ -0,0 +1,12 @@ +diff --git a/src/gnu/io/RXTXCommDriver.java b/src/gnu/io/RXTXCommDriver.java +index 3dce198..55bcf3c 100644 +--- a/src/gnu/io/RXTXCommDriver.java ++++ b/src/gnu/io/RXTXCommDriver.java +@@ -577,6 +577,7 @@ public class RXTXCommDriver implements CommDriver + "ttyS", // linux Serial Ports + "ttySA", // for the IPAQs + "ttyUSB", // for USB frobs ++ "ttyACM", // linux CDC ACM devices + "rfcomm", // bluetooth serial device + "ttyircomm", // linux IrCommdevices (IrDA serial emu) + }; diff --git a/rxtx-java-disable-crazy-version-tests.diff b/rxtx-java-disable-crazy-version-tests.diff new file mode 100644 index 0000000..ca3acd8 --- /dev/null +++ b/rxtx-java-disable-crazy-version-tests.diff @@ -0,0 +1,45 @@ +Author: Stefan Seyfried + +This disables the IMVHO useless checks if the running kernel is identical +to the compiling kernel, which were broken with 3.1+ kernels anyway as +apparently UTS_RELEASE was removed from headers. + +diff --git a/src/I2CImp.c b/src/I2CImp.c +index 3a61545..a146788 100644 +--- a/src/I2CImp.c ++++ b/src/I2CImp.c +@@ -125,7 +125,7 @@ JNIEXPORT void JNICALL Java_gnu_io_I2CPort_Initialize( + sigaction( SIGIO, NULL, &handler ); + if( !handler.sa_handler ) signal( SIGIO, SIG_IGN ); + #endif /* !__FreeBSD__ */ +-#if defined(__linux__) ++#if 0 + /* Lets let people who upgraded kernels know they may have problems */ + if (uname (&name) == -1) + { +diff --git a/src/RS485Imp.c b/src/RS485Imp.c +index 280d64b..44b9c37 100644 +--- a/src/RS485Imp.c ++++ b/src/RS485Imp.c +@@ -125,7 +125,7 @@ JNIEXPORT void JNICALL Java_gnu_io_RS485Port_Initialize( + sigaction( SIGIO, NULL, &handler ); + if( !handler.sa_handler ) signal( SIGIO, SIG_IGN ); + #endif /* !__FreeBSD__ */ +-#if defined(__linux__) ++#if 0 + /* Lets let people who upgraded kernels know they may have problems */ + if (uname (&name) == -1) + { +diff --git a/src/RawImp.c b/src/RawImp.c +index 077f30e..4aa171d 100644 +--- a/src/RawImp.c ++++ b/src/RawImp.c +@@ -270,7 +270,7 @@ JNIEXPORT void JNICALL Java_gnu_io_RawPort_Initialize( + sigaction( SIGIO, NULL, &handler ); + if( !handler.sa_handler ) signal( SIGIO, SIG_IGN ); + #endif /* !__FreeBSD__ */ +-#if defined(__linux__) ++#if 0 + /* Lets let people who upgraded kernels know they may have problems */ + if (uname (&name) == -1) + { diff --git a/rxtx-java-error.diff b/rxtx-java-error.diff new file mode 100644 index 0000000..a658576 --- /dev/null +++ b/rxtx-java-error.diff @@ -0,0 +1,25 @@ +Author: Stefan Seyfried + +Report an error if we cannot lock the serial port and hint on the +possible problem. +Be a bit paranoid about buffer overruns when reporting locking problems. + +diff --git a/src/SerialImp.c b/src/SerialImp.c +index d20adcb..8ead1cd 100644 +--- a/src/SerialImp.c ++++ b/src/SerialImp.c +@@ -5296,12 +5296,12 @@ int lib_lock_dev_lock( const char *filename, int pid ) + printf("LOCKING %s\n", filename); + if ( dev_testlock( filename ) ) + { +- report( "fhs_lock() lockstatus fail\n" ); ++ report_error( "lib_lock_dev_lock() lockstatus fail, are you in group 'lock'?\n" ); + return 1; + } + if ( dev_lock( filename ) ) + { +- sprintf( message, ++ snprintf( message, 80, + "RXTX fhs_lock() Error: creating lock file for: %s: %s\n", + filename, strerror(errno) ); + report_error( message ); diff --git a/rxtx-java-formatstring.patch b/rxtx-java-formatstring.patch new file mode 100644 index 0000000..0002ade --- /dev/null +++ b/rxtx-java-formatstring.patch @@ -0,0 +1,42 @@ +diff -up rxtx-2.2pre2/src/ParallelImp.c.orig rxtx-2.2pre2/src/ParallelImp.c +--- rxtx-2.2pre2/src/ParallelImp.c.orig 2008-11-27 21:01:48.000000000 +0100 ++++ rxtx-2.2pre2/src/ParallelImp.c 2012-09-16 12:47:04.293202519 +0200 +@@ -920,7 +920,7 @@ void throw_java_exception_system_msg( JN + void report_error(char *msg) + { + #ifndef DEBUG_MW +- fprintf(stderr, msg); ++ fputs(stderr, msg); + #else + mexWarnMsgTxt( msg ); + #endif /* DEBUG_MW */ +@@ -938,7 +938,7 @@ void report_error(char *msg) + void report(char *msg) + { + #ifdef DEBUG +- fprintf(stderr, msg); ++ fputs(stderr, msg); + #endif /* DEBUG */ + } + +diff -up rxtx-2.2pre2/src/SerialImp.c.orig rxtx-2.2pre2/src/SerialImp.c +--- rxtx-2.2pre2/src/SerialImp.c.orig 2009-02-04 23:06:16.000000000 +0100 ++++ rxtx-2.2pre2/src/SerialImp.c 2012-09-16 12:48:06.336426875 +0200 +@@ -5096,7 +5096,7 @@ void throw_java_exception( JNIEnv *env, + void report_warning(char *msg) + { + #ifndef DEBUG_MW +- fprintf(stderr, msg); ++ fputs(stderr, msg); + #else + mexWarnMsgTxt( (const char *) msg ); + #endif /* DEBUG_MW */ +@@ -5133,7 +5133,7 @@ void report_verbose(char *msg) + void report_error(char *msg) + { + #ifndef DEBUG_MW +- fprintf(stderr, msg); ++ fputs(stderr, msg); + #else + mexWarnMsgTxt( msg ); + #endif /* DEBUG_MW */ diff --git a/rxtx-java-missing-javah.patch b/rxtx-java-missing-javah.patch new file mode 100644 index 0000000..3d846d4 --- /dev/null +++ b/rxtx-java-missing-javah.patch @@ -0,0 +1,44 @@ +--- rxtx-2.2pre2/configure.in 2020-03-20 09:54:50.687102488 +0100 ++++ rxtx-2.2pre2/configure.in 2020-03-20 09:58:32.344380982 +0100 +@@ -99,7 +99,6 @@ + AC_SUBST(JPATH) + AC_SUBST(JHOME) + AC_SUBST(RXTX_PATH) +-AC_SUBST(JAVAH) + AC_SUBST(JAVAC) + AC_SUBST(JAR) + AC_SUBST(JAVADOC) +@@ -472,8 +471,7 @@ + case $JAVA_VENDOR in + Tran*) + find_java_native_include jni.h +- JAVAH="\$(JPATH)/bin/kaffeh -classpath \$(CLASSPATH) -d \$(DEST) -jni" +- JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" ++ JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -h \$(DEST) -d \$(TOP)/ -O -source 1.8 -target 1.8" + JAR="\$(JPATH)/bin/jar" + JAVADOC="\$(JPATH)/bin/javadoc -classpath \$(CLASSPATH)" + CFLAGS=$CFLAGS" -D_BSD_SOURCE" +@@ -484,8 +482,7 @@ + ;; + *) + find_java_native_include jni_md.h +- JAVAH="\$(JPATH)/bin/javah -classpath \$(CLASSPATH) -d \$(DEST) -jni" +- JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -d \$(TOP)/ -O -source 1.3 -target 1.3" ++ JAVAC="\$(JPATH)/bin/javac -classpath \$(CLASSPATH) -h \$(DEST) -d \$(TOP)/ -O -source 1.8 -target 1.8" + JAR="\$(JPATH)/bin/jar" + JAVADOC="\$(JPATH)/bin/javadoc" + CFLAGS=$CFLAGS" -D_BSD_SOURCE" +--- rxtx-2.2pre2/Makefile.am 2020-03-20 09:54:50.691102510 +0100 ++++ rxtx-2.2pre2/Makefile.am 2020-03-20 09:57:19.527960989 +0100 +@@ -111,11 +111,6 @@ + $(CLASSES): $(javafiles) $(TOP)/Makefile + $(JAVAH_FIX) + $(JAVAC) $(javafiles) +- $(JAVAH) `(for i in $(javahfiles);do \ +- if grep > /dev/null native.*\( $(SPATH)/gnu/io/$$i.java; then \ +- echo $(CLASSDIR).$$i; \ +- fi; \ +- done)` + $(JAR) cf $(JARTARGET) $(CLASSTOP)/* + + # install librxtxSerial.so into the proper directory and copy $(JARTARGET) to its diff --git a/rxtx-java-sysio.patch b/rxtx-java-sysio.patch new file mode 100644 index 0000000..08e0c2e --- /dev/null +++ b/rxtx-java-sysio.patch @@ -0,0 +1,27 @@ +--- configure.in.old 2013-05-31 17:45:03.395109000 +0200 ++++ configure.in 2013-05-31 17:45:31.887586000 +0200 +@@ -71,6 +71,7 @@ + AC_CHECK_HEADERS(sys/time.h) + AC_CHECK_HEADERS(sys/signal.h) + AC_CHECK_HEADERS(signal.h) ++AC_CHECK_HEADERS(sys/io.h) + AC_CHECK_HEADERS(termios.h) + AC_CHECK_HEADERS(grp.h) + AC_CHECK_HEADERS(pwd.h) +--- src/RawImp.c.old 2013-05-31 17:46:32.595659000 +0200 ++++ src/RawImp.c 2013-05-31 17:46:49.886950000 +0200 +@@ -99,11 +99,9 @@ + # include + # include + #endif +-#ifndef __APPLE__ /* dima */ +-#ifndef PPC +-#include +-#endif /* PPC */ +-#endif /* dima */ ++#ifdef HAVE_SYS_IO_H ++# include ++#endif + + extern int errno; + #include "I2CImp.h" diff --git a/rxtx-java-version.patch b/rxtx-java-version.patch new file mode 100644 index 0000000..ec181ec --- /dev/null +++ b/rxtx-java-version.patch @@ -0,0 +1,12 @@ +diff -up ./configure.in.orig ./configure.in +--- ./configure.in.orig 2015-05-01 16:18:46.000000000 +0200 ++++ ./configure.in 2015-05-01 16:19:59.047858458 +0200 +@@ -64,7 +64,7 @@ AC_PROG_CC + AC_DISABLE_STATIC + AM_PROG_LIBTOOL + # end of SCO fixes +-AM_INIT_AUTOMAKE(Serial,2.2pre1) ++AM_INIT_AUTOMAKE(Serial,2.2pre2) + AC_CHECK_HEADERS(fcntl.h) + AC_CHECK_HEADERS(sys/fcntl.h) + AC_CHECK_HEADERS(sys/file.h) diff --git a/rxtx-java.changes b/rxtx-java.changes new file mode 100644 index 0000000..9b67497 --- /dev/null +++ b/rxtx-java.changes @@ -0,0 +1,107 @@ +------------------------------------------------------------------- +Tue Mar 24 07:29:04 UTC 2020 - Fridrich Strba + +- Require the aqute-bnd for build on SLE15-SP2 and higher, on + Leap 15.2 and higher and on Factory. +- Add force_aqute_bnd define to allow building with the aqute-bnd + requirements for repositories that backport this package to lower + distro versions + +------------------------------------------------------------------- +Fri Mar 20 10:13:39 UTC 2020 - Fridrich Strba + +- Make the package version to have a tilde between the 2.2 and pre2 + so that 2.2 be an upgrade +- Allow building with java 9+ too +- Modified patch: + * Do not call the javac twice, add the -h option to the standard + invocation + * Apply this patch if we are building with java 8 and higher and + not according to distribution version +- Add osgi manifest to the jar file so that it can be used from + eclipse + +------------------------------------------------------------------- +Sat Apr 14 07:57:48 UTC 2018 - F.Schuette@t-online.de + +- make patch work for leap 15.0 + +------------------------------------------------------------------- +Tue Feb 27 18:02:26 UTC 2018 - F.Schuette@t-online.de + +- javah is missing from java-9, patch to use javac -h instead + +------------------------------------------------------------------- +Sun Oct 1 19:10:20 UTC 2017 - F.Schuette@t-online.de + +- change source, target to 1.6 + +------------------------------------------------------------------- +Sun Oct 1 18:41:36 UTC 2017 - F.Schuette@t-online.de + +- BuildRequires java-devel <= 1.8.0 + +------------------------------------------------------------------- +Tue May 5 15:48:30 UTC 2015 - F.Schuette@t-online.de + +- changed 38400 patch like dstoecker suggested + +------------------------------------------------------------------- +Sat May 2 12:17:06 UTC 2015 - F.Schuette@t-online.de + +- remove rules file, user has to be in dialout and lock + +------------------------------------------------------------------- +Fri May 1 14:23:35 UTC 2015 - F.Schuette@t-online.de + +- fix serial baudrate 38400 not possible +- fix version # 2.2.pre2 +- split package + +------------------------------------------------------------------- +Fri May 31 15:50:55 UTC 2013 - dvaleev@suse.com + +- Detect if sysio available (rxtx-java-sysio.patch) + +------------------------------------------------------------------- +Fri Dec 30 12:30:57 UTC 2011 - seife+obs@b1-systems.com + +- buildrequire automake and libtool to fix Factory build + +------------------------------------------------------------------- +Sat Sep 24 18:16:49 UTC 2011 - seife+obs@b1-systems.com + +- fix build for SLES10, remove always false %if clause + +------------------------------------------------------------------- +Sat Sep 17 15:25:33 UTC 2011 - seife+obs@b1-systems.com + +- also fix build on SLES11SP1 + +------------------------------------------------------------------- +Sat Sep 17 14:50:47 UTC 2011 - seife+obs@b1-systems.com + +- fix build on openSUSE 11.3 (no pkgconfig() stuff) + +------------------------------------------------------------------- +Sat Sep 17 13:54:54 UTC 2011 - seife+obs@b1-systems.com + +- use liblockdev to lock devices +- report locking problems with hint on possible problem +- fix build on newer kernels (no UTS_RELEASE) + +------------------------------------------------------------------- +Fri Aug 26 20:52:20 UTC 2011 - seife+obs@b1-systems.com + +- add ttyACM ports so that it works with arduino uno + +------------------------------------------------------------------- +Sun Aug 22 06:59:34 UTC 2010 - kkaempf@novell.com + +- update to 2.2pre2 + +------------------------------------------------------------------- +Sat Mar 11 11:06:05 AEST 2007 - developer@jefferyfernandez.id.au + +- Initial Release for openSUSE +------------------------------------------------------------------- diff --git a/rxtx-java.spec b/rxtx-java.spec new file mode 100644 index 0000000..f16166d --- /dev/null +++ b/rxtx-java.spec @@ -0,0 +1,190 @@ +# +# spec file for package rxtx-java +# +# Copyright (c) 2020 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define src_name rxtx +%define upver 2.2 +%define prever pre2 +%define libversion 2 +%define force_aqute_bnd 0 +Name: rxtx-java +Version: %{upver}~%{prever} +Release: 0 +Summary: Full Java CommAPI implementation +License: LGPL-2.1-or-later +Group: Development/Libraries/Java +URL: http://rxtx.qbang.org/wiki/index.php/Main_Page +Source0: http://rxtx.qbang.org/pub/rxtx/%{src_name}-%{upver}%{prever}.zip +Source1: rxtx-osgi.bnd +Patch0: rxtx-java-arduinouno.diff +Patch1: rxtx-java-disable-crazy-version-tests.diff +Patch2: rxtx-java-error.diff +Patch4: rxtx-java-sysio.patch +Patch5: rxtx-java-38400.patch +Patch6: rxtx-java-version.patch +Patch7: rxtx-java-missing-javah.patch +BuildRequires: automake +BuildRequires: libtool +BuildRequires: pkgconfig +BuildRequires: unzip +BuildRequires: zip +BuildRequires: pkgconfig(lockdev) +Requires: librxtx%{libversion} +%if 0%{?sle_version} > 150100 || 0%{?suse_version} >= 1550 || %{force_aqute_bnd} +BuildRequires: aqute-bnd +BuildRequires: javapackages-local +%else +BuildRequires: java-devel +BuildRequires: javapackages-tools +%endif +%if 0%{?mdkversion} +Patch3: rxtx-java-formatstring.patch +%endif + +%description +RxTx is a Java library, using a native implementation (via JNI), providing serial +and parallel communication for the Java Development Toolkit (JDK). It is based on +the specification for Sun's Java Communications API. + +%package javadoc +Summary: Javadocs for rxtx-java +Group: Documentation/HTML +Requires(pre): coreutils + +%description javadoc +RxTx is a Java library, using a native implementation (via JNI), providing serial +and parallel communication for the Java Development Toolkit (JDK). It is based on +the specification for Sun's Java Communications API. + +%package src +Summary: Java Sources for rxtx-java +Group: Development/Sources + +%description src +RxTx is a Java library, using a native implementation (via JNI), providing serial +and parallel communication for the Java Development Toolkit (JDK). It is based on +the specification for Sun's Java Communications API. + +%package -n librxtx%{libversion} +Summary: Full Java CommAPI implementation native library +Group: Development/Libraries/C and C++ + +%description -n librxtx%{libversion} +RxTx is a Java library, using a native implementation (via JNI), providing serial +and parallel communication for the Java Development Toolkit (JDK). It is based on +the specification for Sun's Java Communications API. + +%package -n librxtx%{libversion}-devel +Summary: Full Java CommAPI implementation native library include +Group: Development/Sources + +%description -n librxtx%{libversion}-devel +RxTx is a Java library, using a native implementation (via JNI), providing serial +and parallel communication for the Java Development Toolkit (JDK). It is based on +the specification for Sun's Java Communications API. + +%prep +%setup -q -n %{src_name}-%{upver}%{prever} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%if 0%{?mdkversion} +%patch3 -p1 +%endif +%patch4 +%patch5 -p1 +%patch6 -p1 +%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 1.8}%{!?pkg_vcmp:0} +%patch7 -p1 +%endif + +%build +export THREADS_FLAG=native +rm acinclude.m4 config.guess config.sub install-sh ltmain.sh missing mkinstalldirs aclocal.m4 Makefile.in ltconfig stamp-h.in +./autogen.sh +CFLAGS="%{optflags}" LDFLAGS=-s \ + %configure \ +%if 0%{?suse_version} > 1130 + --enable-liblock=yes +%endif + +%make_build + +%if 0%{?sle_version} > 150100 || 0%{?suse_version} >= 1550 || %{force_aqute_bnd} +# Inject OSGi metadata +bnd wrap -p %{SOURCE1} -v %{upver} -o RXTXcomm-bnd.jar RXTXcomm.jar +mv RXTXcomm-bnd.jar RXTXcomm.jar +%endif + +# build javadoc +mkdir -p javadoc +javadoc -d javadoc src/gnu/io/*.java +cd javadoc +zip -r ../%{name}-%{version}-javadoc.zip . +cd .. + +%install +mkdir -p %{buildroot}%{_javadir} %{buildroot}%{_libdir} +make RXTX_PATH=%{buildroot}%{_libdir} JHOME=%{buildroot}%{_javadir} install + +find %{buildroot}%{_prefix} -xtype f -print | \ + sed "s@^$RPM_BUILD_ROOT@@g" > INSTALLED_FILES + +if [ "$(cat INSTALLED_FILES)X" = "X" ] ; then + echo "No files!" + exit -1 +fi + +# install javadoc +mkdir -p %{buildroot}%{_javadocdir} +cp %{name}-%{version}-javadoc.zip %{buildroot}%{_javadocdir} +pushd %{buildroot}%{_javadocdir} +ln -s %{name}-%{version}-javadoc.zip %{name}-javadoc.zip +popd + +# install src files +cd src +zip -r ../%{name}-%{version}-src.zip gnu/io/ +cd .. +cp %{name}-%{version}-src.zip %{buildroot}%{_javadir} + +# install lib devel files +mkdir -p %{buildroot}%{_includedir}/rxtx +cp src/*.h %{buildroot}%{_includedir}/rxtx + +%files +%doc AUTHORS ChangeLog README RMISecurityManager.html INSTALL PORTING TODO +%license COPYING +%{_datadir}/java/RXTXcomm.jar + +%files javadoc +%dir %{_javadocdir} +%doc %{_javadocdir}/%{name}-%{version}-javadoc.zip +%doc %{_javadocdir}/%{name}-javadoc.zip + +%files src +%{_javadir}/%{name}-%{version}-src.zip + +%files -n librxtx%{libversion} +%defattr(755,root,root) +%{_libdir}/*.so + +%files -n librxtx%{libversion}-devel +%{_includedir}/rxtx +%{_libdir}/*.la + +%changelog diff --git a/rxtx-osgi.bnd b/rxtx-osgi.bnd new file mode 100644 index 0000000..15f5671 --- /dev/null +++ b/rxtx-osgi.bnd @@ -0,0 +1,2 @@ +Bundle-SymbolicName: gnu.io.rxtx +Export-Package: gnu.io