Fridrich Strba 2019-04-09 14:57:14 +00:00 committed by Git OBS Bridge
parent 49741b5f46
commit ec30368d47
3 changed files with 50 additions and 9 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>bootstrap</package>
</multibuild>

View File

@ -1,7 +1,9 @@
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Apr 9 14:37:13 UTC 2019 - Fridrich Strba <fstrba@suse.com> Tue Apr 9 14:37:13 UTC 2019 - Fridrich Strba <fstrba@suse.com>
- Do not depend on itself. Bootstrap by the included bootstrap jar. - Make this a multibuild package where the bootstrap version is
built using the included javacc.jar and the non-bootstrap version
uses the system javacc.jar
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Feb 6 09:12:23 UTC 2019 - Fridrich Strba <fstrba@suse.com> Wed Feb 6 09:12:23 UTC 2019 - Fridrich Strba <fstrba@suse.com>

View File

@ -17,7 +17,13 @@
# #
Name: javacc %global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "bootstrap"
%bcond_without bootstrap
%else
%bcond_with bootstrap
%endif
%global base_name javacc
Version: 7.0.4 Version: 7.0.4
Release: 0 Release: 0
Summary: A Parser and Scanner Generator for Java Summary: A Parser and Scanner Generator for Java
@ -32,6 +38,15 @@ BuildRequires: javapackages-local
# /usr/share/java-utils/java-functions # /usr/share/java-utils/java-functions
Requires: javapackages-tools Requires: javapackages-tools
BuildArch: noarch BuildArch: noarch
%if %{with bootstrap}
Name: %{base_name}-bootstrap
Provides: %{base_name}
%else
Name: %{base_name}
BuildRequires: %{base_name}
Provides: %{base_name}-bootstrap
Obsoletes: %{base_name}-bootstrap
%endif
%description %description
Java Compiler Compiler (JavaCC) is the most popular parser generator Java Compiler Compiler (JavaCC) is the most popular parser generator
@ -65,7 +80,12 @@ Group: Documentation/HTML
This package contains the API documentation for %{name}. This package contains the API documentation for %{name}.
%prep %prep
%setup -q %setup -q -n %{base_name}-%{version}
rm -f lib/*.jar
%if %{without bootstrap}
rm -f bootstrap/javacc.jar
build-jar-repository -s -p bootstrap javacc
%endif
find ./examples -type f -exec sed -i 's/\r//' {} \; find ./examples -type f -exec sed -i 's/\r//' {} \;
@ -73,18 +93,25 @@ find ./examples -type f -exec sed -i 's/\r//' {} \;
%pom_xpath_remove pom:project/pom:dependencies %pom_xpath_remove pom:project/pom:dependencies
%build %build
ant \ %{ant} \
-Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \ -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \
%if %{with bootstrap}
jar
%else
jar javadoc jar javadoc
%endif
%install %install
# jar # jar
install -dm 0755 %{buildroot}%{_javadir} install -dm 0755 %{buildroot}%{_javadir}
install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar install -pm 0644 target/%{base_name}-%{version}.jar %{buildroot}%{_javadir}/%{base_name}.jar
%if %{without bootstrap}
# pom # pom
install -dm 0755 %{buildroot}%{_mavenpomdir} install -dm 0755 %{buildroot}%{_mavenpomdir}
install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{base_name}.pom
%add_maven_depmap %{name}.pom %{name}.jar %add_maven_depmap %{base_name}.pom %{base_name}.jar
# javadoc # javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name} install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/javadoc/* %{buildroot}%{_javadocdir}/%{name}/ cp -pr target/javadoc/* %{buildroot}%{_javadocdir}/%{name}/
@ -97,14 +124,22 @@ ln -s %{_bindir}/javacc %{buildroot}%{_bindir}/javacc.sh
%jpackage_script jjdoc '' '' javacc jjdoc true %jpackage_script jjdoc '' '' javacc jjdoc true
%jpackage_script jjtree '' '' javacc jjtree true %jpackage_script jjtree '' '' javacc jjtree true
%endif
%if %{with bootstrap}
%files
%{_javadir}/%{base_name}.jar
%else
%files -f .mfiles %files -f .mfiles
%license LICENSE
%doc README
%{_bindir}/javacc %{_bindir}/javacc
%{_bindir}/javacc.sh %{_bindir}/javacc.sh
%{_bindir}/jjdoc %{_bindir}/jjdoc
%{_bindir}/jjtree %{_bindir}/jjtree
%endif
%license LICENSE
%doc README
%if %{without bootstrap}
%files manual %files manual
%doc www/* %doc www/*
@ -114,5 +149,6 @@ ln -s %{_bindir}/javacc %{buildroot}%{_bindir}/javacc.sh
%files javadoc %files javadoc
%license LICENSE %license LICENSE
%{_javadocdir}/%{name} %{_javadocdir}/%{name}
%endif
%changelog %changelog