SHA256
1
0
forked from pool/javacc
Files
javacc/javacc.spec

122 lines
3.4 KiB
RPMSpec
Raw Normal View History

#
# spec file for package javacc
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2000-2005, JPackage Project
# All rights reserved.
#
# 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 https://bugs.opensuse.org/
#
Name: javacc
Version: 7.0.4
Release: 0
Summary: A parser/scanner generator for java
License: BSD
Group: Development/Libraries/Java
URL: http://javacc.org
Source0: https://github.com/javacc/javacc/archive/%{version}.tar.gz
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: javacc
BuildRequires: javapackages-local
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
BuildArch: noarch
%description
Java Compiler Compiler (JavaCC) is the most popular parser generator for use
with Java applications. A parser generator is a tool that reads a grammar
specification and converts it to a Java program that can recognize matches to
the grammar. In addition to the parser generator itself, JavaCC provides other
standard capabilities related to parser generation such as tree building (via
a tool called JJTree included with JavaCC), actions, debugging, etc.
%package manual
Summary: Manual for %{name}
Group: Development/Libraries/Java
%description manual
Manual for %{name}.
%package demo
Summary: Examples for %{name}
Group: Development/Libraries/Java
Requires: %{name} = %{version}-%{release}
%description demo
Examples for %{name}.
%package javadoc
Summary: Javadoc for %{name}
Group: Development/Libraries/Java
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{name}-%{version}
# Remove binary information in the source tar
find . -name "*.jar" -delete
find . -name "*.class" -delete
find ./examples -type f -exec sed -i 's/\r//' {} \;
%build
build-jar-repository -p bootstrap javacc
# There is maven pom which doesn't really work for building. The tests don't
# work either (even when using bundled jars).
ant \
-Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \
jar javadoc
# The pom dependencies are also wrong
%mvn_artifact --skip-dependencies pom.xml target/javacc-%{version}.jar
%install
%mvn_file : %{name}
%mvn_install -J target/javadoc
%fdupes -s %{buildroot}%{_javadocdir}
%fdupes -s www
%fdupes -s examples
%jpackage_script javacc '' '' javacc javacc true
ln -s %{_bindir}/javacc %{buildroot}%{_bindir}/javacc.sh
%jpackage_script jjdoc '' '' javacc jjdoc true
%jpackage_script jjtree '' '' javacc jjtree true
%files -f .mfiles
%license LICENSE
%doc README
%{_bindir}/javacc
%{_bindir}/javacc.sh
%{_bindir}/jjdoc
%{_bindir}/jjtree
%files manual
%doc www/*
%files demo
%doc examples
%files javadoc -f .mfiles-javadoc
%license LICENSE
%changelog