2009-05-19 04:38:03 +02:00
|
|
|
#
|
2013-01-29 10:36:32 +01:00
|
|
|
# spec file for package java-cup
|
2009-05-19 04:38:03 +02:00
|
|
|
#
|
2022-01-11 15:56:58 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2009-05-19 04:38:03 +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.
|
|
|
|
|
2019-02-01 17:58:43 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2009-05-19 04:38:03 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2013-08-29 09:58:59 +02:00
|
|
|
%global _without_bootstrap 1
|
2022-01-11 15:56:58 +01:00
|
|
|
%define cvs_version 11b
|
2009-05-19 04:38:03 +02:00
|
|
|
%define real_name java-cup
|
2022-01-11 15:56:58 +01:00
|
|
|
%define git_hash d69c832
|
|
|
|
%define git_date 20210814
|
2022-03-09 09:58:04 +01:00
|
|
|
%define compat_name java_cup
|
|
|
|
%define compat_version 9e
|
2017-09-15 13:18:18 +02:00
|
|
|
%bcond_with bootstrap
|
2009-05-19 04:38:03 +02:00
|
|
|
Name: java-cup
|
|
|
|
Version: 0.11
|
2013-01-29 10:36:32 +01:00
|
|
|
Release: 0
|
2009-05-19 04:38:03 +02:00
|
|
|
Summary: LALR Parser Generator in Java
|
2012-06-11 07:28:58 +02:00
|
|
|
License: HPND
|
2013-01-29 10:36:32 +01:00
|
|
|
Group: Development/Libraries/Java
|
2022-01-11 15:56:58 +01:00
|
|
|
URL: http://www2.cs.tum.edu/projects/cup/
|
|
|
|
Source0: %{real_name}-%{git_hash}.tar.xz
|
|
|
|
Source1: %{real_name}-generated-files.tar.xz
|
2022-03-09 09:58:04 +01:00
|
|
|
Source2: https://www.cs.princeton.edu/~appel/modern/java/CUP/%{compat_name}_v%{compat_version}.tar.gz
|
2022-01-11 15:56:58 +01:00
|
|
|
Source100: java-cup-nogit.patch.in
|
|
|
|
Patch0: java-cup-no-classpath-in-manifest.patch
|
|
|
|
Patch1: java-cup-java8.patch
|
2009-05-19 04:38:03 +02:00
|
|
|
Patch2: java-cup-no-cup-no-jflex.patch
|
|
|
|
Patch3: java-cup-classpath.patch
|
|
|
|
BuildRequires: ant
|
2017-09-15 13:18:18 +02:00
|
|
|
BuildRequires: java-devel
|
2022-01-11 15:56:58 +01:00
|
|
|
BuildRequires: javapackages-tools
|
2010-11-15 17:54:00 +01:00
|
|
|
BuildRequires: xml-commons-apis-bootstrap
|
|
|
|
BuildRequires: xml-commons-resolver-bootstrap
|
2022-01-11 15:56:58 +01:00
|
|
|
#!BuildIgnore: xalan-j2
|
|
|
|
#!BuildIgnore: xerces-j2
|
|
|
|
#!BuildIgnore: xml-commons-apis
|
|
|
|
#!BuildIgnore: xml-commons-resolver
|
2009-05-19 04:38:03 +02:00
|
|
|
Obsoletes: java_cup < %{version}-%{release}
|
|
|
|
Provides: java_cup = %{version}-%{release}
|
|
|
|
BuildArch: noarch
|
2022-01-12 11:20:46 +01:00
|
|
|
%if %{without bootstrap}
|
2017-09-15 13:18:18 +02:00
|
|
|
BuildRequires: java-cup-bootstrap
|
2022-01-11 15:56:58 +01:00
|
|
|
BuildRequires: javapackages-local
|
2022-01-12 11:38:54 +01:00
|
|
|
BuildRequires: jflex-bootstrap
|
2013-08-29 09:58:59 +02:00
|
|
|
Conflicts: java-cup-bootstrap
|
|
|
|
%else
|
|
|
|
Conflicts: java-cup
|
|
|
|
%endif
|
|
|
|
|
2009-05-19 04:38:03 +02:00
|
|
|
%description
|
|
|
|
java-cup is a LALR Parser Generator in Java. With v0.11, you can: *
|
|
|
|
use CUP in an Ant-Target
|
|
|
|
|
|
|
|
* start CUP by a simple command like java -jar java-cup-11a.jar
|
|
|
|
myGrammar.cup
|
|
|
|
|
|
|
|
* use generic parametrized classes (since Java 1.5) as datatypes for
|
|
|
|
non terminals and terminals
|
|
|
|
|
|
|
|
* have Your own symbol classes
|
|
|
|
|
2022-01-12 11:20:46 +01:00
|
|
|
%if %{without bootstrap}
|
2009-05-19 04:38:03 +02:00
|
|
|
%package manual
|
|
|
|
Summary: LALR Parser Generator in Java
|
|
|
|
Group: Development/Libraries/Java
|
|
|
|
|
|
|
|
%description manual
|
|
|
|
java-cup is a LALR Parser Generator in Java. With v0.11, you can: *
|
|
|
|
use CUP in an Ant-Target
|
|
|
|
|
|
|
|
* start CUP by a simple command like java -jar java-cup-11a.jar
|
|
|
|
myGrammar.cup
|
|
|
|
|
|
|
|
* use generic parametrized classes (since Java 1.5) as datatypes for
|
|
|
|
non
|
|
|
|
|
|
|
|
* terminals and terminals
|
|
|
|
|
|
|
|
* have Your own symbol classes
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%prep
|
2022-01-11 15:56:58 +01:00
|
|
|
%setup -q -n %{real_name}-%{git_hash}
|
|
|
|
cat %{SOURCE100} | sed 's#@GIT_HASH@#%{git_hash}#g' | sed 's#@GIT_DATE@#%{git_date}#g' | patch -p1 -u -l
|
|
|
|
%patch0 -p1
|
2009-05-19 04:38:03 +02:00
|
|
|
%patch1 -p1
|
2022-01-12 11:20:46 +01:00
|
|
|
%if %{with bootstrap}
|
2022-01-11 15:56:58 +01:00
|
|
|
%setup -q -T -D -a 1 -n %{real_name}-%{git_hash}
|
2009-05-19 04:38:03 +02:00
|
|
|
%patch2 -p1
|
|
|
|
%else
|
|
|
|
%patch3 -p1
|
|
|
|
%endif
|
2022-01-12 11:20:46 +01:00
|
|
|
find . -name '*.jar' -print -delete
|
2022-01-11 15:56:58 +01:00
|
|
|
mkdir -p target/classes
|
2022-03-09 09:58:04 +01:00
|
|
|
mkdir -p compat/classes
|
2022-03-09 10:11:09 +01:00
|
|
|
tar xf %{SOURCE2} -C compat
|
2009-05-19 04:38:03 +02:00
|
|
|
|
|
|
|
%build
|
2022-01-12 11:20:46 +01:00
|
|
|
%if %{with bootstrap}
|
2009-05-19 04:38:03 +02:00
|
|
|
export CLASSPATH=
|
|
|
|
%else
|
|
|
|
export CLASSPATH=$(build-classpath java-cup jflex)
|
|
|
|
%endif
|
|
|
|
export OPT_JAR_LIST=:
|
2017-09-15 13:18:18 +02:00
|
|
|
ant
|
2022-03-09 09:58:04 +01:00
|
|
|
pushd compat
|
|
|
|
javac -d classes -source 1.7 -target 1.7 %{compat_name}/runtime/*.java %{compat_name}/*.java
|
2022-03-09 10:11:09 +01:00
|
|
|
jar -cf %{compat_name}.jar -C classes .
|
2022-03-09 09:58:04 +01:00
|
|
|
popd
|
2009-05-19 04:38:03 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
# jar
|
2022-03-09 10:23:35 +01:00
|
|
|
mkdir -p %{buildroot}%{_javadir}/%{compat_name}_compat
|
2022-01-11 15:56:58 +01:00
|
|
|
cp -a target/dist/%{real_name}-%{cvs_version}.jar %{buildroot}%{_javadir}/%{real_name}.jar
|
|
|
|
cp -a target/dist/%{real_name}-%{cvs_version}-runtime.jar %{buildroot}%{_javadir}/%{real_name}-runtime.jar
|
2022-03-09 10:23:35 +01:00
|
|
|
cp -a compat/%{compat_name}.jar %{buildroot}%{_javadir}/%{compat_name}_compat/%{compat_name}.jar
|
2022-01-11 15:56:58 +01:00
|
|
|
|
2022-01-12 11:20:46 +01:00
|
|
|
%if %{without bootstrap}
|
2022-01-11 15:56:58 +01:00
|
|
|
# maven data
|
|
|
|
%add_maven_depmap com.github.vbmacher:%{real_name}:%{cvs_version}-%{git_date} %{real_name}.jar
|
|
|
|
%add_maven_depmap com.github.vbmacher:%{real_name}-runtime:%{cvs_version}-%{git_date} %{real_name}-runtime.jar
|
2022-03-09 10:23:35 +01:00
|
|
|
%add_maven_depmap %{compat_name}:${compat_name}:%{compat_version} %{compat_name}_compat/%{compat_name}.jar
|
2022-01-11 15:56:58 +01:00
|
|
|
%endif
|
|
|
|
|
2022-03-09 10:23:35 +01:00
|
|
|
# compatibility symlinks
|
|
|
|
(cd %{buildroot}%{_javadir} && ln -s %{real_name}.jar java_cup.jar && ln -s %{real_name}-runtime.jar java_cup-runtime.jar)
|
2017-09-15 13:18:18 +02:00
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
2009-05-19 04:38:03 +02:00
|
|
|
|
2022-01-12 11:20:46 +01:00
|
|
|
%jpackage_script java_cup.Main "" "" %{real_name}:%{real_name}-runtime %{real_name} true
|
2022-01-11 15:56:58 +01:00
|
|
|
|
2022-01-12 11:20:46 +01:00
|
|
|
%if %{with bootstrap}
|
2009-05-19 04:38:03 +02:00
|
|
|
%files
|
2022-01-11 15:56:58 +01:00
|
|
|
%{_javadir}/%{real_name}*.jar
|
2022-03-09 10:23:35 +01:00
|
|
|
%{_javadir}/%{compat_name}_compat
|
2022-01-11 15:56:58 +01:00
|
|
|
%else
|
|
|
|
|
|
|
|
%files -f .mfiles
|
|
|
|
%endif
|
|
|
|
%license licence.txt
|
|
|
|
%doc changelog.txt
|
2009-05-19 04:38:03 +02:00
|
|
|
%attr(0755,root,root) %{_bindir}/%{real_name}
|
2022-03-09 10:23:35 +01:00
|
|
|
%{_javadir}/java_cup*.jar
|
2022-01-11 15:56:58 +01:00
|
|
|
|
2022-01-12 11:20:46 +01:00
|
|
|
%if %{without bootstrap}
|
2009-05-19 04:38:03 +02:00
|
|
|
%files manual
|
|
|
|
%doc manual.html
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|