From 7daa8d11368fa2c4f3143d0174dd2574886bee7707f8e7947e13c8e1e40f5c69 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 27 Nov 2019 08:42:33 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/parboiled?expand=0&rev=9 --- _multibuild | 3 ++ parboiled-scala.changes | 16 ------- parboiled-scala.spec | 93 ----------------------------------------- parboiled.changes | 3 +- parboiled.spec | 92 +++++++++++++++++++++++++++++----------- 5 files changed, 72 insertions(+), 135 deletions(-) create mode 100644 _multibuild delete mode 100644 parboiled-scala.changes delete mode 100644 parboiled-scala.spec diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..078eeb6 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + scala + diff --git a/parboiled-scala.changes b/parboiled-scala.changes deleted file mode 100644 index b7d0223..0000000 --- a/parboiled-scala.changes +++ /dev/null @@ -1,16 +0,0 @@ -------------------------------------------------------------------- -Wed Nov 27 06:37:29 UTC 2019 - Fridrich Strba - -- Split the scala subpackage from the main parboiled package in - order to split build dependencies - -------------------------------------------------------------------- -Tue Apr 9 08:17:03 UTC 2019 - Jan Engelhardt - -- Ensure neutrality of description. - -------------------------------------------------------------------- -Wed Apr 3 09:09:39 UTC 2019 - Fridrich Strba - -- Initial packaging of parboiled 1.1.6 -- Generate and customize ant build files diff --git a/parboiled-scala.spec b/parboiled-scala.spec deleted file mode 100644 index 37e654f..0000000 --- a/parboiled-scala.spec +++ /dev/null @@ -1,93 +0,0 @@ -# -# spec file for package parboiled-scala -# -# 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 https://bugs.opensuse.org/ -# - - -%global scala_short_version 2.10 -%global base_name parboiled -Name: %{base_name}-scala -Version: 1.1.6 -Release: 0 -Summary: Parboiled for Scala -License: Apache-2.0 -Group: Development/Libraries/Java -URL: http://parboiled.org/ -Source0: https://github.com/sirthias/parboiled/archive/%{version}.tar.gz -Source1: %{base_name}-%{version}-build.tar.xz -# for build see https://github.com/sirthias/parboiled/wiki/Building-parboiled -Source4: http://repo1.maven.org/maven2/org/parboiled/%{base_name}-scala_%{scala_short_version}/%{version}/%{base_name}-scala_%{scala_short_version}-%{version}.pom -Patch0: parboiled-port-to-objectweb-asm-5.0.1.patch -BuildRequires: ant -BuildRequires: ant-scala -BuildRequires: fdupes -BuildRequires: javapackages-local -BuildRequires: parboiled -BuildConflicts: java-devel >= 9 -Requires: mvn(org.parboiled:parboiled-core) = %{version} -Requires: mvn(org.scala-lang:scala-library) -BuildArch: noarch - -%description -An internal Scala DSL for efficiently defining your parser rules. - -parboiled is a mixed Java/Scala 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 javadoc -Summary: Javadoc for %{name} -Group: Documentation/HTML - -%description javadoc -This package contains javadoc for %{name}. - -%prep -%setup -q -n %{base_name}-%{version} -a1 - -find . -name "*.class" -delete -find . -name "*.jar" -delete - -%patch0 -p1 - -%build -mkdir -p lib -build-jar-repository -s lib %{base_name} -%{ant} -Dscala.libDir=%{_datadir}/scala/lib -f build-scala.xml package javadoc - -%install -# jars -install -dm 0755 %{buildroot}%{_javadir}/%{base_name} -install -pm 0644 %{base_name}-scala/target/%{base_name}-scala*%{version}.jar %{buildroot}%{_javadir}/%{base_name}/scala.jar -# poms -install -dm 0755 %{buildroot}%{_mavenpomdir}/%{base_name} -install -pm 0644 %{SOURCE4} %{buildroot}%{_mavenpomdir}/%{base_name}/scala.pom -%add_maven_depmap %{base_name}/scala.pom %{base_name}/scala.jar -# javadoc -install -dm 0755 %{buildroot}%{_javadocdir}/%{base_name}/scala -cp -pr %{base_name}-scala/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{base_name}/scala/ -%fdupes -s %{buildroot}%{_javadocdir} - -%files -f .mfiles -%license LICENSE - -%files javadoc -%license LICENSE -%{_javadocdir}/%{base_name} - -%changelog diff --git a/parboiled.changes b/parboiled.changes index b7d0223..0b715b7 100644 --- a/parboiled.changes +++ b/parboiled.changes @@ -2,7 +2,8 @@ Wed Nov 27 06:37:29 UTC 2019 - Fridrich Strba - Split the scala subpackage from the main parboiled package in - order to split build dependencies + order to split build dependencies: build them as _multibuild + package ------------------------------------------------------------------- Tue Apr 9 08:17:03 UTC 2019 - Jan Engelhardt diff --git a/parboiled.spec b/parboiled.spec index c175936..e9d4522 100644 --- a/parboiled.spec +++ b/parboiled.spec @@ -16,31 +16,58 @@ # +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "scala" +%bcond_without scala +%else +%bcond_with scala +%endif %global scala_short_version 2.10 -Name: parboiled -Version: 1.1.6 -Release: 0 +%global base_name parboiled +%if %{with scala} +Name: %{base_name}-scala +Summary: Parboiled for Scala +License: Apache-2.0 +Group: Development/Libraries/Java +%else +Name: %{base_name} Summary: Java/Scala library providing parsing of input text based on PEGs License: Apache-2.0 Group: Development/Libraries/Java +%endif +Version: 1.1.6 +Release: 0 URL: http://parboiled.org/ Source0: https://github.com/sirthias/parboiled/archive/%{version}.tar.gz -Source1: %{name}-%{version}-build.tar.xz +Source1: %{base_name}-%{version}-build.tar.xz # for build see https://github.com/sirthias/parboiled/wiki/Building-parboiled -Source2: http://repo1.maven.org/maven2/org/parboiled/%{name}-core/%{version}/%{name}-core-%{version}.pom -Source3: http://repo1.maven.org/maven2/org/parboiled/%{name}-java/%{version}/%{name}-java-%{version}.pom +Source2: http://repo1.maven.org/maven2/org/parboiled/%{base_name}-core/%{version}/%{base_name}-core-%{version}.pom +Source3: http://repo1.maven.org/maven2/org/parboiled/%{base_name}-java/%{version}/%{base_name}-java-%{version}.pom +Source4: http://repo1.maven.org/maven2/org/parboiled/%{base_name}-scala_%{scala_short_version}/%{version}/%{base_name}-scala_%{scala_short_version}-%{version}.pom Patch0: parboiled-port-to-objectweb-asm-5.0.1.patch BuildRequires: ant BuildRequires: fdupes BuildRequires: javapackages-local +%if %{with scala} +BuildRequires: ant-scala +BuildRequires: parboiled +BuildConflicts: java-devel >= 9 +Requires: mvn(org.parboiled:parboiled-core) = %{version} +Requires: mvn(org.scala-lang:scala-library) +%else BuildRequires: objectweb-asm Requires: mvn(org.ow2.asm:asm) Requires: mvn(org.ow2.asm:asm-analysis) Requires: mvn(org.ow2.asm:asm-tree) Requires: mvn(org.ow2.asm:asm-util) +%endif BuildArch: noarch %description +%if %{with scala} +An internal Scala DSL for efficiently defining your parser rules. + +%endif parboiled is a mixed Java/Scala library providing parsing of arbitrary input text based on Parsing expression grammars (PEGs). PEGs are an alternative to context free grammars (CFGs) for formally @@ -56,34 +83,49 @@ Group: Documentation/HTML This package contains javadoc for %{name}. %prep -%setup -q -a1 +%setup -q -n %{base_name}-%{version} -a1 find . -name "*.class" -delete find . -name "*.jar" -delete %patch0 -p1 +cp %{SOURCE2} %{base_name}-core/pom.xml +cp %{SOURCE3} %{base_name}-java/pom.xml +cp %{SOURCE4} %{base_name}-scala/pom.xml + %build mkdir -p lib -build-jar-repository -s lib objectweb-asm -%{ant} package javadoc +build-jar-repository -s lib \ +%if %{with scala} + %{base_name} +%else + objectweb-asm +%endif +%{ant} \ +%if %{with scala} + -Dscala.libDir=%{_datadir}/scala/lib \ + -f build-scala.xml \ +%endif + package javadoc %install -# jars -install -dm 0755 %{buildroot}%{_javadir}/%{name} -for i in core java; do - install -pm 0644 %{name}-${i}/target/%{name}-${i}*%{version}.jar %{buildroot}%{_javadir}/%{name}/${i}.jar -done -# poms -install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name} -install -pm 0644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/%{name}/core.pom -%add_maven_depmap %{name}/core.pom %{name}/core.jar -install -pm 0644 %{SOURCE3} %{buildroot}%{_mavenpomdir}/%{name}/java.pom -%add_maven_depmap %{name}/java.pom %{name}/java.jar -# javadoc -for i in core java; do - install -dm 0755 %{buildroot}%{_javadocdir}/%{name}/${i} - cp -pr %{name}-${i}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/${i}/ +%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 %{base_name}-${i}/target/%{base_name}-${i}*%{version}.jar %{buildroot}%{_javadir}/%{base_name}/${i}.jar + # pom + install -pm 0644 %{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}/%{base_name}/${i} + cp -pr %{base_name}-${i}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{base_name}/${i}/ done %fdupes -s %{buildroot}%{_javadocdir} @@ -93,6 +135,6 @@ done %files javadoc %license LICENSE -%{_javadocdir}/%{name} +%{_javadocdir}/%{base_name} %changelog