LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File javacc3.spec of Package javacc3 (Project Java:packages)

#
# spec file for package javacc3 (Version 3.2)
#
# Copyright (c) 2009 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/
#


%define _with_repolib 1
# If you want repolib package to be built,
# issue the following: 'rpmbuild --with repolib'
%define with_repolib %{?_with_repolib:1}%{!?_with_repolib:0}
%define without_repolib %{!?_with_repolib:1}%{?_with_repolib:0}
%define repodir %{_javadir}/repository.jboss.com/sun-javacc/3.2-brew
%define repodirlib %{repodir}/lib
%define repodirsrc %{repodir}/src
%define section free
%define _basename javacc

Name:           javacc3
Version:        3.2
Release:        2
Summary:        A parser/scanner generator for java
License:        SUSE-BSD-3-Clause-with-non-nuclear-addition
Source0:        javacc-3.2-src.tar.bz2
Source1:        javacc
Source2:        jjdoc
Source3:        jjtree
Source4:        javacc-component-info.xml
Url:            https://javacc.dev.java.net/
Group:          Development/Libraries/Java
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Requires:       jpackage-utils >= 1.5
BuildRequires:  ant

%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.



%if %{with_repolib}

%package	repolib
License:        SUSE-BSD-3-Clause-with-non-nuclear-addition
Summary:        A parser/scanner generator for java
Group:          Development/Libraries/Java

%description	 repolib
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.



%endif

%package        manual
License:        SUSE-BSD-3-Clause-with-non-nuclear-addition
Summary:        A parser/scanner generator for java
Group:          Development/Libraries/Java

%description manual
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 demo
License:        SUSE-BSD-3-Clause-with-non-nuclear-addition
Summary:        A parser/scanner generator for java
Group:          Development/Libraries/Java

%description demo
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.



%prep
%setup -q -n %{_basename}-%{version}
cp %{SOURCE1} javacc3
cp %{SOURCE2} jjdoc3
cp %{SOURCE3} jjtree3
mv www/doc .
tag=`echo %{name}-%{version}-%{release} | sed 's|\.|_|g'`
sed -i "s/@TAG@/$tag/g" %{SOURCE4}

%build
ant \
  -Dant.build.javac.source=1.4 \
  -Dversion=%{version} \
  jar

%install
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 bin/lib/%{_basename}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
install -d -m 755 $RPM_BUILD_ROOT/usr/bin
install -m 755 javacc3 jjdoc3 jjtree3 $RPM_BUILD_ROOT/usr/bin
install -d -m 755 $RPM_BUILD_ROOT/usr/share/%{name}
cp -pr examples $RPM_BUILD_ROOT/usr/share/%{name}
%if %{with_repolib}
	install -d -m 755 $RPM_BUILD_ROOT%{repodir}
	install -d -m 755 $RPM_BUILD_ROOT%{repodirlib}
	install -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{repodir}/component-info.xml
	install -d -m 755 $RPM_BUILD_ROOT%{repodirsrc}
	install -m 755 %{SOURCE0} $RPM_BUILD_ROOT%{repodirsrc}
	cp $RPM_BUILD_ROOT%{_javadir}/javacc3.jar $RPM_BUILD_ROOT%{repodirlib}/javacc.jar
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(0644,root,root,0755)
%{_javadir}/*.jar
%doc LICENSE README
%defattr(0755,root,root,0755)
%{_bindir}/*
%dir %{_javadir}/repository.jboss.com
%dir %{_javadir}/repository.jboss.com/sun-javacc

%files manual
%defattr(0644,root,root,0755)
%doc doc/*

%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}
%if %{with_repolib}

%files repolib
%defattr(0644,root,root,0755)
%dir %{_javadir}/repository.jboss.com
%{repodir}
%endif

%changelog
* Thu May 14 2009 mvyskocil@suse.cz
- 'Initial SUSE packaging'