ALT Linux repos
Group :: Development/Java
RPM: jflex
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Packager: Igor Vlasenko <viy at altlinux.ru>
BuildRequires: /proc
BuildRequires: jpackage-compat
# Copyright (c) 2000-2008, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#define with()
#define without()
#define bcond_with()
#define bcond_without()
%def_with bootstrap
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
Name: jflex
Version: 1.4.2
Release: alt2_1jpp5
Epoch: 0
Summary: Lexical Analyzer Generator for Java
License: GPLv2+
Group: Development/Java
URL: http://www.jflex.de/
Source0: http://www.jflex.de/jflex-1.4.2.tar.gz
Source1: jflex.script
Patch0: jflex-javac-no-target.patch
Patch1: jflex-no-cup-no-jflex.patch
Patch2: jflex-classpath.patch
Patch3: jflex-lex-scan.patch
Patch4: jflex-byaccj-utl.patch
Requires: java-cup
Requires: jpackage-utils
BuildRequires: ant
BuildRequires: java-cup
%if_without bootstrap
BuildRequires: jflex
%endif
BuildRequires: junit
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
%else
BuildArch: noarch
%endif
%description
JFlex is a lexical analyzer generator for Java written in Java. It is
also a rewrite of the very useful tool JLex which was developed by
Elliot Berk at Princeton University. As Vern Paxson states for his C/C++
tool flex: they do not share any code though.
Design goals The main design goals of JFlex are:
* Full unicode support
* Fast generated scanners
* Fast scanner generation
* Convenient specification syntax
* Platform independence
* JLex compatibility
%package javadoc
Group: Development/Java
Summary: Javadoc for %{name}
%description javadoc
Javadoc for %{name}.
%prep
%setup -q
%{__perl} -pi -e 's/\r$//g' examples/standalone/sample.inp
%{__rm} -rf src/java_cup
find . -name '*.jar' | xargs -t %{__rm}
%if_without bootstrap
export CLASSPATH=$(build-classpath java-cup junit jflex)
export OPT_JAR_LIST=:
pushd src
%ant realclean
%ant jflex
popd
%endif
%patch0 -p1
%if_with bootstrap
%patch1 -p1
%else
%patch2 -p1
%patch3 -p1
%patch4 -p1
%endif
%build
pushd src
%if_without bootstrap
export CLASSPATH=$(build-classpath java-cup junit jflex)
%else
export CLASSPATH=$(build-classpath java-cup junit)
%endif
export OPT_JAR_LIST=:
%ant jar
%{__mkdir_p} ../dist/docs/api
%{javadoc} -d ../dist/docs/api `find . -type f -name "*.java"`
popd
%install
# jar
%{__mkdir_p} %{buildroot}%{_javadir}
%{__cp} -a lib/JFlex.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %{__ln_s} ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# compatibility symlink
(cd %{buildroot}%{_javadir} && %{__ln_s} jflex.jar JFlex.jar)
# javadoc
%{__mkdir_p} 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__cp} -a dist/docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__ln_s} %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
%{__mkdir_p} %{buildroot}%{_bindir}
%{__install} -p -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}
%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif
%__subst 's,BASE_JARS="jflex",BASE_JARS="jflex java-cup",' $RPM_BUILD_ROOT/%_bindir/jflex
%if %{gcj_support}
%post
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%if %{gcj_support}
%postun
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%files
%doc COPYRIGHT doc examples src/README src/changelog
%attr(0755,root,root) %{_bindir}/%{name}
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/JFlex.jar
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/*
%endif
%files javadoc
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
…
Full changelog you can see here
BuildRequires: /proc
BuildRequires: jpackage-compat
# Copyright (c) 2000-2008, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#define with()
#define without()
#define bcond_with()
#define bcond_without()
%def_with bootstrap
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
Name: jflex
Version: 1.4.2
Release: alt2_1jpp5
Epoch: 0
Summary: Lexical Analyzer Generator for Java
License: GPLv2+
Group: Development/Java
URL: http://www.jflex.de/
Source0: http://www.jflex.de/jflex-1.4.2.tar.gz
Source1: jflex.script
Patch0: jflex-javac-no-target.patch
Patch1: jflex-no-cup-no-jflex.patch
Patch2: jflex-classpath.patch
Patch3: jflex-lex-scan.patch
Patch4: jflex-byaccj-utl.patch
Requires: java-cup
Requires: jpackage-utils
BuildRequires: ant
BuildRequires: java-cup
%if_without bootstrap
BuildRequires: jflex
%endif
BuildRequires: junit
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
%else
BuildArch: noarch
%endif
%description
JFlex is a lexical analyzer generator for Java written in Java. It is
also a rewrite of the very useful tool JLex which was developed by
Elliot Berk at Princeton University. As Vern Paxson states for his C/C++
tool flex: they do not share any code though.
Design goals The main design goals of JFlex are:
* Full unicode support
* Fast generated scanners
* Fast scanner generation
* Convenient specification syntax
* Platform independence
* JLex compatibility
%package javadoc
Group: Development/Java
Summary: Javadoc for %{name}
%description javadoc
Javadoc for %{name}.
%prep
%setup -q
%{__perl} -pi -e 's/\r$//g' examples/standalone/sample.inp
%{__rm} -rf src/java_cup
find . -name '*.jar' | xargs -t %{__rm}
%if_without bootstrap
export CLASSPATH=$(build-classpath java-cup junit jflex)
export OPT_JAR_LIST=:
pushd src
%ant realclean
%ant jflex
popd
%endif
%patch0 -p1
%if_with bootstrap
%patch1 -p1
%else
%patch2 -p1
%patch3 -p1
%patch4 -p1
%endif
%build
pushd src
%if_without bootstrap
export CLASSPATH=$(build-classpath java-cup junit jflex)
%else
export CLASSPATH=$(build-classpath java-cup junit)
%endif
export OPT_JAR_LIST=:
%ant jar
%{__mkdir_p} ../dist/docs/api
%{javadoc} -d ../dist/docs/api `find . -type f -name "*.java"`
popd
%install
# jar
%{__mkdir_p} %{buildroot}%{_javadir}
%{__cp} -a lib/JFlex.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %{__ln_s} ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# compatibility symlink
(cd %{buildroot}%{_javadir} && %{__ln_s} jflex.jar JFlex.jar)
# javadoc
%{__mkdir_p} 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__cp} -a dist/docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__ln_s} %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
%{__mkdir_p} %{buildroot}%{_bindir}
%{__install} -p -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}
%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif
%__subst 's,BASE_JARS="jflex",BASE_JARS="jflex java-cup",' $RPM_BUILD_ROOT/%_bindir/jflex
%if %{gcj_support}
%post
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%if %{gcj_support}
%postun
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%files
%doc COPYRIGHT doc examples src/README src/changelog
%attr(0755,root,root) %{_bindir}/%{name}
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/JFlex.jar
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/*
%endif
%files javadoc
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
…
Full changelog you can see here