2012-10-31 11:25:47 +01:00
|
|
|
# vim:fdm=marker:foldmarker=#>>>,#<<<:foldcolumn=6:
|
2007-01-15 23:51:10 +01:00
|
|
|
#
|
2012-10-31 11:25:47 +01:00
|
|
|
# spec file for package antlr-bootstrap
|
2007-01-15 23:51:10 +01:00
|
|
|
#
|
2013-07-12 14:37:49 +02:00
|
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-01-15 23:51:10 +01:00
|
|
|
#
|
2009-06-19 00:51:30 +02:00
|
|
|
# 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.
|
|
|
|
|
2007-01-15 23:51:10 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2008-02-22 01:17:11 +01:00
|
|
|
|
2007-01-15 23:51:10 +01:00
|
|
|
Name: antlr-bootstrap
|
|
|
|
%define non_bootstrap_name antlr
|
|
|
|
BuildRequires: ecj-bootstrap >= 0.570
|
2012-10-31 11:25:47 +01:00
|
|
|
BuildRequires: fastjar
|
|
|
|
BuildRequires: gcc-gij
|
|
|
|
BuildRequires: gcc-java
|
|
|
|
BuildRequires: unzip
|
|
|
|
BuildRequires: zip
|
2007-01-15 23:51:10 +01:00
|
|
|
%define real_name antlr
|
|
|
|
Summary: Antlr for bootstrapping purposes
|
2012-10-31 11:25:47 +01:00
|
|
|
License: BSD-3-Clause and SUSE-Public-Domain
|
|
|
|
Group: Development/Libraries/Java
|
2008-04-25 14:50:33 +02:00
|
|
|
Version: 2.7.7
|
2012-10-31 11:25:47 +01:00
|
|
|
Release: 0
|
2008-01-30 17:39:47 +01:00
|
|
|
Url: http://www.antlr.org
|
2007-01-15 23:51:10 +01:00
|
|
|
Source0: antlr-%{version}.tar.bz2
|
|
|
|
Source1: manifest.antlr
|
|
|
|
# files for the source package
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2008-01-30 17:39:47 +01:00
|
|
|
BuildArch: noarch
|
2007-01-15 23:51:10 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
This antlr package is used for bootstrapping purposes only.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
This antlr package is used for bootstrapping purposes only.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
#<<< package descriptions end
|
|
|
|
#>>>
|
|
|
|
# antlr
|
|
|
|
%setup -n %{real_name}-%{version}
|
|
|
|
find | grep "\(ShowString.java$\|StreamConverter.java$\)" && exit 42
|
|
|
|
#<<<
|
|
|
|
#>>> %build
|
|
|
|
|
|
|
|
%build
|
|
|
|
#>>> some useful functions ... used throughout bootstrap packages
|
|
|
|
# variables:
|
|
|
|
TARGET_DIR=`pwd`
|
|
|
|
CLASSPATH_ORIG="$CLASSPATH"
|
|
|
|
LIB_GCJ="`ls %{_javadir}/libgcj-*.jar`"
|
|
|
|
#>>> delete binary file and files not needed
|
|
|
|
function delBinaryFiles() {
|
|
|
|
set +x
|
|
|
|
echo deleting binary files ...
|
|
|
|
for file in `find . -name "*.class" -o -name "*.jar" -o -name "*DELETED-BY-PACKAGER*"`
|
|
|
|
do
|
|
|
|
rm -rf $file
|
|
|
|
done
|
|
|
|
set -x
|
|
|
|
}
|
|
|
|
#<<<
|
|
|
|
#>>> 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
|
|
|
|
function mkTargetClasspath() {
|
|
|
|
set +x
|
|
|
|
JAR_CLASSPATH=""
|
|
|
|
for file in `find %{_javadir} -name "*.jar"`
|
|
|
|
do
|
|
|
|
JAR_CLASSPATH=$file:$JAR_CLASSPATH
|
|
|
|
done
|
|
|
|
set -x
|
|
|
|
}
|
|
|
|
#<<<
|
|
|
|
#>>> compiles all *.java file in the current directory tree
|
|
|
|
# uses mkTargetClasspath for CLASSPATH variable
|
|
|
|
# uses LIB_GCJ for CLASSPATH
|
|
|
|
function compileFiles() {
|
|
|
|
mkTargetClasspath
|
|
|
|
set +x
|
|
|
|
COMPILE_CLASSPATH_PATH=.:${JAR_CLASSPATH}
|
|
|
|
echo using: $COMPILER_COMMAND $COMPILE_CLASSPATH_PATH $$file
|
|
|
|
for file in `find . -name "*.java"`
|
|
|
|
do
|
|
|
|
echo -e "$COMPILER_COMMAND $COMPILE_CLASSPATH_PATH $file ... \c"
|
|
|
|
$COMPILER_COMMAND $COMPILE_CLASSPATH_PATH $file
|
|
|
|
# check for errors
|
|
|
|
if [ $? != 0 ]
|
|
|
|
then
|
|
|
|
echo ERROR
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
echo done
|
|
|
|
done
|
|
|
|
set -x
|
|
|
|
}
|
|
|
|
#<<<
|
|
|
|
#>>> make jar archive
|
|
|
|
# PARAM#1: name of jar archive (without .jar suffix)
|
|
|
|
# uses $TARGET_DIR to move created jar to
|
|
|
|
function mkJar() {
|
|
|
|
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 ;
|
|
|
|
mv ${1}.jar $TARGET_DIR
|
|
|
|
}
|
|
|
|
#<<<
|
|
|
|
COMPILER_COMMAND="gij -jar %{_javadir}/jdtcore.jar -cp "
|
|
|
|
#<<< end functions
|
|
|
|
delBinaryFiles
|
|
|
|
#>>> antlr
|
|
|
|
mkdir src
|
|
|
|
mv antlr src
|
|
|
|
cd src
|
|
|
|
cp %{SOURCE1} .
|
|
|
|
compileFiles
|
|
|
|
mkJar %{name}
|
|
|
|
delBinaryFiles
|
|
|
|
#<<< end antlr
|
|
|
|
#<<< end %build
|
|
|
|
#>>> %install
|
|
|
|
|
|
|
|
%install
|
2011-07-25 10:38:34 +02:00
|
|
|
%{__install} -d -m 0755 %{buildroot}%{_javadir}
|
|
|
|
%{__install} -m 0644 %{name}.jar %{buildroot}%{_javadir}/
|
|
|
|
%{__ln_s} -f %{_javadir}/%{name}.jar %{buildroot}/%{_javadir}/%{name}-%{version}.jar
|
2007-01-15 23:51:10 +01:00
|
|
|
#<<<
|
|
|
|
|
|
|
|
%clean
|
2011-07-25 10:38:34 +02:00
|
|
|
%{__rm} -rf %{buildroot}
|
2007-01-15 23:51:10 +01:00
|
|
|
#>>> files
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
#%dir %{_javadir}
|
2011-07-25 10:38:34 +02:00
|
|
|
%{_javadir}/%{name}*.jar
|
2007-01-15 23:51:10 +01:00
|
|
|
#<<<
|
|
|
|
|
2007-05-04 11:03:51 +02:00
|
|
|
%changelog
|