File gnu-regexp.spec of Package gnu-regexp

# spec file for package gnu-regexp (Version 1.1.4)
# 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

# norootforbuild
# icecream 0

Name:           gnu-regexp
BuildRequires:  ant gnu-getopt java2-devel-packages xml-commons-apis
%define section free
Version:        1.1.4
Release:        267
Summary:        Java NFA regular expression engine
License:        LGPL v2.1 or later
Source1:        %{name}.build.xml
Group:          Development/Libraries/Java
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

The gnu-regexp package is a pure-Java implementation of a traditional
(non-POSIX) NFA regular expression engine. Its syntax can emulate many
popular development tools, including awk, sed, emacs, perl and grep.
For a relatively complete list of supported and non-supported syntax,
refer to the syntax and usage notes.

%package demo
License:        LGPL v2.1 or later
Summary:        Java NFA regular expression engine (demo and samples)
Requires:       %{name} = %{version}-%{release}
Requires:       gnu-getopt
Group:          Development/Libraries/Java

%description demo
Demonstrations and samples for gnu-regexp.

%package javadoc
License:        LGPL v2.1 or later
PreReq:         coreutils
Summary:        Java NFA regular expression engine (documentation)
Group:          Development/Libraries/Java

%description javadoc
Javadoc for gnu-regexp.

%setup -q -n gnu.regexp-1.1.4
%__cp -a %{SOURCE1} build.xml
# remove all binary libs
find . -name "*.jar" -exec %__rm -f {} \;

export CLASSPATH=$(build-classpath gnu.getopt)
%ant jar javadoc

# jars
%__mkdir_p %{buildroot}%{_javadir}
%__cp -a build/lib/gnu.regexp.jar %{buildroot}%{_javadir}/gnu.regexp-%{version}.jar
(cd %{buildroot}%{_javadir} && ln -sf gnu.regexp-%{version}.jar %{name}-%{version}.jar && \
    for jar in *-%{version}*; do %__ln_s ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# demo
%__mkdir_p %{buildroot}%{_datadir}/gnu.regexp/gnu/regexp/util
%__cp -a build/classes/gnu/regexp/util/*.class \
# javadoc
%__mkdir_p %{buildroot}%{_javadocdir}/gnu.regexp-%{version}
%__cp -a build/api/* %{buildroot}%{_javadocdir}/gnu.regexp-%{version}
(cd %{buildroot}%{_javadocdir} && %__ln_s gnu.regexp-%{version} gnu.regexp)


%post javadoc
%__rm -f %{_javadocdir}/gnu.regexp
%__ln_s gnu.regexp-%{version} %{_javadocdir}/gnu.regexp

%postun javadoc
if [ $1 -eq 0 ]; then
  %__rm -f %{_javadocdir}/gnu.regexp


%files demo

%files javadoc
%dir %{_javadocdir}/gnu.regexp-%{version}
%ghost %dir %{_javadocdir}/gnu.regexp

* Thu Apr 23 2009
- add gnu-regexp jars to make build-classpath works as expected
* Mon Sep 25 2006
- don't use icecream
- use source="1.4" and target="1.4" for build with java 1.5
* Wed Jan 25 2006
- converted neededforbuild to BuildRequires
* Tue Oct 25 2005
- fix demo package requires
* Mon Oct 17 2005
- Current version 1.1.4 from