Accepting request 240318 from Java:packages

javapackages updates submission

OBS-URL: https://build.opensuse.org/request/show/240318
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/antlr?expand=0&rev=30
This commit is contained in:
Stephan Kulow 2014-07-17 15:31:22 +00:00 committed by Git OBS Bridge
commit 96ac4c078c
4 changed files with 49 additions and 87 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jul 4 11:17:30 UTC 2014 - tchvatal@suse.com
- Cleanup a bit with spec-cleaner
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 17 13:14:27 UTC 2013 - schwab@suse.de Wed Jul 17 13:14:27 UTC 2013 - schwab@suse.de

View File

@ -1,4 +1,3 @@
# vim:fdm=marker:foldmarker=#>>>,#<<<:foldcolumn=6:
# #
# spec file for package antlr-bootstrap # spec file for package antlr-bootstrap
# #
@ -17,44 +16,31 @@
# #
%define real_name antlr
Name: antlr-bootstrap Name: antlr-bootstrap
%define non_bootstrap_name antlr Version: 2.7.7
Release: 0
Summary: Antlr for bootstrapping purposes
License: BSD-3-Clause and SUSE-Public-Domain
Group: Development/Libraries/Java
Url: http://www.antlr.org
Source0: antlr-%{version}.tar.bz2
Source1: manifest.antlr
BuildRequires: ecj-bootstrap >= 0.570 BuildRequires: ecj-bootstrap >= 0.570
BuildRequires: fastjar BuildRequires: fastjar
BuildRequires: gcc-gij BuildRequires: gcc-gij
BuildRequires: gcc-java BuildRequires: gcc-java
BuildRequires: unzip BuildRequires: unzip
BuildRequires: zip BuildRequires: zip
%define real_name antlr
Summary: Antlr for bootstrapping purposes
License: BSD-3-Clause and SUSE-Public-Domain
Group: Development/Libraries/Java
Version: 2.7.7
Release: 0
Url: http://www.antlr.org
Source0: antlr-%{version}.tar.bz2
Source1: manifest.antlr
# files for the source package
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch BuildArch: noarch
%description %description
This antlr package is used for bootstrapping purposes only. This antlr package is used for bootstrapping purposes only.
Authors:
--------
This antlr package is used for bootstrapping purposes only.
%prep %prep
#<<< package descriptions end %setup -q -n %{real_name}-%{version}
#>>>
# antlr
%setup -n %{real_name}-%{version}
find | grep "\(ShowString.java$\|StreamConverter.java$\)" && exit 42 find | grep "\(ShowString.java$\|StreamConverter.java$\)" && exit 42
#<<<
#>>> %build
%build %build
#>>> some useful functions ... used throughout bootstrap packages #>>> some useful functions ... used throughout bootstrap packages
@ -72,7 +58,6 @@ function delBinaryFiles() {
done done
set -x set -x
} }
#<<<
#>>> make a string with all jar files found in target folder that can be used for a classpath string #>>> make a string with all jar files found in target folder that can be used for a classpath string
# string is saved in JAR_CLASSPATH # string is saved in JAR_CLASSPATH
function mkTargetClasspath() { function mkTargetClasspath() {
@ -84,7 +69,6 @@ function mkTargetClasspath() {
done done
set -x set -x
} }
#<<<
#>>> compiles all *.java file in the current directory tree #>>> compiles all *.java file in the current directory tree
# uses mkTargetClasspath for CLASSPATH variable # uses mkTargetClasspath for CLASSPATH variable
# uses LIB_GCJ for CLASSPATH # uses LIB_GCJ for CLASSPATH
@ -107,20 +91,16 @@ function compileFiles() {
done done
set -x set -x
} }
#<<<
#>>> make jar archive #>>> make jar archive
# PARAM#1: name of jar archive (without .jar suffix) # PARAM#1: name of jar archive (without .jar suffix)
# uses $TARGET_DIR to move created jar to # uses $TARGET_DIR to move created jar to
function mkJar() { function mkJar() {
find -name "version.txt" -or -name "*.class" -or -name "*.properties" -or -name "*.rsc" -or -name "*manifest*" |\ find -name "version.txt" -or -name "*.class" -or -name "*.properties" -or -name "*.rsc" -or -name "*manifest*" |\
xargs /usr/bin/fastjar -m manifest.* -cf ${1}.jar ; xargs %{_bindir}/fastjar -m manifest.* -cf ${1}.jar ;
mv ${1}.jar $TARGET_DIR mv ${1}.jar $TARGET_DIR
} }
#<<<
COMPILER_COMMAND="gij -jar %{_javadir}/jdtcore.jar -cp " COMPILER_COMMAND="gij -jar %{_javadir}/jdtcore.jar -cp "
#<<< end functions
delBinaryFiles delBinaryFiles
#>>> antlr
mkdir src mkdir src
mv antlr src mv antlr src
cd src cd src
@ -128,24 +108,14 @@ cp %{SOURCE1} .
compileFiles compileFiles
mkJar %{name} mkJar %{name}
delBinaryFiles delBinaryFiles
#<<< end antlr
#<<< end %build
#>>> %install
%install %install
%{__install} -d -m 0755 %{buildroot}%{_javadir} install -d -m 0755 %{buildroot}%{_javadir}
%{__install} -m 0644 %{name}.jar %{buildroot}%{_javadir}/ install -m 0644 %{name}.jar %{buildroot}%{_javadir}/
%{__ln_s} -f %{_javadir}/%{name}.jar %{buildroot}/%{_javadir}/%{name}-%{version}.jar ln -s -f %{_javadir}/%{name}.jar %{buildroot}/%{_javadir}/%{name}-%{version}.jar
#<<<
%clean
%{__rm} -rf %{buildroot}
#>>> files
%files %files
%defattr(-,root,root) %defattr(-,root,root)
#%dir %{_javadir}
%{_javadir}/%{name}*.jar %{_javadir}/%{name}*.jar
#<<<
%changelog %changelog

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jul 4 11:17:42 UTC 2014 - tchvatal@suse.com
- Cleanup with spec-cleaner and fix the sle11 build properly.
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Apr 30 13:58:14 UTC 2014 - darin@darins.net Wed Apr 30 13:58:14 UTC 2014 - darin@darins.net

