File antlr4.spec of Package antlr4

#
# spec file for package 
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           antlr4
Version:	4.4
Release:	1.1
License:	BSD-3-Clause
Summary:	ANother Tool for Language Recognition
Url:		http://www.antlr.org/
Group:		Development/Tools/Other
Source:		http://antlr4.org/download/antlr-%{version}-complete.jar
Source1:	http://antlr4.org/download/antlr-runtime-%{version}.jar
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
Requires:	java
BuildArch:	noarch

%description
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator 
for reading, processing, executing, or translating structured text or binary 
files. It's widely used to build languages, tools, and frameworks. From a 
grammar, ANTLR generates a parser that can build and walk parse trees.

%prep

%build

%install

#jar
install -d $RPM_BUILD_ROOT/usr/share/java/
install -p %{SOURCE0} $RPM_BUILD_ROOT/usr/share/java/
install -p %{SOURCE1} $RPM_BUILD_ROOT/usr/share/java/

#helper scripts
install -d $RPM_BUILD_ROOT/%{_bindir}

echo "#!/bin/sh
java -jar /usr/share/java/antlr-%{version}-complete.jar \$@" > $RPM_BUILD_ROOT/%{_bindir}/antlr4

echo "#!/bin/sh
export CLASSPATH=".:/usr/share/java/antlr-%{version}-complete.jar"
java org.antlr.v4.runtime.misc.TestRig \$@" > $RPM_BUILD_ROOT/%{_bindir}/grun

chmod a+x $RPM_BUILD_ROOT/%{_bindir}/*

%files
%defattr(-,root,root)
/usr/share/java/antlr-%{version}-complete.jar
/usr/share/java/antlr-runtime-%{version}.jar
%{_bindir}/antlr4
%{_bindir}/grun

%changelog