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
|
|
|
#
|
2019-02-01 12:24:22 +01:00
|
|
|
# Copyright (c) 2019 SUSE LINUX 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.
|
|
|
|
|
2018-09-14 14:55:33 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-15 23:51:10 +01:00
|
|
|
#
|
|
|
|
|
2008-02-22 01:17:11 +01:00
|
|
|
|
2017-12-07 20:58:59 +01:00
|
|
|
%define gccbinsuffix %(rpm -q --qf "-%%{VERSION}" gcc-java)
|
2014-07-04 13:18:25 +02:00
|
|
|
%define real_name antlr
|
2007-01-15 23:51:10 +01:00
|
|
|
Name: antlr-bootstrap
|
2014-07-04 13:18:25 +02:00
|
|
|
Version: 2.7.7
|
|
|
|
Release: 0
|
2007-01-15 23:51:10 +01:00
|
|
|
Summary: Antlr for bootstrapping purposes
|
2017-09-20 19:43:08 +02:00
|
|
|
License: BSD-3-Clause AND SUSE-Public-Domain
|
2012-10-31 11:25:47 +01:00
|
|
|
Group: Development/Libraries/Java
|
2018-07-20 17:28:46 +02:00
|
|
|
URL: http://www.antlr.org
|
2007-01-15 23:51:10 +01:00
|
|
|
Source0: antlr-%{version}.tar.bz2
|
|
|
|
Source1: manifest.antlr
|
2018-05-15 08:05:28 +02:00
|
|
|
BuildRequires: java-devel >= 1.8
|
2008-01-30 17:39:47 +01:00
|
|
|
BuildArch: noarch
|
2007-01-15 23:51:10 +01:00
|
|
|
|
2014-07-04 13:18:25 +02:00
|
|
|
%description
|
2007-01-15 23:51:10 +01:00
|
|
|
This antlr package is used for bootstrapping purposes only.
|
|
|
|
|
2014-07-04 13:18:25 +02:00
|
|
|
%prep
|
|
|
|
%setup -q -n %{real_name}-%{version}
|
2017-12-07 20:58:59 +01:00
|
|
|
find | grep "\(ShowString.java$\|StreamConverter.java$\)" && exit 42 || :
|
2007-01-15 23:51:10 +01:00
|
|
|
|
2014-07-04 13:18:25 +02:00
|
|
|
%build
|
2019-08-02 09:33:04 +02:00
|
|
|
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
|
2007-01-15 23:51:10 +01:00
|
|
|
#>>> some useful functions ... used throughout bootstrap packages
|
|
|
|
# variables:
|
|
|
|
TARGET_DIR=`pwd`
|
|
|
|
CLASSPATH_ORIG="$CLASSPATH"
|
|
|
|
#>>> delete binary file and files not needed
|
|
|
|
function delBinaryFiles() {
|
|
|
|
set +x
|
|
|
|
echo deleting binary files ...
|
2019-02-01 12:24:22 +01:00
|
|
|
find . -name "*.class" -o -name "*.jar" -o -name "*DELETED-BY-PACKAGER*" -delete
|
2007-01-15 23:51:10 +01:00
|
|
|
set -x
|
|
|
|
}
|
2017-09-21 12:59:26 +02:00
|
|
|
#>>> make %{?_smp_mflags} a string with all jar files found in target folder that can be used for a classpath string
|
2007-01-15 23:51:10 +01:00
|
|
|
# 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
|
|
|
|
function compileFiles() {
|
|
|
|
mkTargetClasspath
|
|
|
|
set +x
|
|
|
|
COMPILE_CLASSPATH_PATH=.:${JAR_CLASSPATH}
|
2019-02-01 12:24:22 +01:00
|
|
|
echo -e "$COMPILER_COMMAND $COMPILE_CLASSPATH_PATH $(find . -name "*.java" | xargs)"
|
|
|
|
$COMPILER_COMMAND $COMPILE_CLASSPATH_PATH $(find . -name "*.java" | xargs)
|
|
|
|
# check for errors
|
|
|
|
if [ $? != 0 ]
|
|
|
|
then
|
|
|
|
echo ERROR
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
echo done
|
2007-01-15 23:51:10 +01:00
|
|
|
set -x
|
|
|
|
}
|
2017-09-21 12:59:26 +02:00
|
|
|
#>>> make %{?_smp_mflags} jar archive
|
2007-01-15 23:51:10 +01:00
|
|
|
# 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*" |\
|
2017-10-09 11:58:01 +02:00
|
|
|
xargs jar cfm ${1}.jar manifest.* ;
|
2007-01-15 23:51:10 +01:00
|
|
|
mv ${1}.jar $TARGET_DIR
|
|
|
|
}
|
2018-05-15 08:05:28 +02:00
|
|
|
COMPILER_COMMAND="javac -source 8 -target 8 -cp "
|
2007-01-15 23:51:10 +01:00
|
|
|
delBinaryFiles
|
|
|
|
mkdir src
|
|
|
|
mv antlr src
|
|
|
|
cd src
|
|
|
|
cp %{SOURCE1} .
|
|
|
|
compileFiles
|
|
|
|
mkJar %{name}
|
|
|
|
delBinaryFiles
|
|
|
|
|
|
|
|
%install
|
2014-07-04 13:18:25 +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
|
|
|
|
|
|
|
%files
|
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
|