View File

@ -17,7 +17,6 @@
%define section free %define section free
Name: antlr Name: antlr
Version: 2.7.7 Version: 2.7.7
Release: 0 Release: 0
@ -25,11 +24,10 @@ Summary: Another Tool for Language Recognition
License: GPL-2.0+ and SUSE-Public-Domain and MIT License: GPL-2.0+ and SUSE-Public-Domain and MIT
Group: Development/Tools/Other Group: Development/Tools/Other
Url: http://www.antlr.org/ Url: http://www.antlr.org/
#Source0: http://www.antlr.org/download/antlr-2.7.4.tar.gz Source0: antlr-%{version}.tar.bz2
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}-build.xml Source1: %{name}-build.xml
Source2: %{name}-script Source2: %{name}-script
Source3: http://www.antlr.org/share/1069557132934/makefile.gcj Source3: makefile.gcj
Source1000: antlr-rpmlintrc Source1000: antlr-rpmlintrc
Patch0: %{name}-jedit.patch Patch0: %{name}-jedit.patch
Patch1: gcc45fix.diff Patch1: gcc45fix.diff
@ -47,12 +45,6 @@ Requires: javapackages-tools
Provides: %{name}-bootstrap = %{version} Provides: %{name}-bootstrap = %{version}
Obsoletes: %{name}-bootstrap < %{version} Obsoletes: %{name}-bootstrap < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%py_requires
# force package arch for SLE_11
%if 0%{?suse_version} == 1110
BuildArch: %{_arch}
%endif
%description %description
ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a
@ -61,12 +53,15 @@ compilers, and translators from grammatical descriptions containing C++
or Java actions (you can use PCCTS 1.xx to generate C-based parsers). or Java actions (you can use PCCTS 1.xx to generate C-based parsers).
# To not introduce arch dependent java package, lets have this in separate subpackage # To not introduce arch dependent java package, lets have this in separate subpackage
%package java %package java
Summary: ANother Tool for Language Recognition (Manual) Summary: ANother Tool for Language Recognition (Manual)
Group: Development/Tools/Other Group: Development/Tools/Other
Requires: java >= 1.6.0 Requires: java >= 1.6.0
Provides: file:/%{_javadir}/%{name}.jar Provides: file:/%{_javadir}/%{name}.jar
%if 0%{?suse_version} > 1200
BuildArch: noarch BuildArch: noarch
%endif
%description java %description java
ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a
@ -79,7 +74,9 @@ This package provides the Java runtime for antlr
%package manual %package manual
Summary: ANother Tool for Language Recognition (Manual) Summary: ANother Tool for Language Recognition (Manual)
Group: Development/Tools/Other Group: Development/Tools/Other
%if 0%{?suse_version} > 1200
BuildArch: noarch BuildArch: noarch
%endif
%description manual %description manual
ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a
@ -92,8 +89,9 @@ This package provides the manual and examples for antlr.
%package javadoc %package javadoc
Summary: ANother Tool for Language Recognition (Java Documentation) Summary: ANother Tool for Language Recognition (Java Documentation)
Group: Development/Tools/Other Group: Development/Tools/Other
PreReq: coreutils %if 0%{?suse_version} > 1200
BuildArch: noarch BuildArch: noarch
%endif
%description javadoc %description javadoc
ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a
@ -121,7 +119,6 @@ of antlr
Summary: ANother Tool for Language Recognition (python runtime) Summary: ANother Tool for Language Recognition (python runtime)
Group: Development/Tools/Other Group: Development/Tools/Other
Requires: antlr Requires: antlr
%py_requires
%description -n python-%{name} %description -n python-%{name}
Python support for generating your Lexers, Parsers and TreeParsers in Python. Python support for generating your Lexers, Parsers and TreeParsers in Python.
@ -135,29 +132,24 @@ Haefelinger and Marq Kole.
%setup -q %setup -q
# remove all binary libs # remove all binary libs
find . -name "*.jar" -exec rm -f {} \; find . -name "*.jar" -exec rm -f {} \;
%patch0 -p0 %patch0
cp -p %{SOURCE1} build.xml cp -p %{SOURCE1} build.xml
#Fix the source so that it compiles with GCC 4.5 #Fix the source so that it compiles with GCC 4.5
%patch1 -p1 %patch1 -p1
#Ensure that the manuals are installed in the correct openSUSE docpath #Ensure that the manuals are installed in the correct openSUSE docpath
%patch2 -p0 %patch2
# check for license problematic files: # check for license problematic files:
find | grep "\(ShowString.java$\|StreamConverter.java$\)" && exit 42 find | grep "\(ShowString.java$\|StreamConverter.java$\)" && exit 42
%build %build
ant -Dj2se.apidoc=%{_javadocdir}/java ant \
-Dj2se.apidoc=%{_javadocdir}/java \
-Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5
%configure %configure
make make -j1
%py_compile lib/python/antlr %py_compile lib/python/antlr
%install %install
# % {makeinstall}
# The upstream make install just installs a files to more or less random location
# instead of fixing it, let's install it in %%install section
%if 0%{?suse_version} == 1110
export NO_BRP_CHECK_BYTECODE_VERSION=true
%endif
#### jars ### #### jars ###
install -d -m 0755 %{buildroot}%{_javadir} install -d -m 0755 %{buildroot}%{_javadir}
cp -a work/lib/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar cp -a work/lib/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
@ -191,16 +183,6 @@ install -m 0644 lib/cpp/%{name}/*hpp %{buildroot}%{_includedir}/%{name}
find examples -type f | xargs chmod 0644 find examples -type f | xargs chmod 0644
%fdupes -s examples %fdupes -s examples
%clean
rm -rf %{buildroot}
%check
# % {__make} check
# % post -p /sbin/ldconfig
# % postun -p /sbin/ldconfig
%files %files
%defattr(0644,root,root,0755) %defattr(0644,root,root,0755)
%doc LICENSE.txt README.txt CHANGES.txt %doc LICENSE.txt README.txt CHANGES.txt
@ -233,6 +215,6 @@ rm -rf %{buildroot}
%dir %{_datadir}/%{name}-%{version} %dir %{_datadir}/%{name}-%{version}
%{_datadir}/%{name}-%{version}/*py %{_datadir}/%{name}-%{version}/*py
%{_datadir}/%{name}-%{version}/*pyc %{_datadir}/%{name}-%{version}/*pyc
%py_sitedir/%{name} %{py_sitedir}/%{name}
%changelog %changelog