From 0b51a4a2f91e951433801464ac038d0ba9e6ec370833bc4d0b6c8a6d247d711d Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 3 Mar 2008 15:59:28 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/aelfred?expand=0&rev=3 --- aelfred-icedtea-build.patch | 278 ++++++++++++++++++++++++++++++++++++ aelfred.changes | 6 + aelfred.spec | 79 +++++++--- 3 files changed, 340 insertions(+), 23 deletions(-) create mode 100644 aelfred-icedtea-build.patch diff --git a/aelfred-icedtea-build.patch b/aelfred-icedtea-build.patch new file mode 100644 index 0000000..5eb3aa0 --- /dev/null +++ b/aelfred-icedtea-build.patch @@ -0,0 +1,278 @@ +--- src/com/microstar/xml/XmlParser.java ++++ src/com/microstar/xml/XmlParser.java +@@ -1350,7 +1350,7 @@ + { + String name; + int type; +- String enum = null; ++ String enum2 = null; + + // Read the attribute name. + name = readNmtoken(true); +@@ -1362,12 +1362,12 @@ + // Get the string of enumerated values + // if necessary. + if (type == ATTRIBUTE_ENUMERATED || type == ATTRIBUTE_NOTATION) { +- enum = dataBufferToString(); ++ enum2 = dataBufferToString(); + } + + // Read the default value. + requireWhitespace(); +- parseDefault(elementName, name, type, enum); ++ parseDefault(elementName, name, type, enum2); + } + + +@@ -1380,7 +1380,7 @@ + * [57] EnumeratedType ::= NotationType | Enumeration + * *TODO: validate the type!! + */ +- int readAttType () ++ protected int readAttType () + throws java.lang.Exception + { + String typeString; +@@ -1411,7 +1411,7 @@ + * [61] Etoks ::= %Nmtoken (S? '|' S? %Nmtoken)* + * *NOTE: the '(' has already been read. + */ +- void parseEnumeration () ++ protected void parseEnumeration () + throws java.lang.Exception + { + char c; +@@ -1441,7 +1441,7 @@ + * [59] Ntoks ::= %Name (S? '|' S? %Name) + * *NOTE: the 'NOTATION' has already been read + */ +- void parseNotationType () ++ protected void parseNotationType () + throws java.lang.Exception + { + requireWhitespace(); +@@ -1455,7 +1455,7 @@ + * Parse the default value for an attribute. + * [62] Default ::= '#REQUIRED' | '#IMPLIED' | ((%'#FIXED' S)? %AttValue + */ +- void parseDefault (String elementName, String name, int type, String enum) ++ protected void parseDefault (String elementName, String name, int type, String enum2) + throws java.lang.Exception + { + int valueType = ATTRIBUTE_DEFAULT_SPECIFIED; +@@ -1481,7 +1481,7 @@ + value = readLiteral(LIT_CHAR_REF); + context = CONTEXT_DTD; + } +- setAttribute(elementName, name, type, enum, value, valueType); ++ setAttribute(elementName, name, type, enum2, value, valueType); + } + + +@@ -1497,7 +1497,7 @@ + * *NOTE: the '' + * *NOTE: the 'The trick here is that the data stays in the dataBuffer without + * necessarily being converted to a string right away. + */ +- void parsePCData () ++ protected void parsePCData () + throws java.lang.Exception + { + char c; +@@ -1871,7 +1871,7 @@ + * Require whitespace characters. + * [1] S ::= (#x20 | #x9 | #xd | #xa)+ + */ +- void requireWhitespace () ++ protected void requireWhitespace () + throws java.lang.Exception + { + char c = readCh(); +@@ -1886,7 +1886,7 @@ + /** + * Parse whitespace characters, and leave them in the data buffer. + */ +- void parseWhitespace () ++ protected void parseWhitespace () + throws java.lang.Exception + { + char c = readCh(); +@@ -1902,7 +1902,7 @@ + * Skip whitespace characters. + * [1] S ::= (#x20 | #x9 | #xd | #xa)+ + */ +- void skipWhitespace () ++ protected void skipWhitespace () + throws java.lang.Exception + { + // Start with a little cheat. Most of +@@ -1956,7 +1956,7 @@ + * [7] Nmtoken ::= (NameChar)+ + * *NOTE: [6] is implemented implicitly where required. + */ +- String readNmtoken (boolean isName) ++ protected String readNmtoken (boolean isName) + throws java.lang.Exception + { + char c; +@@ -2049,7 +2049,7 @@ + * [9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' + * | "'" ([^%&'] | PEReference | Reference)* "'" + */ +- String readLiteral (int flags) ++ protected String readLiteral (int flags) + throws java.lang.Exception + { + char delim, c; +@@ -2119,7 +2119,7 @@ + * @param inNotation Are we in a notation? + * @return A two-member String array containing the identifiers. + */ +- String[] readExternalIds (boolean inNotation) ++ protected String[] readExternalIds (boolean inNotation) + throws java.lang.Exception + { + char c; +@@ -2154,7 +2154,7 @@ + * @param c The character to test. + * @return true if the character is whitespace. + */ +- final boolean isWhitespace (char c) ++ protected final boolean isWhitespace (char c) + { + switch ((int)c) { + case 0x20: +@@ -2177,7 +2177,7 @@ + /** + * Add a character to the data buffer. + */ +- void dataBufferAppend (char c) ++ protected void dataBufferAppend (char c) + { + // Expand buffer if necessary. + dataBuffer = +@@ -2189,7 +2189,7 @@ + /** + * Add a string to the data buffer. + */ +- void dataBufferAppend (String s) ++ protected void dataBufferAppend (String s) + { + dataBufferAppend(s.toCharArray(), 0, s.length()); + } +@@ -2198,7 +2198,7 @@ + /** + * Append (part of) a character array to the data buffer. + */ +- void dataBufferAppend (char ch[], int start, int length) ++ protected void dataBufferAppend (char ch[], int start, int length) + { + dataBuffer = + (char[])extendArray(dataBuffer, dataBuffer.length, +@@ -2213,7 +2213,7 @@ + /** + * Normalise whitespace in the data buffer. + */ +- void dataBufferNormalize () ++ protected void dataBufferNormalize () + { + int i = 0; + int j = 0; +@@ -2256,7 +2256,7 @@ + * @param internFlag true if the contents should be interned. + * @see #intern(char[],int,int) + */ +- String dataBufferToString () ++ protected String dataBufferToString () + { + String s = new String(dataBuffer, 0, dataBufferPos); + dataBufferPos = 0; +@@ -2268,7 +2268,7 @@ + * Flush the contents of the data buffer to the handler, if + * appropriate, and reset the buffer for new input. + */ +- void dataBufferFlush () ++ protected void dataBufferFlush () + throws java.lang.Exception + { + if (dataBufferPos > 0) { +@@ -2297,7 +2297,7 @@ + /** + * Require a string to appear, or throw an exception. + */ +- void require (String delim) ++ protected void require (String delim) + throws java.lang.Exception + { + char ch[] = delim.toCharArray(); +@@ -2310,7 +2310,7 @@ + /** + * Require a character to appear, or throw an exception. + */ +- void require (char delim) ++ protected void require (char delim) + throws java.lang.Exception + { + char c = readCh(); +@@ -2422,7 +2422,7 @@ + * Ensure the capacity of an array, allocating a new one if + * necessary. + */ +- Object extendArray (Object array, int currentSize, int requiredSize) ++ protected Object extendArray (Object array, int currentSize, int requiredSize) + { + if (requiredSize < currentSize) { + return array; diff --git a/aelfred.changes b/aelfred.changes index c99bc90..fd467c1 100644 --- a/aelfred.changes +++ b/aelfred.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 3 10:28:26 CET 2008 - mvyskocil@suse.cz + +- merged with jpackage 1.7 +- allow to build with icedtea + ------------------------------------------------------------------- Fri Mar 30 12:12:00 CEST 2007 - ssommer@suse.de diff --git a/aelfred.spec b/aelfred.spec index 8c5625e..3818552 100644 --- a/aelfred.spec +++ b/aelfred.spec @@ -1,7 +1,7 @@ # # spec file for package aelfred (Version 1.2) # -# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -10,21 +10,37 @@ # norootforbuild +%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}} + Name: aelfred -BuildRequires: ant java2-devel-packages unzip xml-commons-apis %define name aelfred %define version 1.2 %define release 0.a.7jpp %define section free Version: 1.2 -Release: 51 +Release: 177 Summary: Java-based XML parser -License: BSD License and BSD-like -URL: http://www.jpackage.org/ +License: BSD 3-Clause +Url: http://www.jpackage.org/ Source0: http://card4u.fhnon.de/XMLKlassen/microstar-Parser/aelfred.zip +Patch0: aelfred-icedtea-build.patch Group: Development/Libraries/Java -Buildarch: noarch +BuildRequires: ant +BuildRequires: jpackage-utils >= 1.6 +%if ! %{gcj_support} +BuildArch: noarch +%endif BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if %defined suse_version +BuildRequires: java-devel +BuildRequires: unzip +%endif +%if %{gcj_support} +BuildRequires: gnu-crypto +BuildRequires: java-gcj-compat-devel +Requires(post): java-gcj-compat +Requires(postun): java-gcj-compat +%endif %description AElfred is a Java-based XML parser from Microstar Software Ltd. AElfred @@ -37,6 +53,8 @@ non-commercial use. PreReq: coreutils Summary: Java-based XML parser (documentation) Group: Development/Libraries/Java +Requires(post): /bin/rm,/bin/ln +Requires(postun): /bin/rm %description javadoc Javadoc for aelfred. @@ -58,64 +76,76 @@ Demonstrations and samples for aelfred. # remove all binary libs find . -name "*.jar" -exec %__rm -f {} \; find . -name "*.class" -exec %__rm -f {} \; - %__rm -rf HTML/* +%patch0 -b .sav %build export JAVA_HOME=%{java_home} export PATH=%{java_home}/bin:$PATH export CLASSPATH= cd src - %javac -source 1.4 `find . -name \*.java` - %javadoc -source 1.4 -d ../HTML `find . -name \*.java` %install # jar export JAVA_HOME=%{java_home} cd src - %__mkdir_p %{buildroot}%{_javadir} - %jar cvmf /dev/null %{name}.jar -C . com/ - %__cp -a %{name}.jar \ %{buildroot}%{_javadir}/%{name}-%{version}.jar (cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do \ - %__ln_s ${jar} ${jar/-%{version}/}; done) # javadoc - %__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version} - %__cp -a ../HTML/* %{buildroot}%{_javadocdir}/%{name}-%{version} (cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-%{version} %{name}) # data - %__mkdir_p %{buildroot}%{_datadir}/%{name}/Demo - %__cp -a *.class %{buildroot}%{_datadir}/%{name}/Demo +%if %{gcj_support} +export CLASSPATH=$(build-classpath gnu-crypto) +%{_bindir}/aot-compile-rpm +%endif %clean -rm -rf $RPM_BUILD_ROOT +%__rm -rf %{buildroot} %post javadoc - %__rm -f %{_javadocdir}/%{name} - %__ln_s %{name}-%{version} %{_javadocdir}/%{name} %postun javadoc if [ $1 -eq 0 ]; then %__rm -f %{_javadocdir}/%{name} fi +%if %{gcj_support} + +%post +if [ -x %{_bindir}/rebuild-gcj-db ] +then + %{_bindir}/rebuild-gcj-db +fi +%endif +%if %{gcj_support} + +%postun +if [ -x %{_bindir}/rebuild-gcj-db ] +then + %{_bindir}/rebuild-gcj-db +fi +%endif %files %defattr(0644,root,root,0755) %doc README.txt FILES %{_javadir}/* %dir %{_datadir}/%{name} +%if %{gcj_support} +%dir %attr(-,root,root) %{_libdir}/gcj/%{name} +%attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}-%{version}.jar.* +%endif %files javadoc %defattr(0644,root,root,0755) @@ -128,9 +158,12 @@ fi %{_datadir}/%{name}/Demo %changelog -* Fri Mar 30 2007 - ssommer@suse.de +* Mon Mar 03 2008 mvyskocil@suse.cz +- merged with jpackage 1.7 +- allow to build with icedtea +* Fri Mar 30 2007 ssommer@suse.de - add unzip to BuildRequires -* Wed Jan 25 2006 - mls@suse.de +* Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires -* Wed Oct 19 2005 - jsmeix@suse.de +* Wed Oct 19 2005 jsmeix@suse.de - Current version 1.2 from JPackage.org