File gnu-regexp.spec of Package gnu-regexp

# spec file for package gnu-regexp
# Copyright (c) 2019 SUSE LLC
# 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

Name:           gnu-regexp
Version:        1.1.4
Release:        0
Summary:        Java NFA regular expression engine
License:        GPL-2.0-or-later AND LGPL-2.1-or-later
Group:          Development/Libraries/Java
Source1:        %{name}.build.xml
BuildRequires:  ant
BuildRequires:  fdupes
BuildRequires:  gnu-getopt
BuildRequires:  java-devel >= 1.8
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

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
Summary:        Java NFA regular expression engine (demo and samples)
Group:          Development/Libraries/Java
Requires:       %{name} = %{version}-%{release}
Requires:       gnu-getopt

%description demo
Demonstrations and samples for Java NFA regular expression engine gnu-regexp.

%package javadoc
Summary:        Java NFA regular expression engine (documentation)
Group:          Development/Libraries/Java

%description javadoc
Javadoc for Java NFA regular expression engine 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
cp -a build/api/* %{buildroot}%{_javadocdir}/gnu.regexp
%fdupes -s %{buildroot}%{_javadocdir}/gnu.regexp


%files demo

%files javadoc
%dir %{_javadocdir}/gnu.regexp

openSUSE Build Service is sponsored by