From 05fac9217a0072c3bd138b6b5e3f918d0adbec95d231b6fdeffd4c84feb1bc5d Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Sat, 28 Sep 2024 22:13:57 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/libreadline-java?expand=0&rev=42 --- .gitattributes | 23 ++ .gitignore | 1 + baselibs.conf | 1 + libreadline-java-0.8.0-jdk10.patch | 22 ++ libreadline-java-0.8.3-src.tar.gz | 3 + libreadline-java-gcc14.patch | 27 +++ libreadline-java-libdir.patch | 15 ++ libreadline-java-ncurses.patch | 26 +++ libreadline-java-reproducible-jar-mtime.patch | 25 ++ libreadline-java.changes | 218 ++++++++++++++++++ libreadline-java.spec | 104 +++++++++ 11 files changed, 465 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 baselibs.conf create mode 100644 libreadline-java-0.8.0-jdk10.patch create mode 100644 libreadline-java-0.8.3-src.tar.gz create mode 100644 libreadline-java-gcc14.patch create mode 100644 libreadline-java-libdir.patch create mode 100644 libreadline-java-ncurses.patch create mode 100644 libreadline-java-reproducible-jar-mtime.patch create mode 100644 libreadline-java.changes create mode 100644 libreadline-java.spec 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/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..6af1c6e --- /dev/null +++ b/baselibs.conf @@ -0,0 +1 @@ +libreadline-java diff --git a/libreadline-java-0.8.0-jdk10.patch b/libreadline-java-0.8.0-jdk10.patch new file mode 100644 index 0000000..96e6d97 --- /dev/null +++ b/libreadline-java-0.8.0-jdk10.patch @@ -0,0 +1,22 @@ +Index: libreadline-java-0.8.3/src/native/Makefile +=================================================================== +--- libreadline-java-0.8.3.orig/src/native/Makefile ++++ libreadline-java-0.8.3/src/native/Makefile +@@ -132,15 +132,11 @@ endif + getline.$(OBJ_EXT): getline.c + $(CC) $(INCLUDES) $(CPPFLAGS) $(NATIVE_CFLAGS) -D$(TG) -c getline.c + +-org_gnu_readline_Readline.$(OBJ_EXT): org_gnu_readline_Readline.h \ +- org_gnu_readline_Readline.c +- $(CC) $(INCLUDES) $(CPPFLAGS) $(NATIVE_CFLAGS) -D$(TG) \ +- -c org_gnu_readline_Readline.c ++org_gnu_readline_Readline.$(OBJ_EXT): org_gnu_readline_Readline.h org_gnu_readline_Readline.c ++ $(CC) $(INCLUDES) $(CPPFLAGS) $(NATIVE_CFLAGS) -D$(TG) -c org_gnu_readline_Readline.c + + ifeq ($(USE_JAVAH),true) + org_gnu_readline_Readline.h: $(BUILDDIR)/org/gnu/readline/Readline.class +- $(JAVA_HOME)/bin/javah -classpath $(BUILDDIR) -jni org.gnu.readline.Readline +- touch org_gnu_readline_Readline.h + endif + + clean: diff --git a/libreadline-java-0.8.3-src.tar.gz b/libreadline-java-0.8.3-src.tar.gz new file mode 100644 index 0000000..29ff64c --- /dev/null +++ b/libreadline-java-0.8.3-src.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57d46274b9fd18bfc5fc8b3ab751e963386144629bcfd6c66b4fae04bbf8c89f +size 82037 diff --git a/libreadline-java-gcc14.patch b/libreadline-java-gcc14.patch new file mode 100644 index 0000000..cf4950a --- /dev/null +++ b/libreadline-java-gcc14.patch @@ -0,0 +1,27 @@ +--- libreadline-java-0.8.3/src/native/org_gnu_readline_Readline.c 2024-05-06 17:37:38.514389018 +0200 ++++ libreadline-java-0.8.3/src/native/org_gnu_readline_Readline.c 2024-05-06 17:56:42.055629445 +0200 +@@ -198,18 +198,18 @@ + }; + + static char** globalStringInternals[] = { +- /* const */ &rl_library_version, +- /* const */ &rl_readline_name, ++ /* const */ (char **) &rl_library_version, ++ /* const */ (char **) &rl_readline_name, + &undefinedInternalString, /* &rl_prompt, */ + &rl_line_buffer, + &undefinedInternalString, /* const &rl_terminal_name, */ + &undefinedInternalString, /* &rl_executing_macro, */ +- /* const */ &rl_basic_word_break_characters, +- /* const */ &rl_completer_word_break_characters, +- /* const */ &rl_completer_quote_characters, ++ /* const */ (char **) &rl_basic_word_break_characters, ++ /* const */ (char **) &rl_completer_word_break_characters, ++ /* const */ (char **) &rl_completer_quote_characters, + &undefinedInternalString, /* const &rl_basic_quote_characters, */ + &undefinedInternalString, /* const &rl_filename_quote_characters, */ +- /* const */ &rl_special_prefixes, ++ /* const */ (char **) &rl_special_prefixes, + + &undefinedInternalString, /* &history_word_delimiters, */ + &undefinedInternalString, /* &history_no_expand_chars, */ diff --git a/libreadline-java-libdir.patch b/libreadline-java-libdir.patch new file mode 100644 index 0000000..47d26f3 --- /dev/null +++ b/libreadline-java-libdir.patch @@ -0,0 +1,15 @@ +diff -urN ../libreadline-java-0.8.0.orig/src/org/gnu/readline/Readline.java ./src/org/gnu/readline/Readline.java +--- ../libreadline-java-0.8.0.orig/src/org/gnu/readline/Readline.java 2003-01-07 05:14:35.000000000 -0500 ++++ ./src/org/gnu/readline/Readline.java 2007-07-05 16:05:25.000000000 -0400 +@@ -130,8 +130,9 @@ + iLib = lib; + return; + } +- System.loadLibrary(lib.getName()); // might throw UnsatisfiedLinkError +- iLib = lib; ++ // Load Editline backing library by default. ++ System.load("@LIBDIR@/libreadline-java/libJavaEditline.so"); ++ iLib = ReadlineLibrary.Editline; + } + + ///////////////////////////////////////////////////////////////////////////// diff --git a/libreadline-java-ncurses.patch b/libreadline-java-ncurses.patch new file mode 100644 index 0000000..afab2ea --- /dev/null +++ b/libreadline-java-ncurses.patch @@ -0,0 +1,26 @@ +Index: src/native/Makefile +=================================================================== +--- src/native/Makefile.orig ++++ src/native/Makefile +@@ -43,10 +43,8 @@ NATIVE_CFLAGS := -fpic -DPOSIX $(CFLAGS) + LD_FLAGS = -shared + + INCLUDES = -I $(JAVAINCLUDE) -I $(JAVANATINC) +-LIBPATH = -L/usr/lib/termcap +- +-JavaReadline_LIBS = -lreadline -ltermcap -lhistory +-JavaEditline_LIBS = -ledit -ltermcap ++JavaReadline_LIBS = -lreadline -ltinfo -lhistory ++JavaEditline_LIBS = -ledit -lncurses + JavaGetline_LIBS = + endif + +@@ -125,7 +123,7 @@ ifeq (MSWIN,$(OS_FLAVOR)) + $(CC) $(LD_FLAGS) $(OBJECTS) $(LIBPATH) $($(TG)_LIBS) -Fe$@ + endif + ifeq (LINUX,$(OS_FLAVOR)) +- $(CC) $(LD_FLAGS) $(OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@ ++ $(CC) $(LD_FLAGS) $(OBJECTS) $($(TG)_LIBS) -o $@ + endif + ifeq (MAC,$(OS_FLAVOR)) + $(CC) $(LD_FLAGS) $(OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@ diff --git a/libreadline-java-reproducible-jar-mtime.patch b/libreadline-java-reproducible-jar-mtime.patch new file mode 100644 index 0000000..509826e --- /dev/null +++ b/libreadline-java-reproducible-jar-mtime.patch @@ -0,0 +1,25 @@ +--- libreadline-java-0.8.3/Makefile 2024-09-24 11:56:26.680687376 +0200 ++++ libreadline-java-0.8.3/Makefile 2024-09-24 12:01:12.635966813 +0200 +@@ -163,10 +163,20 @@ + world : jar build-native + + jar: build-java +- cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar -cvmf ../$(MF_STUB) ../$(JAR) * ++ cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar \ ++ --date="$$(date -u -d @$${SOURCE_DATE_EPOCH:-$$(date +%s)} +%Y-%m-%dT%H:%M:%SZ)" \ ++ --create \ ++ --verbose \ ++ --manifest=../$(MF_STUB) \ ++ --file=../$(JAR) * + + $(JAR): +- cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar -cvmf ../$(MF_STUB) ../$(JAR) * ++ cd $(BUILDDIR) ; $(JAVA_HOME)/bin/jar \ ++ --date="$$(date -u -d @$${SOURCE_DATE_EPOCH:-$$(date +%s)} +%Y-%m-%dT%H:%M:%SZ)" \ ++ --create \ ++ --verbose \ ++ --manifest=../$(MF_STUB) \ ++ --file=../$(JAR) * + + build-java: $(BUILDDIR) + cd src ; $(MAKE) JAVAC="$(JAVAC)" JC_FLAGS="$(JC_FLAGS)" \ diff --git a/libreadline-java.changes b/libreadline-java.changes new file mode 100644 index 0000000..d49a09f --- /dev/null +++ b/libreadline-java.changes @@ -0,0 +1,218 @@ +------------------------------------------------------------------- +Tue Sep 24 10:04:54 UTC 2024 - Fridrich Strba + +- Added patch: + * libreadline-java-reproducible-jar-mtime.patch + + use SOURCE_DATE_EPOCH for reproducible jar modification times + +------------------------------------------------------------------- +Mon May 6 15:58:26 UTC 2024 - Fridrich Strba + +- Added patch: + * libreadline-java-gcc14.patch + + cast out constness and fix build with gcc14 + +------------------------------------------------------------------- +Wed Feb 21 14:36:44 UTC 2024 - Fridrich Strba + +- Use %patch -P N instead of deprecated %patchN. + +------------------------------------------------------------------- +Mon May 9 14:32:42 UTC 2022 - David Anes + +- Version bump to release 0.8.3: + * added support for building with newer JDKs. + +- Updated patches: + * Rebased: libreadline-java-0.8.0-jdk10.patch + * Removed: libreadline-java-0.8.0-sourcetarget.patch + +------------------------------------------------------------------- +Fri Mar 18 16:39:52 UTC 2022 - Fridrich Strba + +- Modified patch: + * libreadline-java-0.8.0-sourcetarget.patch + + Build with source/target levels 8 + +------------------------------------------------------------------- +Fri Aug 3 07:26:14 UTC 2018 - tchvatal@suse.com + +- Version bump to 0.8.2: + * bugfix: using tab completion would crash the virtual machine + * getVar()/setVar() (Bernhard) + * unicode support (Andrew) + * added bats test case and running on travis ci (Andrew) + * various build fixes (Andrew) +- Update URL/Source to point to current location +- Refresh patches: + * libreadline-java-0.8.0-jdk10.patch + * libreadline-java-0.8.0-sourcetarget.patch + * libreadline-java-ncurses.patch +- Remove upstream merged: + * libreadline-java-0.8.0-missing-return-type.patch + +------------------------------------------------------------------- +Mon Dec 18 10:57:33 UTC 2017 - fstrba@suse.com + +- Added patch: + * libreadline-java-0.8.0-jdk10.patch + - Allow building with jdk10 that does not have javah + * libreadline-java-0.8.0-sourcetarget.patch + - Build with source and target level 1.6 +- Run fdupes on documentation + +------------------------------------------------------------------- +Mon Sep 18 12:42:17 UTC 2017 - fstrba@suse.com + +- Removed patch: + * libreadline-java-0.8.0-doclint.patch + - Not needed since we disabled globally doclint by default + +------------------------------------------------------------------- +Fri Sep 8 12:09:01 UTC 2017 - fstrba@suse.com + +- Added patch: + * libreadline-java-0.8.0-doclint.patch + - Fix build with jdk9 whose javadoc is more picky + +------------------------------------------------------------------- +Fri Jun 9 11:06:12 UTC 2017 - tchvatal@suse.com + +- Require java 1.6.0 or newer to build as gcj won't compile us + +------------------------------------------------------------------- +Tue Jul 8 10:14:12 UTC 2014 - tchvatal@suse.com + +- Cleanup bit more. + +------------------------------------------------------------------- +Fri Jun 27 13:39:34 UTC 2014 - tchvatal@suse.com + +- Fix build on sle11 + +------------------------------------------------------------------- +Fri Jun 27 12:06:27 UTC 2014 - tchvatal@suse.com + +- Cleanup with spec-cleaner. + +------------------------------------------------------------------- +Fri Sep 13 09:12:04 UTC 2013 - mvyskocil@suse.com + +- add javapackages-tools to buildrequires + +------------------------------------------------------------------- +Wed Jun 20 13:29:19 UTC 2012 - mvyskocil@suse.cz + +- do not build with gcc java +- use libedit instead of gnu readline (licensing issues) + +------------------------------------------------------------------- +Thu Jan 12 19:48:34 UTC 2012 - andreas.stieger@gmx.de + +- remove libreadline-java-java14compat.patch + ( -C -ftarget=1.4 not supported by current javac ) + +------------------------------------------------------------------- +Mon Feb 1 11:49:09 UTC 2010 - jengelh@medozas.de + +- package baselibs.conf + +------------------------------------------------------------------- +Thu Jul 31 14:19:28 CEST 2008 - anosek@suse.cz + +- added %{_javadocdir} to the %files section + +------------------------------------------------------------------- +Thu Apr 10 12:54:45 CEST 2008 - ro@suse.de + +- added baselibs.conf file to build xxbit packages + for multilib support + +------------------------------------------------------------------- +Wed Jan 23 14:34:34 CET 2008 - mvyskocil@suse.cz + +- fixed beta build + +------------------------------------------------------------------- +Tue May 29 18:40:54 CEST 2007 - dbornkessel@suse.de + +- added gjdoc and fastjar to BuildRequires + +------------------------------------------------------------------- +Wed May 2 11:53:44 CEST 2007 - dbornkessel@suse.de + +- added unzip to BuildRequires + +------------------------------------------------------------------- +Wed Feb 14 19:25:27 CET 2007 - dbornkessel@suse.de + +- added missing return type where missing (Bug #237944) + +------------------------------------------------------------------- +Thu Dec 14 18:16:24 CET 2006 - jsmeix@suse.de + +- Removed xml-commons-apis from BuildRequires because xerces-j2 + already provides xml-commons-apis but xerces-j2 would be + deinstalled when rpm installs xml-commons-apis after xerces-j2 + (which is rpm standard behaviour in this case) but without + xerces-j2 the RPM capabilities jaxp_parser_impl and + xml-commons-resolver are no longer provided in the + installed system. + +------------------------------------------------------------------- +Tue Sep 26 14:29:17 CEST 2006 - skh@suse.de + +- don't use icecream +- use -source 1.4 and -target 1.4 for build with java 1.5 + +------------------------------------------------------------------- +Wed Jan 25 21:37:42 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Fri Nov 25 13:59:11 CET 2005 - jsmeix@suse.de + +- Replaced {_jnidir} by {_jnidir}-ext + +------------------------------------------------------------------- +Wed Aug 17 14:15:06 CEST 2005 - uli@suse.de + +- fixed to build on lib64 archs + +------------------------------------------------------------------- +Thu Jul 28 16:45:50 CEST 2005 - jsmeix@suse.de + +- Adjustments in the spec file. + +------------------------------------------------------------------- +Mon Jul 18 16:50:15 CEST 2005 - jsmeix@suse.de + +- Current version 0.8.0 from JPackage.org + +------------------------------------------------------------------- +Wed Jul 13 14:44:07 CEST 2005 - uli@suse.de + +- lib64tified (fixes s390x) + +------------------------------------------------------------------- +Thu Nov 18 01:58:20 CET 2004 - ro@suse.de + +- fixed file list + +------------------------------------------------------------------- +Wed Sep 15 16:02:52 CEST 2004 - skh@suse.de + +- Fix Requires (remove fixed dependency on readline 4.3 and enable rpm + dependency check) + +------------------------------------------------------------------- +Wed Sep 8 09:27:56 CEST 2004 - skh@suse.de + +- Fix PreRequire + +------------------------------------------------------------------- +Thu Sep 2 17:24:55 CEST 2004 - skh@suse.de + +- Initial package created with version 0.8.0 (JPackage 1.5) + diff --git a/libreadline-java.spec b/libreadline-java.spec new file mode 100644 index 0000000..f4bcfd3 --- /dev/null +++ b/libreadline-java.spec @@ -0,0 +1,104 @@ +# +# spec file for package libreadline-java +# +# Copyright (c) 2024 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/ +# + + +%global java_home %{_jvmdir}/java +%global make make +Name: libreadline-java +Version: 0.8.3 +Release: 0 +Summary: Java Wrapper for the EditLine Library +License: LGPL-2.1-or-later +Group: Development/Libraries/Java +URL: https://github.com/aclemons/java-readline +Source0: https://github.com/aclemons/java-readline/releases/download/v%{version}/%{name}-%{version}-src.tar.gz +Source1: baselibs.conf +Patch0: libreadline-java-ncurses.patch +Patch1: libreadline-java-libdir.patch +Patch3: libreadline-java-0.8.0-jdk10.patch +Patch4: libreadline-java-gcc14.patch +Patch10: libreadline-java-reproducible-jar-mtime.patch +BuildRequires: fdupes +BuildRequires: java-devel >= 1.8 +BuildRequires: javapackages-tools +BuildRequires: libedit-devel >= 2.9 +BuildRequires: ncurses-devel +BuildRequires: zlib-devel +Requires: java +Requires: libedit >= 2.9 +Provides: gnu.readline +Provides: java_readline + +%description +libreadline-java provides Java bindings for libedit though a JNI +wrapper. + +%package javadoc +Summary: Javadoc for libreadline-java +Group: Development/Libraries/Java + +%description javadoc +libreadline-java provides Java bindings for libedit though a JNI +wrapper. This package contains the javadoc documentation for it. + +%prep +%setup -q +%patch -P 0 +%patch -P 1 +%patch -P 3 -p1 +%patch -P 4 -p1 +%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 17}%{!?pkg_vcmp:0} +%patch -P 10 -p1 +%endif + +find . -name "*.jar" -exec rm -f {} \; +sed -i 's|@LIBDIR@|%{_libdir}|' src/org/gnu/readline/Readline.java + +%build +export JAVA_HOME=%{java_home} +export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH +%make CFLAGS="%{optflags} -fPIC -DPOSIX" T_LIBS=JavaEditline -j1 +%make apidoc -j1 + +# fix debuginfo package +rm -f org test +for dir in org test +do + ln -s src/$dir +done + +%install +mkdir -p %{buildroot}%{_libdir}/%{name} +install -m 644 %{name}.jar \ + %{buildroot}%{_libdir}/%{name}/%{name}.jar +install -m 755 libJavaEditline.so %{buildroot}%{_libdir}/%{name} + +# javadoc +mkdir -p %{buildroot}%{_javadocdir}/%{name} +cp -a api/* %{buildroot}%{_javadocdir}/%{name} +%fdupes -s %{buildroot}%{_javadocdir}/%{name} + +%files +%license COPYING.LIB +%doc NEWS README README.1st VERSION +%dir %{_libdir}/%{name} +%attr(-,root,root) %{_libdir}/%{name}/* + +%files javadoc +%doc %{_javadocdir}/%{name} + +%changelog