This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package parboiled
|
||||
# spec file
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
#
|
||||
@@ -16,8 +16,20 @@
|
||||
#
|
||||
|
||||
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
%if "%{flavor}" == "scala"
|
||||
%bcond_without scala
|
||||
%else
|
||||
%bcond_with scala
|
||||
%endif
|
||||
%global scala_short_version 2.13
|
||||
Name: parboiled
|
||||
%global base_name parboiled
|
||||
%if %{with scala}
|
||||
Name: %{base_name}-scala
|
||||
Summary: Parboiled for Scala
|
||||
%else
|
||||
Name: %{base_name}
|
||||
%endif
|
||||
Version: 1.4.1
|
||||
Release: 0
|
||||
Summary: Java library providing parsing of input text based on PEGs
|
||||
@@ -25,36 +37,30 @@ License: Apache-2.0
|
||||
Group: Development/Libraries/Java
|
||||
URL: http://parboiled.org/
|
||||
Source0: https://github.com/sirthias/parboiled/archive/%{version}.tar.gz
|
||||
Source1: %{name}-build.tar.xz
|
||||
Source1: %{base_name}-build.tar.xz
|
||||
# for build see https://github.com/sirthias/parboiled/wiki/Building-parboiled
|
||||
Source2: https://repo1.maven.org/maven2/org/parboiled/%{name}-core/%{version}/%{name}-core-%{version}.pom
|
||||
Source3: https://repo1.maven.org/maven2/org/parboiled/%{name}-java/%{version}/%{name}-java-%{version}.pom
|
||||
Source4: https://repo1.maven.org/maven2/org/parboiled/%{name}-scala_%{scala_short_version}/%{version}/%{name}-scala_%{scala_short_version}-%{version}.pom
|
||||
Source2: https://repo1.maven.org/maven2/org/parboiled/%{base_name}-core/%{version}/%{base_name}-core-%{version}.pom
|
||||
Source3: https://repo1.maven.org/maven2/org/parboiled/%{base_name}-java/%{version}/%{base_name}-java-%{version}.pom
|
||||
Source4: https://repo1.maven.org/maven2/org/parboiled/%{base_name}-scala_%{scala_short_version}/%{version}/%{base_name}-scala_%{scala_short_version}-%{version}.pom
|
||||
Patch0: restore-java8-compatibility.patch
|
||||
BuildRequires: ant
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: java-devel >= 1.8
|
||||
BuildRequires: javapackages-local
|
||||
BuildRequires: objectweb-asm
|
||||
BuildRequires: javapackages-local >= 6
|
||||
%if %{with scala}
|
||||
BuildRequires: parboiled
|
||||
BuildRequires: scala-ant
|
||||
%else
|
||||
BuildRequires: objectweb-asm
|
||||
%endif
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
parboiled is a mixed Java library providing parsing of
|
||||
arbitrary input text based on Parsing expression grammars (PEGs).
|
||||
PEGs are an alternative to context free grammars (CFGs) for formally
|
||||
specifying syntax, they make a replacement for regular expressions
|
||||
and generally have some advantages over the "traditional" way of
|
||||
building parser via CFGs.
|
||||
|
||||
%package scala
|
||||
Summary: Parboiled for Scala
|
||||
Group: Development/Libraries/Java
|
||||
|
||||
%description scala
|
||||
%if %{with scala}
|
||||
An internal Scala DSL for efficiently defining your parser rules.
|
||||
|
||||
parboiled is a mixed Java/Scala library providing parsing of
|
||||
%endif
|
||||
parboiled is a mixed Java library providing parsing of
|
||||
arbitrary input text based on Parsing expression grammars (PEGs).
|
||||
PEGs are an alternative to context free grammars (CFGs) for formally
|
||||
specifying syntax, they make a replacement for regular expressions
|
||||
@@ -69,7 +75,7 @@ Group: Documentation/HTML
|
||||
This package contains javadoc for %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q -a1
|
||||
%setup -q -n %{base_name}-%{version} -a1
|
||||
%patch0 -p1
|
||||
|
||||
cp %{SOURCE2} %{name}-core/pom.xml
|
||||
@@ -79,27 +85,34 @@ cp %{SOURCE4} %{name}-scala/pom.xml
|
||||
%build
|
||||
mkdir -p lib
|
||||
build-jar-repository -s lib \
|
||||
objectweb-asm scala
|
||||
%if %{with scala}
|
||||
%{base_name}
|
||||
%else
|
||||
objectweb-asm
|
||||
%endif
|
||||
%{ant} \
|
||||
%if %{with scala}
|
||||
-f build-scala.xml \
|
||||
%endif
|
||||
package javadoc
|
||||
|
||||
%install
|
||||
%global modules core java scala
|
||||
install -dm 0755 %{buildroot}%{_javadir}/%{name}
|
||||
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
|
||||
%if %{with scala}
|
||||
%global modules scala
|
||||
%else
|
||||
%global modules core java
|
||||
%endif
|
||||
install -dm 0755 %{buildroot}%{_javadir}/%{base_name}
|
||||
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{base_name}
|
||||
for i in %{modules}; do
|
||||
# jar
|
||||
install -pm 0644 %{name}-${i}/target/%{name}-${i}*%{version}.jar %{buildroot}%{_javadir}/%{name}/${i}.jar
|
||||
install -pm 0644 %{base_name}-${i}/target/%{base_name}-${i}*%{version}.jar %{buildroot}%{_javadir}/%{base_name}/${i}.jar
|
||||
# pom
|
||||
%{mvn_install_pom} %{name}-${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/${i}.pom
|
||||
if [ "${i}" = scala ]; then
|
||||
%add_maven_depmap %{name}/${i}.pom %{name}/${i}.jar -f scala
|
||||
else
|
||||
%add_maven_depmap %{name}/${i}.pom %{name}/${i}.jar
|
||||
fi
|
||||
%{mvn_install_pom} %{base_name}-${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{base_name}/${i}.pom
|
||||
%add_maven_depmap %{base_name}/${i}.pom %{base_name}/${i}.jar
|
||||
# javadoc
|
||||
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/${i}
|
||||
cp -pr %{name}-${i}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/${i}/
|
||||
install -dm 0755 %{buildroot}%{_javadocdir}/%{base_name}/${i}
|
||||
cp -pr %{base_name}-${i}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{base_name}/${i}/
|
||||
done
|
||||
%fdupes -s %{buildroot}%{_javadocdir}
|
||||
|
||||
@@ -107,11 +120,8 @@ done
|
||||
%doc CHANGELOG README.markdown
|
||||
%license LICENSE
|
||||
|
||||
%files scala -f .mfiles-scala
|
||||
%license LICENSE
|
||||
|
||||
%files javadoc
|
||||
%license LICENSE
|
||||
%{_javadocdir}/%{name}
|
||||
%{_javadocdir}/%{base_name}
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user