Sync from SUSE:ALP:Source:Standard:1.0 ant revision ab24097cf02acab94c1144e91929eb2f

This commit is contained in:
Adrian Schröter 2024-02-20 09:08:24 +01:00
commit 5ac482e86f
23 changed files with 9149 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

6
_multibuild Normal file
View File

@ -0,0 +1,6 @@
<multibuild>
<package>ant-antlr</package>
<package>ant-junit</package>
<package>ant-junit5</package>
</multibuild>

1076
ant-antlr.changes Normal file

File diff suppressed because it is too large Load Diff

770
ant-antlr.spec Normal file
View File

@ -0,0 +1,770 @@
#
# spec file for package ant-antlr
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2000-2009, JPackage Project
#
# 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 ant_home %{_datadir}/ant
##### WARNING: please do not edit this auto generated spec file. Use the ant.spec! #####
%bcond_with bootstrap
%bcond_with junit
%bcond_with junit5
%bcond_without antlr
Name: ant-antlr
Version: 1.10.14
Release: 0
Summary: Antlr Task for ant
License: Apache-2.0
Group: Development/Tools/Building
URL: https://ant.apache.org/
Source0: https://www.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.xz
Source1: apache-ant-1.8.ant.conf
Source10: ant-bootstrap.pom.in
Source1000: pre_checkin.sh
Source1001: https://www.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.xz.asc
Source1002: ant.keyring
Patch0: apache-ant-no-test-jar.patch
Patch1: apache-ant-class-path-in-manifest.patch
Patch2: apache-ant-bootstrap.patch
#PATCH-FEATURE-OPENSUSE bmwiedemann -- have fixed build dates
Patch3: reproducible-build-date.patch
# PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest
Patch5: reproducible-build-manifest.patch
Patch6: apache-ant-xml-apis.patch
# PATCH-FEATURE-OPENSUSE debian patch to use SOURCE_DATE_EPOCH for timestamp in property files
Patch7: reproducible-propertyfile-task.patch
BuildRequires: antlr-bootstrap
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local >= 6
BuildRequires: unzip
BuildRequires: xml-commons-apis-bootstrap
#!BuildIgnore: xml-commons-apis
BuildArch: noarch
# Needed for maven conversions
%if !%{with bootstrap}
BuildRequires: javapackages-local
%endif
%if %{with junit} || %{with antlr} || %{with junit5}
BuildRequires: ant = %{version}
BuildRequires: hamcrest
BuildRequires: junit
#!BuildIgnore: antlr
%endif
%if %{with antlr}
BuildRequires: xerces-j2
BuildRequires: xz-java
%endif
%if %{with junit5}
BuildRequires: apiguardian
BuildRequires: junit5
%endif
%if 0%{?suse_version} > 1320
BuildRequires: strip-nondeterminism
%endif
%if %{with bootstrap}
Requires: java-devel >= 1.8
Requires: javapackages-tools
Requires: xerces-j2
Requires: xml-apis
Requires: xml-resolver
Obsoletes: apache-ant < %{version}
Provides: apache-ant = %{version}
Obsoletes: ant-nodeps < %{version}
Provides: ant-nodeps = %{version}
Obsoletes: ant-trax < %{version}
Provides: ant-trax = %{version}
%endif
%if %{with antlr}
Requires: antlr
%requires_eq ant
Obsoletes: ant-javadoc
%endif
%if %{with junit}
Requires: junit4
%requires_eq ant
%endif
%if %{with junit5}
Requires: junit5
%requires_eq ant
%endif
%if %{with junit}
%description
Apache Ant is a Java-based build tool.
This package contains optional JUnit tasks for Apache Ant.
%elif %{with junit5}
%description
Apache Ant is a Java-based build tool.
This package contains optional JUnit5 tasks for Apache Ant.
%else
%description
Apache Ant is a Java-based build tool. In theory, it is kind of like
Make. Build description files are written in XML.
%endif
%if %{with bootstrap}
%package -n ant-jmf
Summary: Optional jmf tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
%description -n ant-jmf
Apache Ant is a Java-based build tool.
This package contains optional jmf tasks for Apache Ant.
%package -n ant-swing
Summary: Optional swing tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
%description -n ant-swing
Apache Ant is a Java-based build tool.
This package contains optional swing tasks for Apache Ant.
%package -n ant-scripts
Summary: Additional scripts for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
Requires: perl
Requires: python3-base
%description -n ant-scripts
Apache Ant is a Java-based build tool.
This package contains additional perl and python scripts for Apache
Ant.
%endif #if bootstrap
%if %{with antlr}
%package -n ant-apache-bsf
Summary: Optional apache bsf tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: bsf
Requires: bsf
%requires_eq ant
%description -n ant-apache-bsf
Apache Ant is a Java-based build tool.
This package contains optional apache bsf tasks for Apache Ant.
%package -n ant-apache-resolver
Summary: Optional apache resolver tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: xml-resolver
Requires: xml-resolver
%requires_eq ant
%description -n ant-apache-resolver
Apache Ant is a Java-based build tool.
This package contains optional apache resolver tasks for Apache Ant.
%package -n ant-commons-logging
Summary: Optional commons logging tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: apache-commons-logging
Requires: apache-commons-logging
%requires_eq ant
%description -n ant-commons-logging
Apache Ant is a Java-based build tool.
This package contains optional commons logging tasks for Apache Ant.
%package -n ant-commons-net
Summary: Optional commons net tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: apache-commons-net
Requires: apache-commons-net
%requires_eq ant
%description -n ant-commons-net
Apache Ant is a Java-based build tool.
This package contains optional commons net tasks for Apache Ant.
%package -n ant-apache-bcel
Summary: Optional apache bcel tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: bcel
Requires: bcel
%requires_eq ant
Provides: ant-jakarta-bcel = %{version}
Obsoletes: ant-jakarta-bcel < %{version}
%description -n ant-apache-bcel
Apache Ant is a Java-based build tool.
This package contains optional apache bcel tasks for Apache Ant.
%package -n ant-apache-log4j
Summary: Optional apache log4j tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: reload4j
Requires: reload4j
%requires_eq ant
Provides: ant-jakarta-log4j = %{version}
Obsoletes: ant-jakarta-log4j < %{version}
%description -n ant-apache-log4j
Apache Ant is a Java-based build tool.
This package contains optional apache log4j tasks for Apache Ant.
%package -n ant-apache-oro
Summary: Optional apache oro tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: oro
Requires: oro
%requires_eq ant
Provides: ant-jakarta-oro = %{version}
Obsoletes: ant-jakarta-oro < %{version}
%description -n ant-apache-oro
Apache Ant is a Java-based build tool.
This package contains optional apache oro tasks for Apache Ant.
%package -n ant-apache-regexp
Summary: Optional apache regexp tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: regexp
Requires: regexp
%requires_eq ant
Provides: ant-jakarta-regexp = %{version}
Obsoletes: ant-jakarta-regexp < %{version}
%description -n ant-apache-regexp
Apache Ant is a Java-based build tool.
This package contains optional apache regexp tasks for Apache Ant.
%package -n ant-apache-xalan2
Summary: Optional apache xalan2 tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: regexp
BuildRequires: xalan-j2
Requires: regexp
%requires_eq ant
%description -n ant-apache-xalan2
Optional apache xalan2 tasks for %{name}.
%package -n ant-imageio
Summary: Optional imageio tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
%requires_eq ant
%description -n ant-imageio
Apache Ant is a Java-based build tool.
This package contains optional imageio tasks for Apache Ant.
%package -n ant-javamail
Summary: Optional javamail tasks for ant
License: CDDL-1.0
Group: Development/Tools/Building
BuildRequires: javamail >= 1.2-5jpp
Requires: javamail >= 1.2-5jpp
%requires_eq ant
%description -n ant-javamail
Apache Ant is a Java-based build tool.
This package contains optional javamail tasks for Apache Ant.
%package -n ant-jakartamail
Summary: Optional jakartamail tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jakarta-mail
Requires: jakarta-mail
%requires_eq ant
%description -n ant-jakartamail
Apache Ant is a Java-based build tool.
This package contains optional jakartamail tasks for Apache Ant.
%package -n ant-jdepend
Summary: Optional jdepend tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jdepend
Requires: jdepend
%requires_eq ant
%description -n ant-jdepend
Apache Ant is a Java-based build tool.
This package contains optional jdepend tasks for Apache Ant.
%package -n ant-jsch
Summary: Optional jsch tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jsch
Requires: jsch
%requires_eq ant
%description -n ant-jsch
Apache Ant is a Java-based build tool.
This package contains optional jsch tasks for Apache Ant.
%package -n ant-xz
Summary: Opional xz tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: xz-java
%requires_eq ant
%description -n ant-xz
Apache Ant is a Java-based build tool.
This package contains optional xz tasks for Apache Ant.
%package -n ant-testutil
Summary: Test utility classes for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: junit4
%requires_eq ant
%description -n ant-testutil
Test utility tasks for %{name}.
%package -n ant-manual
Summary: Manual for ant
License: Apache-2.0
Group: Development/Tools/Building
%description -n ant-manual
Apache Ant is a Java-based build tool.
This package contains the manual for Apache Ant.
%endif
%prep
%setup -q -n apache-ant-%{version}
#Fixup version
find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT//
find -name \*.jar -print -delete
# When bootstrapping, we don't have junit
%if %{with bootstrap}
%patch0 -p1
%endif
%patch1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
# clean jar files
find . -name "*.jar" -print -delete
# failing testcases. TODO see why
%if %{with antlr} || %{with junit}
rm src/tests/junit/org/apache/tools/mail/MailMessageTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/TestProcess.java
%endif
# Test relies on internal JUnit 5 API that was changed
rm src/tests/junit/org/apache/tools/ant/taskdefs/optional/junitlauncher/LegacyXmlResultFormatterTest.java
#install jars
%if %{with junit} || %{with junit5}
build-jar-repository -s -p lib/optional junit4
%endif
%if %{with junit5}
build-jar-repository -s -p lib/optional junit5 opentest4j
%endif
%if %{with antlr}
# we need to build junit in antlr, but we remove it later
build-jar-repository -s -p lib/optional xerces-j2 xml-commons-apis-bootstrap antlr-bootstrap bcel javamail/mailapi jdepend junit4 reload4j/reload4j oro regexp bsf commons-logging commons-net jsch xalan-j2 xalan-j2-serializer xml-resolver xz-java
%endif
# Fix file-not-utf8 rpmlint warning
iconv KEYS -f iso-8859-1 -t utf-8 -o KEYS.utf8
mv KEYS.utf8 KEYS
iconv LICENSE -f iso-8859-1 -t utf-8 -o LICENSE.utf8
mv LICENSE.utf8 LICENSE
# -----------------------------------------------------------------------------
%build
export OPT_JAR_LIST=:
%if %{with antlr} || %{with junit} || %{with junit5}
ant -Dbuild.sysclasspath=first jars test-jar
#remove empty jai and netrexx jars. Due to missing dependencies they contain only manifests.
rm -rf build/lib/ant-jai.jar build/lib/ant-netrexx.jar
%endif
%if %{with bootstrap}
export GC_MAXIMUM_HEAP_SIZE="134217728" #128M
export JAVA_HOME="%{java_home}"
sh -x ./build.sh --noconfig jars
%endif
%?strip_all_nondeterminism
%install
# ANT_HOME and subdirs
mkdir -p %{buildroot}%{ant_home}/{lib,etc}
# jars
install -d -m 755 %{buildroot}%{_javadir}/ant
install -d -m 755 %{buildroot}%{_mavenpomdir}
%if %{without junit} && %{without junit5}
rm build/lib/ant-junit*.jar
%else
%if %{without junit}
rm build/lib/ant-junit.jar
rm build/lib/ant-junit4.jar
%else
# empty in this scenario
rm build/lib/ant-junitlauncher.jar
%endif
# remove all others
for i in build/lib/ant-*.jar ; do
case $i in
*/ant-junit*)
;;
*)
rm -v $i
;;
esac
done
%endif
for jar in build/lib/*.jar
do
jarname=$(basename $jar .jar)
pomname="${jarname}.pom"
#Determine where to put it
case $jarname in
#These go into %%{_javadir}, pom files have different names
ant | ant-bootstrap | ant-launcher)
%if %{with bootstrap}
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";pomname="$jarname.pom"
%else
continue
%endif
;;
ant-jmf|ant-swing)
%if %{with bootstrap}
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";
%else
continue
%endif
;;
#Bootstracp builds an incomplete ant-foo jars, don't ship them
*)
%if %{with bootstrap}
continue
%else
#These go into %%{_javadir}/ant
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";
%endif
;;
esac
#instal jar
install -m 644 ${jar} ${destdir}/${jarname}.jar
# jar aliases
ln -sf ../../java/${destname}${jarname}.jar %{buildroot}%{ant_home}/lib/${jarname}.jar
#bootstrap does not have a pom
if [ "$jarname" = ant-bootstrap ]; then
mkdir -p src/etc/poms/${jarname}
sed -e "s#@VERSION@#%{version}#g" < %{SOURCE10} > src/etc/poms/${jarname}/pom.xml
fi
#install pom
%{mvn_install_pom} src/etc/poms/${jarname}/pom.xml %{buildroot}/%{_mavenpomdir}/${pomname}
if [ "$jarname" = ant-launcher ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -a ant:ant-launcher
elif [ "$jarname" = ant-jmf ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f jmf
elif [ "$jarname" = ant-swing ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f swing
elif [ "$jarname" = ant ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -a org.apache.ant:ant-nodeps,apache:ant,ant:ant
elif [ "$jarname" = ant-antlr -o "$jarname" = ant-bootstrap ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar
else
%if %{with junit} || %{with junit5}
%add_maven_depmap ${pomname} ${destname}${jarname}.jar
%else
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f ${jarname}
%endif
fi
done
%if %{with bootstrap}
# scripts: remove dos and os/2 scripts
rm -f src/script/*.bat
rm -f src/script/*.cmd
# XSLs
cp -p src/etc/*.xsl %{buildroot}%{ant_home}%{_sysconfdir}
rm -f %{buildroot}%{ant_home}%{_sysconfdir}/{maudit-frames,jdepend,jdepend-frames,junit-frames,junit-noframes}.xsl
%endif
%if %{with junit}
cp -p src/etc/{junit-noframes,junit-frames}.xsl %{buildroot}%{ant_home}%{_sysconfdir}
%endif
%if %{with antlr}
cp -p src/etc/{maudit-frames,jdepend,jdepend-frames}.xsl %{buildroot}%{ant_home}%{_sysconfdir}
%endif
%if %{with bootstrap}
# install everything else
mkdir -p %{buildroot}%{_bindir}
cp -p src/script/* %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_datadir}/%{name}/bin/
ln -sf %{_bindir}/antRun %{buildroot}/%{_datadir}/%{name}/bin/antRun
%endif
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
%if %{with bootstrap}
# default ant.conf
mkdir -p %{buildroot}%{_sysconfdir}
cp -p %{SOURCE1} %{buildroot}%{_sysconfdir}/ant.conf
# OPT_JAR_LIST fragments
echo "ant/ant-jmf" > %{buildroot}%{_sysconfdir}/%{name}.d/jmf
echo "ant/ant-swing" > %{buildroot}%{_sysconfdir}/%{name}.d/swing
%endif
%if %{with junit}
echo "junit ant/ant-junit" > %{buildroot}%{_sysconfdir}/ant.d/junit
echo "junit4 ant/ant-junit4" > %{buildroot}%{_sysconfdir}/ant.d/junit4
%endif
%if %{with junit5}
echo "junit5 hamcrest/core junit opentest4j univocity-parsers ant/ant-junitlauncher" > %{buildroot}%{_sysconfdir}/ant.d/junitlauncher
%endif
%if %{with antlr}
echo "antlr ant/ant-antlr" > %{buildroot}%{_sysconfdir}/ant.d/antlr
echo "rhino bsf ant/ant-apache-bsf" > %{buildroot}%{_sysconfdir}/ant.d/apache-bsf
echo "xml-resolver ant/ant-apache-resolver" > %{buildroot}%{_sysconfdir}/ant.d/apache-resolver
echo "apache-commons-logging ant/ant-commons-logging" > %{buildroot}%{_sysconfdir}/ant.d/commons-logging
echo "apache-commons-net ant/ant-commons-net" > %{buildroot}%{_sysconfdir}/ant.d/commons-net
echo "bcel ant/ant-apache-bcel" > %{buildroot}%{_sysconfdir}/ant.d/apache-bcel
echo "reload4j/reload4j ant/ant-apache-log4j" > %{buildroot}%{_sysconfdir}/ant.d/apache-log4j
echo "oro ant/ant-apache-oro" > %{buildroot}%{_sysconfdir}/ant.d/apache-oro
echo "regexp ant/ant-apache-regexp" > %{buildroot}%{_sysconfdir}/ant.d/apache-regexp
echo "xalan-j2 ant/ant-apache-xalan2" > %{buildroot}%{_sysconfdir}/ant.d/apache-xalan2
echo "ant/ant-imageio" > %{buildroot}%{_sysconfdir}/ant.d/imageio
echo "javamail jaf ant/ant-javamail" > %{buildroot}%{_sysconfdir}/ant.d/javamail
echo "jakartamail jaf ant/ant-jakartamail" > %{buildroot}%{_sysconfdir}/ant.d/jakartamail
echo "jdepend ant/ant-jdepend" > %{buildroot}%{_sysconfdir}/ant.d/jdepend
echo "jsch ant/ant-jsch" > %{buildroot}%{_sysconfdir}/ant.d/jsch
echo "xz-java ant/ant-xz" > %{buildroot}%{_sysconfdir}/ant.d/xz
echo "testutil ant/ant-testutil" > %{buildroot}%{_sysconfdir}/ant.d/testutil
%endif
%if %{with bootstrap}
find %{buildroot}%{_datadir}/ant%{_sysconfdir} -type f -name "*.xsl" \
-a ! -name ant-update.xsl \
-a ! -name changelog.xsl \
-a ! -name coverage-frames.xsl \
-a ! -name junit-frames-xalan1.xsl \
-a ! -name log.xsl \
-a ! -name mmetrics-frames.xsl \
-a ! -name tagdiff.xsl \
-print -delete
%endif
# remove *.orig
rm -rf %{buildroot}%{_bindir}/ant.orig
%if %{with bootstrap}
pushd %{buildroot}%{_javadir}
for i in ant-bootstrap ant-launcher ant; do
ln -sf ant/${i}.jar ${i}.jar
done
popd
%files -f .mfiles
%license LICENSE NOTICE
%doc KEYS README WHATSNEW
%config(noreplace) %{_sysconfdir}/%{name}.conf
%attr(0755,root,root) %{_bindir}/ant
%attr(0755,root,root) %{_bindir}/antRun
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-launcher.jar
%{_javadir}/%{name}-bootstrap.jar
%dir %{_javadir}/%{name}
%dir %{ant_home}
%dir %{ant_home}%{_sysconfdir}
%{ant_home}/bin
%{ant_home}%{_sysconfdir}/ant-update.xsl
%{ant_home}%{_sysconfdir}/changelog.xsl
%{ant_home}%{_sysconfdir}/coverage-frames.xsl
%{ant_home}%{_sysconfdir}/mmetrics-frames.xsl
%{ant_home}%{_sysconfdir}/log.xsl
%{ant_home}%{_sysconfdir}/tagdiff.xsl
%{ant_home}%{_sysconfdir}/junit-frames-xalan1.xsl
# % {ant_home}/etc/common2master.xsl
# % {ant_home}/etc/printFailingTests.xsl
%dir %{ant_home}/lib
%dir %{_sysconfdir}/%{name}.d
%{ant_home}/lib/ant.jar
%{ant_home}/lib/ant-bootstrap.jar
%{ant_home}/lib/ant-launcher.jar
%dir %{_sysconfdir}/ant.d
%endif
%if %{with antlr}
%files -f .mfiles
%{ant_home}/lib/ant-antlr.jar
%config(noreplace) %{_sysconfdir}/ant.d/antlr
%endif
%if %{with junit}
%files -f .mfiles
%{ant_home}/lib/ant-junit*.jar
%config(noreplace) %{_sysconfdir}/ant.d/junit
%config(noreplace) %{_sysconfdir}/ant.d/junit4
%{ant_home}%{_sysconfdir}/junit-frames.xsl
%{ant_home}%{_sysconfdir}/junit-noframes.xsl
%endif
%if %{with junit5}
%files -f .mfiles
%{ant_home}/lib/ant-junitlauncher.jar
%config(noreplace) %{_sysconfdir}/ant.d/junitlauncher
%endif
### Basic ant subpackages
%if %{with bootstrap}
%files -n ant-jmf -f .mfiles-jmf
%{ant_home}/lib/ant-jmf.jar
%config(noreplace) %{_sysconfdir}/ant.d/jmf
%files -n ant-swing -f .mfiles-swing
%{ant_home}/lib/ant-swing.jar
%config(noreplace) %{_sysconfdir}/ant.d/swing
%files -n ant-scripts
%defattr(0755,root,root,0755)
%{_bindir}/*.pl
%{_bindir}/*.py*
%endif #if bootstrap
%if %{with antlr}
%files -n ant-apache-bsf -f .mfiles-ant-apache-bsf
%{ant_home}/lib/ant-apache-bsf.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-bsf
%files -n ant-apache-resolver -f .mfiles-ant-apache-resolver
%{ant_home}/lib/ant-apache-resolver.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-resolver
%files -n ant-commons-logging -f .mfiles-ant-commons-logging
%{ant_home}/lib/ant-commons-logging.jar
%config(noreplace) %{_sysconfdir}/ant.d/commons-logging
%files -n ant-commons-net -f .mfiles-ant-commons-net
%{ant_home}/lib/ant-commons-net.jar
%config(noreplace) %{_sysconfdir}/ant.d/commons-net
%files -n ant-apache-bcel -f .mfiles-ant-apache-bcel
%{ant_home}/lib/ant-apache-bcel.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-bcel
%files -n ant-apache-log4j -f .mfiles-ant-apache-log4j
%{ant_home}/lib/ant-apache-log4j.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-log4j
%files -n ant-apache-oro -f .mfiles-ant-apache-oro
%{ant_home}/lib/ant-apache-oro.jar
%{ant_home}%{_sysconfdir}/maudit-frames.xsl
%config(noreplace) %{_sysconfdir}/ant.d/apache-oro
%files -n ant-apache-regexp -f .mfiles-ant-apache-regexp
%{ant_home}/lib/ant-apache-regexp.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-regexp
%files -n ant-apache-xalan2 -f .mfiles-ant-apache-xalan2
%{ant_home}/lib/ant-apache-xalan2.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-xalan2
%files -n ant-imageio -f .mfiles-ant-imageio
%{ant_home}/lib/ant-imageio.jar
%config(noreplace) %{_sysconfdir}/ant.d/imageio
%files -n ant-javamail -f .mfiles-ant-javamail
%{ant_home}/lib/ant-javamail.jar
%config(noreplace) %{_sysconfdir}/ant.d/javamail
%files -n ant-jakartamail -f .mfiles-ant-jakartamail
%{ant_home}/lib/ant-jakartamail.jar
%config(noreplace) %{_sysconfdir}/ant.d/jakartamail
%files -n ant-jdepend -f .mfiles-ant-jdepend
%{ant_home}/lib/ant-jdepend.jar
%config(noreplace) %{_sysconfdir}/ant.d/jdepend
%{ant_home}%{_sysconfdir}/jdepend.xsl
%{ant_home}%{_sysconfdir}/jdepend-frames.xsl
%files -n ant-jsch -f .mfiles-ant-jsch
%{ant_home}/lib/ant-jsch.jar
%config(noreplace) %{_sysconfdir}/ant.d/jsch
%files -n ant-xz -f .mfiles-ant-xz
%{ant_home}/lib/ant-xz.jar
%config(noreplace) %{_sysconfdir}/ant.d/xz
%files -n ant-testutil -f .mfiles-ant-testutil
%{ant_home}/lib/ant-testutil.jar
%config(noreplace) %{_sysconfdir}/ant.d/testutil
%files -n ant-manual
%doc manual/*
%endif
%changelog

10
ant-bootstrap.pom.in Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<url>http://ant.apache.org/</url>
<groupId>org.apache.ant</groupId>
<artifactId>ant-bootstrap</artifactId>
<version>@VERSION@</version>
</project>

1076
ant-junit.changes Normal file

File diff suppressed because it is too large Load Diff

770
ant-junit.spec Normal file
View File

@ -0,0 +1,770 @@
#
# spec file for package ant-junit
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2000-2009, JPackage Project
#
# 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 ant_home %{_datadir}/ant
##### WARNING: please do not edit this auto generated spec file. Use the ant.spec! #####
%bcond_with bootstrap
%bcond_without junit
%bcond_with junit5
%bcond_with antlr
Name: ant-junit
Version: 1.10.14
Release: 0
Summary: Optional junit tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
URL: https://ant.apache.org/
Source0: https://www.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.xz
Source1: apache-ant-1.8.ant.conf
Source10: ant-bootstrap.pom.in
Source1000: pre_checkin.sh
Source1001: https://www.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.xz.asc
Source1002: ant.keyring
Patch0: apache-ant-no-test-jar.patch
Patch1: apache-ant-class-path-in-manifest.patch
Patch2: apache-ant-bootstrap.patch
#PATCH-FEATURE-OPENSUSE bmwiedemann -- have fixed build dates
Patch3: reproducible-build-date.patch
# PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest
Patch5: reproducible-build-manifest.patch
Patch6: apache-ant-xml-apis.patch
# PATCH-FEATURE-OPENSUSE debian patch to use SOURCE_DATE_EPOCH for timestamp in property files
Patch7: reproducible-propertyfile-task.patch
BuildRequires: antlr-bootstrap
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local >= 6
BuildRequires: unzip
BuildRequires: xml-commons-apis-bootstrap
#!BuildIgnore: xml-commons-apis
BuildArch: noarch
# Needed for maven conversions
%if !%{with bootstrap}
BuildRequires: javapackages-local
%endif
%if %{with junit} || %{with antlr} || %{with junit5}
BuildRequires: ant = %{version}
BuildRequires: hamcrest
BuildRequires: junit
#!BuildIgnore: antlr
%endif
%if %{with antlr}
BuildRequires: xerces-j2
BuildRequires: xz-java
%endif
%if %{with junit5}
BuildRequires: apiguardian
BuildRequires: junit5
%endif
%if 0%{?suse_version} > 1320
BuildRequires: strip-nondeterminism
%endif
%if %{with bootstrap}
Requires: java-devel >= 1.8
Requires: javapackages-tools
Requires: xerces-j2
Requires: xml-apis
Requires: xml-resolver
Obsoletes: apache-ant < %{version}
Provides: apache-ant = %{version}
Obsoletes: ant-nodeps < %{version}
Provides: ant-nodeps = %{version}
Obsoletes: ant-trax < %{version}
Provides: ant-trax = %{version}
%endif
%if %{with antlr}
Requires: antlr
%requires_eq ant
Obsoletes: ant-javadoc
%endif
%if %{with junit}
Requires: junit4
%requires_eq ant
%endif
%if %{with junit5}
Requires: junit5
%requires_eq ant
%endif
%if %{with junit}
%description
Apache Ant is a Java-based build tool.
This package contains optional JUnit tasks for Apache Ant.
%elif %{with junit5}
%description
Apache Ant is a Java-based build tool.
This package contains optional JUnit5 tasks for Apache Ant.
%else
%description
Apache Ant is a Java-based build tool. In theory, it is kind of like
Make. Build description files are written in XML.
%endif
%if %{with bootstrap}
%package -n ant-jmf
Summary: Optional jmf tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
%description -n ant-jmf
Apache Ant is a Java-based build tool.
This package contains optional jmf tasks for Apache Ant.
%package -n ant-swing
Summary: Optional swing tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
%description -n ant-swing
Apache Ant is a Java-based build tool.
This package contains optional swing tasks for Apache Ant.
%package -n ant-scripts
Summary: Additional scripts for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
Requires: perl
Requires: python3-base
%description -n ant-scripts
Apache Ant is a Java-based build tool.
This package contains additional perl and python scripts for Apache
Ant.
%endif #if bootstrap
%if %{with antlr}
%package -n ant-apache-bsf
Summary: Optional apache bsf tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: bsf
Requires: bsf
%requires_eq ant
%description -n ant-apache-bsf
Apache Ant is a Java-based build tool.
This package contains optional apache bsf tasks for Apache Ant.
%package -n ant-apache-resolver
Summary: Optional apache resolver tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: xml-resolver
Requires: xml-resolver
%requires_eq ant
%description -n ant-apache-resolver
Apache Ant is a Java-based build tool.
This package contains optional apache resolver tasks for Apache Ant.
%package -n ant-commons-logging
Summary: Optional commons logging tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: apache-commons-logging
Requires: apache-commons-logging
%requires_eq ant
%description -n ant-commons-logging
Apache Ant is a Java-based build tool.
This package contains optional commons logging tasks for Apache Ant.
%package -n ant-commons-net
Summary: Optional commons net tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: apache-commons-net
Requires: apache-commons-net
%requires_eq ant
%description -n ant-commons-net
Apache Ant is a Java-based build tool.
This package contains optional commons net tasks for Apache Ant.
%package -n ant-apache-bcel
Summary: Optional apache bcel tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: bcel
Requires: bcel
%requires_eq ant
Provides: ant-jakarta-bcel = %{version}
Obsoletes: ant-jakarta-bcel < %{version}
%description -n ant-apache-bcel
Apache Ant is a Java-based build tool.
This package contains optional apache bcel tasks for Apache Ant.
%package -n ant-apache-log4j
Summary: Optional apache log4j tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: reload4j
Requires: reload4j
%requires_eq ant
Provides: ant-jakarta-log4j = %{version}
Obsoletes: ant-jakarta-log4j < %{version}
%description -n ant-apache-log4j
Apache Ant is a Java-based build tool.
This package contains optional apache log4j tasks for Apache Ant.
%package -n ant-apache-oro
Summary: Optional apache oro tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: oro
Requires: oro
%requires_eq ant
Provides: ant-jakarta-oro = %{version}
Obsoletes: ant-jakarta-oro < %{version}
%description -n ant-apache-oro
Apache Ant is a Java-based build tool.
This package contains optional apache oro tasks for Apache Ant.
%package -n ant-apache-regexp
Summary: Optional apache regexp tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: regexp
Requires: regexp
%requires_eq ant
Provides: ant-jakarta-regexp = %{version}
Obsoletes: ant-jakarta-regexp < %{version}
%description -n ant-apache-regexp
Apache Ant is a Java-based build tool.
This package contains optional apache regexp tasks for Apache Ant.
%package -n ant-apache-xalan2
Summary: Optional apache xalan2 tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: regexp
BuildRequires: xalan-j2
Requires: regexp
%requires_eq ant
%description -n ant-apache-xalan2
Optional apache xalan2 tasks for %{name}.
%package -n ant-imageio
Summary: Optional imageio tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
%requires_eq ant
%description -n ant-imageio
Apache Ant is a Java-based build tool.
This package contains optional imageio tasks for Apache Ant.
%package -n ant-javamail
Summary: Optional javamail tasks for ant
License: CDDL-1.0
Group: Development/Tools/Building
BuildRequires: javamail >= 1.2-5jpp
Requires: javamail >= 1.2-5jpp
%requires_eq ant
%description -n ant-javamail
Apache Ant is a Java-based build tool.
This package contains optional javamail tasks for Apache Ant.
%package -n ant-jakartamail
Summary: Optional jakartamail tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jakarta-mail
Requires: jakarta-mail
%requires_eq ant
%description -n ant-jakartamail
Apache Ant is a Java-based build tool.
This package contains optional jakartamail tasks for Apache Ant.
%package -n ant-jdepend
Summary: Optional jdepend tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jdepend
Requires: jdepend
%requires_eq ant
%description -n ant-jdepend
Apache Ant is a Java-based build tool.
This package contains optional jdepend tasks for Apache Ant.
%package -n ant-jsch
Summary: Optional jsch tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jsch
Requires: jsch
%requires_eq ant
%description -n ant-jsch
Apache Ant is a Java-based build tool.
This package contains optional jsch tasks for Apache Ant.
%package -n ant-xz
Summary: Opional xz tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: xz-java
%requires_eq ant
%description -n ant-xz
Apache Ant is a Java-based build tool.
This package contains optional xz tasks for Apache Ant.
%package -n ant-testutil
Summary: Test utility classes for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: junit4
%requires_eq ant
%description -n ant-testutil
Test utility tasks for %{name}.
%package -n ant-manual
Summary: Manual for ant
License: Apache-2.0
Group: Development/Tools/Building
%description -n ant-manual
Apache Ant is a Java-based build tool.
This package contains the manual for Apache Ant.
%endif
%prep
%setup -q -n apache-ant-%{version}
#Fixup version
find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT//
find -name \*.jar -print -delete
# When bootstrapping, we don't have junit
%if %{with bootstrap}
%patch0 -p1
%endif
%patch1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
# clean jar files
find . -name "*.jar" -print -delete
# failing testcases. TODO see why
%if %{with antlr} || %{with junit}
rm src/tests/junit/org/apache/tools/mail/MailMessageTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/TestProcess.java
%endif
# Test relies on internal JUnit 5 API that was changed
rm src/tests/junit/org/apache/tools/ant/taskdefs/optional/junitlauncher/LegacyXmlResultFormatterTest.java
#install jars
%if %{with junit} || %{with junit5}
build-jar-repository -s -p lib/optional junit4
%endif
%if %{with junit5}
build-jar-repository -s -p lib/optional junit5 opentest4j
%endif
%if %{with antlr}
# we need to build junit in antlr, but we remove it later
build-jar-repository -s -p lib/optional xerces-j2 xml-commons-apis-bootstrap antlr-bootstrap bcel javamail/mailapi jdepend junit4 reload4j/reload4j oro regexp bsf commons-logging commons-net jsch xalan-j2 xalan-j2-serializer xml-resolver xz-java
%endif
# Fix file-not-utf8 rpmlint warning
iconv KEYS -f iso-8859-1 -t utf-8 -o KEYS.utf8
mv KEYS.utf8 KEYS
iconv LICENSE -f iso-8859-1 -t utf-8 -o LICENSE.utf8
mv LICENSE.utf8 LICENSE
# -----------------------------------------------------------------------------
%build
export OPT_JAR_LIST=:
%if %{with antlr} || %{with junit} || %{with junit5}
ant -Dbuild.sysclasspath=first jars test-jar
#remove empty jai and netrexx jars. Due to missing dependencies they contain only manifests.
rm -rf build/lib/ant-jai.jar build/lib/ant-netrexx.jar
%endif
%if %{with bootstrap}
export GC_MAXIMUM_HEAP_SIZE="134217728" #128M
export JAVA_HOME="%{java_home}"
sh -x ./build.sh --noconfig jars
%endif
%?strip_all_nondeterminism
%install
# ANT_HOME and subdirs
mkdir -p %{buildroot}%{ant_home}/{lib,etc}
# jars
install -d -m 755 %{buildroot}%{_javadir}/ant
install -d -m 755 %{buildroot}%{_mavenpomdir}
%if %{without junit} && %{without junit5}
rm build/lib/ant-junit*.jar
%else
%if %{without junit}
rm build/lib/ant-junit.jar
rm build/lib/ant-junit4.jar
%else
# empty in this scenario
rm build/lib/ant-junitlauncher.jar
%endif
# remove all others
for i in build/lib/ant-*.jar ; do
case $i in
*/ant-junit*)
;;
*)
rm -v $i
;;
esac
done
%endif
for jar in build/lib/*.jar
do
jarname=$(basename $jar .jar)
pomname="${jarname}.pom"
#Determine where to put it
case $jarname in
#These go into %%{_javadir}, pom files have different names
ant | ant-bootstrap | ant-launcher)
%if %{with bootstrap}
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";pomname="$jarname.pom"
%else
continue
%endif
;;
ant-jmf|ant-swing)
%if %{with bootstrap}
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";
%else
continue
%endif
;;
#Bootstracp builds an incomplete ant-foo jars, don't ship them
*)
%if %{with bootstrap}
continue
%else
#These go into %%{_javadir}/ant
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";
%endif
;;
esac
#instal jar
install -m 644 ${jar} ${destdir}/${jarname}.jar
# jar aliases
ln -sf ../../java/${destname}${jarname}.jar %{buildroot}%{ant_home}/lib/${jarname}.jar
#bootstrap does not have a pom
if [ "$jarname" = ant-bootstrap ]; then
mkdir -p src/etc/poms/${jarname}
sed -e "s#@VERSION@#%{version}#g" < %{SOURCE10} > src/etc/poms/${jarname}/pom.xml
fi
#install pom
%{mvn_install_pom} src/etc/poms/${jarname}/pom.xml %{buildroot}/%{_mavenpomdir}/${pomname}
if [ "$jarname" = ant-launcher ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -a ant:ant-launcher
elif [ "$jarname" = ant-jmf ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f jmf
elif [ "$jarname" = ant-swing ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f swing
elif [ "$jarname" = ant ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -a org.apache.ant:ant-nodeps,apache:ant,ant:ant
elif [ "$jarname" = ant-antlr -o "$jarname" = ant-bootstrap ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar
else
%if %{with junit} || %{with junit5}
%add_maven_depmap ${pomname} ${destname}${jarname}.jar
%else
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f ${jarname}
%endif
fi
done
%if %{with bootstrap}
# scripts: remove dos and os/2 scripts
rm -f src/script/*.bat
rm -f src/script/*.cmd
# XSLs
cp -p src/etc/*.xsl %{buildroot}%{ant_home}%{_sysconfdir}
rm -f %{buildroot}%{ant_home}%{_sysconfdir}/{maudit-frames,jdepend,jdepend-frames,junit-frames,junit-noframes}.xsl
%endif
%if %{with junit}
cp -p src/etc/{junit-noframes,junit-frames}.xsl %{buildroot}%{ant_home}%{_sysconfdir}
%endif
%if %{with antlr}
cp -p src/etc/{maudit-frames,jdepend,jdepend-frames}.xsl %{buildroot}%{ant_home}%{_sysconfdir}
%endif
%if %{with bootstrap}
# install everything else
mkdir -p %{buildroot}%{_bindir}
cp -p src/script/* %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_datadir}/%{name}/bin/
ln -sf %{_bindir}/antRun %{buildroot}/%{_datadir}/%{name}/bin/antRun
%endif
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
%if %{with bootstrap}
# default ant.conf
mkdir -p %{buildroot}%{_sysconfdir}
cp -p %{SOURCE1} %{buildroot}%{_sysconfdir}/ant.conf
# OPT_JAR_LIST fragments
echo "ant/ant-jmf" > %{buildroot}%{_sysconfdir}/%{name}.d/jmf
echo "ant/ant-swing" > %{buildroot}%{_sysconfdir}/%{name}.d/swing
%endif
%if %{with junit}
echo "junit ant/ant-junit" > %{buildroot}%{_sysconfdir}/ant.d/junit
echo "junit4 ant/ant-junit4" > %{buildroot}%{_sysconfdir}/ant.d/junit4
%endif
%if %{with junit5}
echo "junit5 hamcrest/core junit opentest4j univocity-parsers ant/ant-junitlauncher" > %{buildroot}%{_sysconfdir}/ant.d/junitlauncher
%endif
%if %{with antlr}
echo "antlr ant/ant-antlr" > %{buildroot}%{_sysconfdir}/ant.d/antlr
echo "rhino bsf ant/ant-apache-bsf" > %{buildroot}%{_sysconfdir}/ant.d/apache-bsf
echo "xml-resolver ant/ant-apache-resolver" > %{buildroot}%{_sysconfdir}/ant.d/apache-resolver
echo "apache-commons-logging ant/ant-commons-logging" > %{buildroot}%{_sysconfdir}/ant.d/commons-logging
echo "apache-commons-net ant/ant-commons-net" > %{buildroot}%{_sysconfdir}/ant.d/commons-net
echo "bcel ant/ant-apache-bcel" > %{buildroot}%{_sysconfdir}/ant.d/apache-bcel
echo "reload4j/reload4j ant/ant-apache-log4j" > %{buildroot}%{_sysconfdir}/ant.d/apache-log4j
echo "oro ant/ant-apache-oro" > %{buildroot}%{_sysconfdir}/ant.d/apache-oro
echo "regexp ant/ant-apache-regexp" > %{buildroot}%{_sysconfdir}/ant.d/apache-regexp
echo "xalan-j2 ant/ant-apache-xalan2" > %{buildroot}%{_sysconfdir}/ant.d/apache-xalan2
echo "ant/ant-imageio" > %{buildroot}%{_sysconfdir}/ant.d/imageio
echo "javamail jaf ant/ant-javamail" > %{buildroot}%{_sysconfdir}/ant.d/javamail
echo "jakartamail jaf ant/ant-jakartamail" > %{buildroot}%{_sysconfdir}/ant.d/jakartamail
echo "jdepend ant/ant-jdepend" > %{buildroot}%{_sysconfdir}/ant.d/jdepend
echo "jsch ant/ant-jsch" > %{buildroot}%{_sysconfdir}/ant.d/jsch
echo "xz-java ant/ant-xz" > %{buildroot}%{_sysconfdir}/ant.d/xz
echo "testutil ant/ant-testutil" > %{buildroot}%{_sysconfdir}/ant.d/testutil
%endif
%if %{with bootstrap}
find %{buildroot}%{_datadir}/ant%{_sysconfdir} -type f -name "*.xsl" \
-a ! -name ant-update.xsl \
-a ! -name changelog.xsl \
-a ! -name coverage-frames.xsl \
-a ! -name junit-frames-xalan1.xsl \
-a ! -name log.xsl \
-a ! -name mmetrics-frames.xsl \
-a ! -name tagdiff.xsl \
-print -delete
%endif
# remove *.orig
rm -rf %{buildroot}%{_bindir}/ant.orig
%if %{with bootstrap}
pushd %{buildroot}%{_javadir}
for i in ant-bootstrap ant-launcher ant; do
ln -sf ant/${i}.jar ${i}.jar
done
popd
%files -f .mfiles
%license LICENSE NOTICE
%doc KEYS README WHATSNEW
%config(noreplace) %{_sysconfdir}/%{name}.conf
%attr(0755,root,root) %{_bindir}/ant
%attr(0755,root,root) %{_bindir}/antRun
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-launcher.jar
%{_javadir}/%{name}-bootstrap.jar
%dir %{_javadir}/%{name}
%dir %{ant_home}
%dir %{ant_home}%{_sysconfdir}
%{ant_home}/bin
%{ant_home}%{_sysconfdir}/ant-update.xsl
%{ant_home}%{_sysconfdir}/changelog.xsl
%{ant_home}%{_sysconfdir}/coverage-frames.xsl
%{ant_home}%{_sysconfdir}/mmetrics-frames.xsl
%{ant_home}%{_sysconfdir}/log.xsl
%{ant_home}%{_sysconfdir}/tagdiff.xsl
%{ant_home}%{_sysconfdir}/junit-frames-xalan1.xsl
# % {ant_home}/etc/common2master.xsl
# % {ant_home}/etc/printFailingTests.xsl
%dir %{ant_home}/lib
%dir %{_sysconfdir}/%{name}.d
%{ant_home}/lib/ant.jar
%{ant_home}/lib/ant-bootstrap.jar
%{ant_home}/lib/ant-launcher.jar
%dir %{_sysconfdir}/ant.d
%endif
%if %{with antlr}
%files -f .mfiles
%{ant_home}/lib/ant-antlr.jar
%config(noreplace) %{_sysconfdir}/ant.d/antlr
%endif
%if %{with junit}
%files -f .mfiles
%{ant_home}/lib/ant-junit*.jar
%config(noreplace) %{_sysconfdir}/ant.d/junit
%config(noreplace) %{_sysconfdir}/ant.d/junit4
%{ant_home}%{_sysconfdir}/junit-frames.xsl
%{ant_home}%{_sysconfdir}/junit-noframes.xsl
%endif
%if %{with junit5}
%files -f .mfiles
%{ant_home}/lib/ant-junitlauncher.jar
%config(noreplace) %{_sysconfdir}/ant.d/junitlauncher
%endif
### Basic ant subpackages
%if %{with bootstrap}
%files -n ant-jmf -f .mfiles-jmf
%{ant_home}/lib/ant-jmf.jar
%config(noreplace) %{_sysconfdir}/ant.d/jmf
%files -n ant-swing -f .mfiles-swing
%{ant_home}/lib/ant-swing.jar
%config(noreplace) %{_sysconfdir}/ant.d/swing
%files -n ant-scripts
%defattr(0755,root,root,0755)
%{_bindir}/*.pl
%{_bindir}/*.py*
%endif #if bootstrap
%if %{with antlr}
%files -n ant-apache-bsf -f .mfiles-ant-apache-bsf
%{ant_home}/lib/ant-apache-bsf.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-bsf
%files -n ant-apache-resolver -f .mfiles-ant-apache-resolver
%{ant_home}/lib/ant-apache-resolver.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-resolver
%files -n ant-commons-logging -f .mfiles-ant-commons-logging
%{ant_home}/lib/ant-commons-logging.jar
%config(noreplace) %{_sysconfdir}/ant.d/commons-logging
%files -n ant-commons-net -f .mfiles-ant-commons-net
%{ant_home}/lib/ant-commons-net.jar
%config(noreplace) %{_sysconfdir}/ant.d/commons-net
%files -n ant-apache-bcel -f .mfiles-ant-apache-bcel
%{ant_home}/lib/ant-apache-bcel.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-bcel
%files -n ant-apache-log4j -f .mfiles-ant-apache-log4j
%{ant_home}/lib/ant-apache-log4j.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-log4j
%files -n ant-apache-oro -f .mfiles-ant-apache-oro
%{ant_home}/lib/ant-apache-oro.jar
%{ant_home}%{_sysconfdir}/maudit-frames.xsl
%config(noreplace) %{_sysconfdir}/ant.d/apache-oro
%files -n ant-apache-regexp -f .mfiles-ant-apache-regexp
%{ant_home}/lib/ant-apache-regexp.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-regexp
%files -n ant-apache-xalan2 -f .mfiles-ant-apache-xalan2
%{ant_home}/lib/ant-apache-xalan2.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-xalan2
%files -n ant-imageio -f .mfiles-ant-imageio
%{ant_home}/lib/ant-imageio.jar
%config(noreplace) %{_sysconfdir}/ant.d/imageio
%files -n ant-javamail -f .mfiles-ant-javamail
%{ant_home}/lib/ant-javamail.jar
%config(noreplace) %{_sysconfdir}/ant.d/javamail
%files -n ant-jakartamail -f .mfiles-ant-jakartamail
%{ant_home}/lib/ant-jakartamail.jar
%config(noreplace) %{_sysconfdir}/ant.d/jakartamail
%files -n ant-jdepend -f .mfiles-ant-jdepend
%{ant_home}/lib/ant-jdepend.jar
%config(noreplace) %{_sysconfdir}/ant.d/jdepend
%{ant_home}%{_sysconfdir}/jdepend.xsl
%{ant_home}%{_sysconfdir}/jdepend-frames.xsl
%files -n ant-jsch -f .mfiles-ant-jsch
%{ant_home}/lib/ant-jsch.jar
%config(noreplace) %{_sysconfdir}/ant.d/jsch
%files -n ant-xz -f .mfiles-ant-xz
%{ant_home}/lib/ant-xz.jar
%config(noreplace) %{_sysconfdir}/ant.d/xz
%files -n ant-testutil -f .mfiles-ant-testutil
%{ant_home}/lib/ant-testutil.jar
%config(noreplace) %{_sysconfdir}/ant.d/testutil
%files -n ant-manual
%doc manual/*
%endif
%changelog

1076
ant-junit5.changes Normal file

File diff suppressed because it is too large Load Diff

770
ant-junit5.spec Normal file
View File

@ -0,0 +1,770 @@
#
# spec file for package ant-junit5
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2000-2009, JPackage Project
#
# 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 ant_home %{_datadir}/ant
##### WARNING: please do not edit this auto generated spec file. Use the ant.spec! #####
%bcond_with bootstrap
%bcond_with junit
%bcond_without junit5
%bcond_with antlr
Name: ant-junit5
Version: 1.10.14
Release: 0
Summary: Optional junit tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
URL: https://ant.apache.org/
Source0: https://www.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.xz
Source1: apache-ant-1.8.ant.conf
Source10: ant-bootstrap.pom.in
Source1000: pre_checkin.sh
Source1001: https://www.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.xz.asc
Source1002: ant.keyring
Patch0: apache-ant-no-test-jar.patch
Patch1: apache-ant-class-path-in-manifest.patch
Patch2: apache-ant-bootstrap.patch
#PATCH-FEATURE-OPENSUSE bmwiedemann -- have fixed build dates
Patch3: reproducible-build-date.patch
# PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest
Patch5: reproducible-build-manifest.patch
Patch6: apache-ant-xml-apis.patch
# PATCH-FEATURE-OPENSUSE debian patch to use SOURCE_DATE_EPOCH for timestamp in property files
Patch7: reproducible-propertyfile-task.patch
BuildRequires: antlr-bootstrap
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local >= 6
BuildRequires: unzip
BuildRequires: xml-commons-apis-bootstrap
#!BuildIgnore: xml-commons-apis
BuildArch: noarch
# Needed for maven conversions
%if !%{with bootstrap}
BuildRequires: javapackages-local
%endif
%if %{with junit} || %{with antlr} || %{with junit5}
BuildRequires: ant = %{version}
BuildRequires: hamcrest
BuildRequires: junit
#!BuildIgnore: antlr
%endif
%if %{with antlr}
BuildRequires: xerces-j2
BuildRequires: xz-java
%endif
%if %{with junit5}
BuildRequires: apiguardian
BuildRequires: junit5
%endif
%if 0%{?suse_version} > 1320
BuildRequires: strip-nondeterminism
%endif
%if %{with bootstrap}
Requires: java-devel >= 1.8
Requires: javapackages-tools
Requires: xerces-j2
Requires: xml-apis
Requires: xml-resolver
Obsoletes: apache-ant < %{version}
Provides: apache-ant = %{version}
Obsoletes: ant-nodeps < %{version}
Provides: ant-nodeps = %{version}
Obsoletes: ant-trax < %{version}
Provides: ant-trax = %{version}
%endif
%if %{with antlr}
Requires: antlr
%requires_eq ant
Obsoletes: ant-javadoc
%endif
%if %{with junit}
Requires: junit4
%requires_eq ant
%endif
%if %{with junit5}
Requires: junit5
%requires_eq ant
%endif
%if %{with junit}
%description
Apache Ant is a Java-based build tool.
This package contains optional JUnit tasks for Apache Ant.
%elif %{with junit5}
%description
Apache Ant is a Java-based build tool.
This package contains optional JUnit5 tasks for Apache Ant.
%else
%description
Apache Ant is a Java-based build tool. In theory, it is kind of like
Make. Build description files are written in XML.
%endif
%if %{with bootstrap}
%package -n ant-jmf
Summary: Optional jmf tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
%description -n ant-jmf
Apache Ant is a Java-based build tool.
This package contains optional jmf tasks for Apache Ant.
%package -n ant-swing
Summary: Optional swing tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
%description -n ant-swing
Apache Ant is a Java-based build tool.
This package contains optional swing tasks for Apache Ant.
%package -n ant-scripts
Summary: Additional scripts for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
Requires: perl
Requires: python3-base
%description -n ant-scripts
Apache Ant is a Java-based build tool.
This package contains additional perl and python scripts for Apache
Ant.
%endif #if bootstrap
%if %{with antlr}
%package -n ant-apache-bsf
Summary: Optional apache bsf tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: bsf
Requires: bsf
%requires_eq ant
%description -n ant-apache-bsf
Apache Ant is a Java-based build tool.
This package contains optional apache bsf tasks for Apache Ant.
%package -n ant-apache-resolver
Summary: Optional apache resolver tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: xml-resolver
Requires: xml-resolver
%requires_eq ant
%description -n ant-apache-resolver
Apache Ant is a Java-based build tool.
This package contains optional apache resolver tasks for Apache Ant.
%package -n ant-commons-logging
Summary: Optional commons logging tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: apache-commons-logging
Requires: apache-commons-logging
%requires_eq ant
%description -n ant-commons-logging
Apache Ant is a Java-based build tool.
This package contains optional commons logging tasks for Apache Ant.
%package -n ant-commons-net
Summary: Optional commons net tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: apache-commons-net
Requires: apache-commons-net
%requires_eq ant
%description -n ant-commons-net
Apache Ant is a Java-based build tool.
This package contains optional commons net tasks for Apache Ant.
%package -n ant-apache-bcel
Summary: Optional apache bcel tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: bcel
Requires: bcel
%requires_eq ant
Provides: ant-jakarta-bcel = %{version}
Obsoletes: ant-jakarta-bcel < %{version}
%description -n ant-apache-bcel
Apache Ant is a Java-based build tool.
This package contains optional apache bcel tasks for Apache Ant.
%package -n ant-apache-log4j
Summary: Optional apache log4j tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: reload4j
Requires: reload4j
%requires_eq ant
Provides: ant-jakarta-log4j = %{version}
Obsoletes: ant-jakarta-log4j < %{version}
%description -n ant-apache-log4j
Apache Ant is a Java-based build tool.
This package contains optional apache log4j tasks for Apache Ant.
%package -n ant-apache-oro
Summary: Optional apache oro tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: oro
Requires: oro
%requires_eq ant
Provides: ant-jakarta-oro = %{version}
Obsoletes: ant-jakarta-oro < %{version}
%description -n ant-apache-oro
Apache Ant is a Java-based build tool.
This package contains optional apache oro tasks for Apache Ant.
%package -n ant-apache-regexp
Summary: Optional apache regexp tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: regexp
Requires: regexp
%requires_eq ant
Provides: ant-jakarta-regexp = %{version}
Obsoletes: ant-jakarta-regexp < %{version}
%description -n ant-apache-regexp
Apache Ant is a Java-based build tool.
This package contains optional apache regexp tasks for Apache Ant.
%package -n ant-apache-xalan2
Summary: Optional apache xalan2 tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: regexp
BuildRequires: xalan-j2
Requires: regexp
%requires_eq ant
%description -n ant-apache-xalan2
Optional apache xalan2 tasks for %{name}.
%package -n ant-imageio
Summary: Optional imageio tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
%requires_eq ant
%description -n ant-imageio
Apache Ant is a Java-based build tool.
This package contains optional imageio tasks for Apache Ant.
%package -n ant-javamail
Summary: Optional javamail tasks for ant
License: CDDL-1.0
Group: Development/Tools/Building
BuildRequires: javamail >= 1.2-5jpp
Requires: javamail >= 1.2-5jpp
%requires_eq ant
%description -n ant-javamail
Apache Ant is a Java-based build tool.
This package contains optional javamail tasks for Apache Ant.
%package -n ant-jakartamail
Summary: Optional jakartamail tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jakarta-mail
Requires: jakarta-mail
%requires_eq ant
%description -n ant-jakartamail
Apache Ant is a Java-based build tool.
This package contains optional jakartamail tasks for Apache Ant.
%package -n ant-jdepend
Summary: Optional jdepend tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jdepend
Requires: jdepend
%requires_eq ant
%description -n ant-jdepend
Apache Ant is a Java-based build tool.
This package contains optional jdepend tasks for Apache Ant.
%package -n ant-jsch
Summary: Optional jsch tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jsch
Requires: jsch
%requires_eq ant
%description -n ant-jsch
Apache Ant is a Java-based build tool.
This package contains optional jsch tasks for Apache Ant.
%package -n ant-xz
Summary: Opional xz tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: xz-java
%requires_eq ant
%description -n ant-xz
Apache Ant is a Java-based build tool.
This package contains optional xz tasks for Apache Ant.
%package -n ant-testutil
Summary: Test utility classes for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: junit4
%requires_eq ant
%description -n ant-testutil
Test utility tasks for %{name}.
%package -n ant-manual
Summary: Manual for ant
License: Apache-2.0
Group: Development/Tools/Building
%description -n ant-manual
Apache Ant is a Java-based build tool.
This package contains the manual for Apache Ant.
%endif
%prep
%setup -q -n apache-ant-%{version}
#Fixup version
find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT//
find -name \*.jar -print -delete
# When bootstrapping, we don't have junit
%if %{with bootstrap}
%patch0 -p1
%endif
%patch1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
# clean jar files
find . -name "*.jar" -print -delete
# failing testcases. TODO see why
%if %{with antlr} || %{with junit}
rm src/tests/junit/org/apache/tools/mail/MailMessageTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/TestProcess.java
%endif
# Test relies on internal JUnit 5 API that was changed
rm src/tests/junit/org/apache/tools/ant/taskdefs/optional/junitlauncher/LegacyXmlResultFormatterTest.java
#install jars
%if %{with junit} || %{with junit5}
build-jar-repository -s -p lib/optional junit4
%endif
%if %{with junit5}
build-jar-repository -s -p lib/optional junit5 opentest4j
%endif
%if %{with antlr}
# we need to build junit in antlr, but we remove it later
build-jar-repository -s -p lib/optional xerces-j2 xml-commons-apis-bootstrap antlr-bootstrap bcel javamail/mailapi jdepend junit4 reload4j/reload4j oro regexp bsf commons-logging commons-net jsch xalan-j2 xalan-j2-serializer xml-resolver xz-java
%endif
# Fix file-not-utf8 rpmlint warning
iconv KEYS -f iso-8859-1 -t utf-8 -o KEYS.utf8
mv KEYS.utf8 KEYS
iconv LICENSE -f iso-8859-1 -t utf-8 -o LICENSE.utf8
mv LICENSE.utf8 LICENSE
# -----------------------------------------------------------------------------
%build
export OPT_JAR_LIST=:
%if %{with antlr} || %{with junit} || %{with junit5}
ant -Dbuild.sysclasspath=first jars test-jar
#remove empty jai and netrexx jars. Due to missing dependencies they contain only manifests.
rm -rf build/lib/ant-jai.jar build/lib/ant-netrexx.jar
%endif
%if %{with bootstrap}
export GC_MAXIMUM_HEAP_SIZE="134217728" #128M
export JAVA_HOME="%{java_home}"
sh -x ./build.sh --noconfig jars
%endif
%?strip_all_nondeterminism
%install
# ANT_HOME and subdirs
mkdir -p %{buildroot}%{ant_home}/{lib,etc}
# jars
install -d -m 755 %{buildroot}%{_javadir}/ant
install -d -m 755 %{buildroot}%{_mavenpomdir}
%if %{without junit} && %{without junit5}
rm build/lib/ant-junit*.jar
%else
%if %{without junit}
rm build/lib/ant-junit.jar
rm build/lib/ant-junit4.jar
%else
# empty in this scenario
rm build/lib/ant-junitlauncher.jar
%endif
# remove all others
for i in build/lib/ant-*.jar ; do
case $i in
*/ant-junit*)
;;
*)
rm -v $i
;;
esac
done
%endif
for jar in build/lib/*.jar
do
jarname=$(basename $jar .jar)
pomname="${jarname}.pom"
#Determine where to put it
case $jarname in
#These go into %%{_javadir}, pom files have different names
ant | ant-bootstrap | ant-launcher)
%if %{with bootstrap}
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";pomname="$jarname.pom"
%else
continue
%endif
;;
ant-jmf|ant-swing)
%if %{with bootstrap}
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";
%else
continue
%endif
;;
#Bootstracp builds an incomplete ant-foo jars, don't ship them
*)
%if %{with bootstrap}
continue
%else
#These go into %%{_javadir}/ant
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";
%endif
;;
esac
#instal jar
install -m 644 ${jar} ${destdir}/${jarname}.jar
# jar aliases
ln -sf ../../java/${destname}${jarname}.jar %{buildroot}%{ant_home}/lib/${jarname}.jar
#bootstrap does not have a pom
if [ "$jarname" = ant-bootstrap ]; then
mkdir -p src/etc/poms/${jarname}
sed -e "s#@VERSION@#%{version}#g" < %{SOURCE10} > src/etc/poms/${jarname}/pom.xml
fi
#install pom
%{mvn_install_pom} src/etc/poms/${jarname}/pom.xml %{buildroot}/%{_mavenpomdir}/${pomname}
if [ "$jarname" = ant-launcher ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -a ant:ant-launcher
elif [ "$jarname" = ant-jmf ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f jmf
elif [ "$jarname" = ant-swing ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f swing
elif [ "$jarname" = ant ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -a org.apache.ant:ant-nodeps,apache:ant,ant:ant
elif [ "$jarname" = ant-antlr -o "$jarname" = ant-bootstrap ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar
else
%if %{with junit} || %{with junit5}
%add_maven_depmap ${pomname} ${destname}${jarname}.jar
%else
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f ${jarname}
%endif
fi
done
%if %{with bootstrap}
# scripts: remove dos and os/2 scripts
rm -f src/script/*.bat
rm -f src/script/*.cmd
# XSLs
cp -p src/etc/*.xsl %{buildroot}%{ant_home}%{_sysconfdir}
rm -f %{buildroot}%{ant_home}%{_sysconfdir}/{maudit-frames,jdepend,jdepend-frames,junit-frames,junit-noframes}.xsl
%endif
%if %{with junit}
cp -p src/etc/{junit-noframes,junit-frames}.xsl %{buildroot}%{ant_home}%{_sysconfdir}
%endif
%if %{with antlr}
cp -p src/etc/{maudit-frames,jdepend,jdepend-frames}.xsl %{buildroot}%{ant_home}%{_sysconfdir}
%endif
%if %{with bootstrap}
# install everything else
mkdir -p %{buildroot}%{_bindir}
cp -p src/script/* %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_datadir}/%{name}/bin/
ln -sf %{_bindir}/antRun %{buildroot}/%{_datadir}/%{name}/bin/antRun
%endif
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
%if %{with bootstrap}
# default ant.conf
mkdir -p %{buildroot}%{_sysconfdir}
cp -p %{SOURCE1} %{buildroot}%{_sysconfdir}/ant.conf
# OPT_JAR_LIST fragments
echo "ant/ant-jmf" > %{buildroot}%{_sysconfdir}/%{name}.d/jmf
echo "ant/ant-swing" > %{buildroot}%{_sysconfdir}/%{name}.d/swing
%endif
%if %{with junit}
echo "junit ant/ant-junit" > %{buildroot}%{_sysconfdir}/ant.d/junit
echo "junit4 ant/ant-junit4" > %{buildroot}%{_sysconfdir}/ant.d/junit4
%endif
%if %{with junit5}
echo "junit5 hamcrest/core junit opentest4j univocity-parsers ant/ant-junitlauncher" > %{buildroot}%{_sysconfdir}/ant.d/junitlauncher
%endif
%if %{with antlr}
echo "antlr ant/ant-antlr" > %{buildroot}%{_sysconfdir}/ant.d/antlr
echo "rhino bsf ant/ant-apache-bsf" > %{buildroot}%{_sysconfdir}/ant.d/apache-bsf
echo "xml-resolver ant/ant-apache-resolver" > %{buildroot}%{_sysconfdir}/ant.d/apache-resolver
echo "apache-commons-logging ant/ant-commons-logging" > %{buildroot}%{_sysconfdir}/ant.d/commons-logging
echo "apache-commons-net ant/ant-commons-net" > %{buildroot}%{_sysconfdir}/ant.d/commons-net
echo "bcel ant/ant-apache-bcel" > %{buildroot}%{_sysconfdir}/ant.d/apache-bcel
echo "reload4j/reload4j ant/ant-apache-log4j" > %{buildroot}%{_sysconfdir}/ant.d/apache-log4j
echo "oro ant/ant-apache-oro" > %{buildroot}%{_sysconfdir}/ant.d/apache-oro
echo "regexp ant/ant-apache-regexp" > %{buildroot}%{_sysconfdir}/ant.d/apache-regexp
echo "xalan-j2 ant/ant-apache-xalan2" > %{buildroot}%{_sysconfdir}/ant.d/apache-xalan2
echo "ant/ant-imageio" > %{buildroot}%{_sysconfdir}/ant.d/imageio
echo "javamail jaf ant/ant-javamail" > %{buildroot}%{_sysconfdir}/ant.d/javamail
echo "jakartamail jaf ant/ant-jakartamail" > %{buildroot}%{_sysconfdir}/ant.d/jakartamail
echo "jdepend ant/ant-jdepend" > %{buildroot}%{_sysconfdir}/ant.d/jdepend
echo "jsch ant/ant-jsch" > %{buildroot}%{_sysconfdir}/ant.d/jsch
echo "xz-java ant/ant-xz" > %{buildroot}%{_sysconfdir}/ant.d/xz
echo "testutil ant/ant-testutil" > %{buildroot}%{_sysconfdir}/ant.d/testutil
%endif
%if %{with bootstrap}
find %{buildroot}%{_datadir}/ant%{_sysconfdir} -type f -name "*.xsl" \
-a ! -name ant-update.xsl \
-a ! -name changelog.xsl \
-a ! -name coverage-frames.xsl \
-a ! -name junit-frames-xalan1.xsl \
-a ! -name log.xsl \
-a ! -name mmetrics-frames.xsl \
-a ! -name tagdiff.xsl \
-print -delete
%endif
# remove *.orig
rm -rf %{buildroot}%{_bindir}/ant.orig
%if %{with bootstrap}
pushd %{buildroot}%{_javadir}
for i in ant-bootstrap ant-launcher ant; do
ln -sf ant/${i}.jar ${i}.jar
done
popd
%files -f .mfiles
%license LICENSE NOTICE
%doc KEYS README WHATSNEW
%config(noreplace) %{_sysconfdir}/%{name}.conf
%attr(0755,root,root) %{_bindir}/ant
%attr(0755,root,root) %{_bindir}/antRun
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-launcher.jar
%{_javadir}/%{name}-bootstrap.jar
%dir %{_javadir}/%{name}
%dir %{ant_home}
%dir %{ant_home}%{_sysconfdir}
%{ant_home}/bin
%{ant_home}%{_sysconfdir}/ant-update.xsl
%{ant_home}%{_sysconfdir}/changelog.xsl
%{ant_home}%{_sysconfdir}/coverage-frames.xsl
%{ant_home}%{_sysconfdir}/mmetrics-frames.xsl
%{ant_home}%{_sysconfdir}/log.xsl
%{ant_home}%{_sysconfdir}/tagdiff.xsl
%{ant_home}%{_sysconfdir}/junit-frames-xalan1.xsl
# % {ant_home}/etc/common2master.xsl
# % {ant_home}/etc/printFailingTests.xsl
%dir %{ant_home}/lib
%dir %{_sysconfdir}/%{name}.d
%{ant_home}/lib/ant.jar
%{ant_home}/lib/ant-bootstrap.jar
%{ant_home}/lib/ant-launcher.jar
%dir %{_sysconfdir}/ant.d
%endif
%if %{with antlr}
%files -f .mfiles
%{ant_home}/lib/ant-antlr.jar
%config(noreplace) %{_sysconfdir}/ant.d/antlr
%endif
%if %{with junit}
%files -f .mfiles
%{ant_home}/lib/ant-junit*.jar
%config(noreplace) %{_sysconfdir}/ant.d/junit
%config(noreplace) %{_sysconfdir}/ant.d/junit4
%{ant_home}%{_sysconfdir}/junit-frames.xsl
%{ant_home}%{_sysconfdir}/junit-noframes.xsl
%endif
%if %{with junit5}
%files -f .mfiles
%{ant_home}/lib/ant-junitlauncher.jar
%config(noreplace) %{_sysconfdir}/ant.d/junitlauncher
%endif
### Basic ant subpackages
%if %{with bootstrap}
%files -n ant-jmf -f .mfiles-jmf
%{ant_home}/lib/ant-jmf.jar
%config(noreplace) %{_sysconfdir}/ant.d/jmf
%files -n ant-swing -f .mfiles-swing
%{ant_home}/lib/ant-swing.jar
%config(noreplace) %{_sysconfdir}/ant.d/swing
%files -n ant-scripts
%defattr(0755,root,root,0755)
%{_bindir}/*.pl
%{_bindir}/*.py*
%endif #if bootstrap
%if %{with antlr}
%files -n ant-apache-bsf -f .mfiles-ant-apache-bsf
%{ant_home}/lib/ant-apache-bsf.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-bsf
%files -n ant-apache-resolver -f .mfiles-ant-apache-resolver
%{ant_home}/lib/ant-apache-resolver.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-resolver
%files -n ant-commons-logging -f .mfiles-ant-commons-logging
%{ant_home}/lib/ant-commons-logging.jar
%config(noreplace) %{_sysconfdir}/ant.d/commons-logging
%files -n ant-commons-net -f .mfiles-ant-commons-net
%{ant_home}/lib/ant-commons-net.jar
%config(noreplace) %{_sysconfdir}/ant.d/commons-net
%files -n ant-apache-bcel -f .mfiles-ant-apache-bcel
%{ant_home}/lib/ant-apache-bcel.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-bcel
%files -n ant-apache-log4j -f .mfiles-ant-apache-log4j
%{ant_home}/lib/ant-apache-log4j.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-log4j
%files -n ant-apache-oro -f .mfiles-ant-apache-oro
%{ant_home}/lib/ant-apache-oro.jar
%{ant_home}%{_sysconfdir}/maudit-frames.xsl
%config(noreplace) %{_sysconfdir}/ant.d/apache-oro
%files -n ant-apache-regexp -f .mfiles-ant-apache-regexp
%{ant_home}/lib/ant-apache-regexp.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-regexp
%files -n ant-apache-xalan2 -f .mfiles-ant-apache-xalan2
%{ant_home}/lib/ant-apache-xalan2.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-xalan2
%files -n ant-imageio -f .mfiles-ant-imageio
%{ant_home}/lib/ant-imageio.jar
%config(noreplace) %{_sysconfdir}/ant.d/imageio
%files -n ant-javamail -f .mfiles-ant-javamail
%{ant_home}/lib/ant-javamail.jar
%config(noreplace) %{_sysconfdir}/ant.d/javamail
%files -n ant-jakartamail -f .mfiles-ant-jakartamail
%{ant_home}/lib/ant-jakartamail.jar
%config(noreplace) %{_sysconfdir}/ant.d/jakartamail
%files -n ant-jdepend -f .mfiles-ant-jdepend
%{ant_home}/lib/ant-jdepend.jar
%config(noreplace) %{_sysconfdir}/ant.d/jdepend
%{ant_home}%{_sysconfdir}/jdepend.xsl
%{ant_home}%{_sysconfdir}/jdepend-frames.xsl
%files -n ant-jsch -f .mfiles-ant-jsch
%{ant_home}/lib/ant-jsch.jar
%config(noreplace) %{_sysconfdir}/ant.d/jsch
%files -n ant-xz -f .mfiles-ant-xz
%{ant_home}/lib/ant-xz.jar
%config(noreplace) %{_sysconfdir}/ant.d/xz
%files -n ant-testutil -f .mfiles-ant-testutil
%{ant_home}/lib/ant-testutil.jar
%config(noreplace) %{_sysconfdir}/ant.d/testutil
%files -n ant-manual
%doc manual/*
%endif
%changelog

1076
ant.changes Normal file

File diff suppressed because it is too large Load Diff

1546
ant.keyring Normal file

File diff suppressed because it is too large Load Diff

769
ant.spec Normal file
View File

@ -0,0 +1,769 @@
#
# spec file for package ant
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2000-2009, JPackage Project
#
# 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 ant_home %{_datadir}/ant
%bcond_without bootstrap
%bcond_with junit
%bcond_with junit5
%bcond_with antlr
Name: ant
Version: 1.10.14
Release: 0
Summary: Java-based build tool
License: Apache-2.0
Group: Development/Tools/Building
URL: https://ant.apache.org/
Source0: https://www.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.xz
Source1: apache-ant-1.8.ant.conf
Source10: ant-bootstrap.pom.in
Source1000: pre_checkin.sh
Source1001: https://www.apache.org/dist/ant/source/apache-ant-%{version}-src.tar.xz.asc
Source1002: ant.keyring
Patch0: apache-ant-no-test-jar.patch
Patch1: apache-ant-class-path-in-manifest.patch
Patch2: apache-ant-bootstrap.patch
#PATCH-FEATURE-OPENSUSE bmwiedemann -- have fixed build dates
Patch3: reproducible-build-date.patch
# PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- have fixed "Created-by" in manifest
Patch5: reproducible-build-manifest.patch
Patch6: apache-ant-xml-apis.patch
# PATCH-FEATURE-OPENSUSE debian patch to use SOURCE_DATE_EPOCH for timestamp in property files
Patch7: reproducible-propertyfile-task.patch
BuildRequires: antlr-bootstrap
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local >= 6
BuildRequires: unzip
BuildRequires: xml-commons-apis-bootstrap
#!BuildIgnore: xml-commons-apis
BuildArch: noarch
# Needed for maven conversions
%if !%{with bootstrap}
BuildRequires: javapackages-local
%endif
%if %{with junit} || %{with antlr} || %{with junit5}
BuildRequires: ant = %{version}
BuildRequires: hamcrest
BuildRequires: junit
#!BuildIgnore: antlr
%endif
%if %{with antlr}
BuildRequires: xerces-j2
BuildRequires: xz-java
%endif
%if %{with junit5}
BuildRequires: apiguardian
BuildRequires: junit5
%endif
%if 0%{?suse_version} > 1320
BuildRequires: strip-nondeterminism
%endif
%if %{with bootstrap}
Requires: java-devel >= 1.8
Requires: javapackages-tools
Requires: xerces-j2
Requires: xml-apis
Requires: xml-resolver
Obsoletes: apache-ant < %{version}
Provides: apache-ant = %{version}
Obsoletes: ant-nodeps < %{version}
Provides: ant-nodeps = %{version}
Obsoletes: ant-trax < %{version}
Provides: ant-trax = %{version}
%endif
%if %{with antlr}
Requires: antlr
%requires_eq ant
Obsoletes: ant-javadoc
%endif
%if %{with junit}
Requires: junit4
%requires_eq ant
%endif
%if %{with junit5}
Requires: junit5
%requires_eq ant
%endif
%if %{with junit}
%description
Apache Ant is a Java-based build tool.
This package contains optional JUnit tasks for Apache Ant.
%elif %{with junit5}
%description
Apache Ant is a Java-based build tool.
This package contains optional JUnit5 tasks for Apache Ant.
%else
%description
Apache Ant is a Java-based build tool. In theory, it is kind of like
Make. Build description files are written in XML.
%endif
%if %{with bootstrap}
%package -n ant-jmf
Summary: Optional jmf tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
%description -n ant-jmf
Apache Ant is a Java-based build tool.
This package contains optional jmf tasks for Apache Ant.
%package -n ant-swing
Summary: Optional swing tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
%description -n ant-swing
Apache Ant is a Java-based build tool.
This package contains optional swing tasks for Apache Ant.
%package -n ant-scripts
Summary: Additional scripts for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: ant = %{version}
Requires: perl
Requires: python3-base
%description -n ant-scripts
Apache Ant is a Java-based build tool.
This package contains additional perl and python scripts for Apache
Ant.
%endif #if bootstrap
%if %{with antlr}
%package -n ant-apache-bsf
Summary: Optional apache bsf tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: bsf
Requires: bsf
%requires_eq ant
%description -n ant-apache-bsf
Apache Ant is a Java-based build tool.
This package contains optional apache bsf tasks for Apache Ant.
%package -n ant-apache-resolver
Summary: Optional apache resolver tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: xml-resolver
Requires: xml-resolver
%requires_eq ant
%description -n ant-apache-resolver
Apache Ant is a Java-based build tool.
This package contains optional apache resolver tasks for Apache Ant.
%package -n ant-commons-logging
Summary: Optional commons logging tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: apache-commons-logging
Requires: apache-commons-logging
%requires_eq ant
%description -n ant-commons-logging
Apache Ant is a Java-based build tool.
This package contains optional commons logging tasks for Apache Ant.
%package -n ant-commons-net
Summary: Optional commons net tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: apache-commons-net
Requires: apache-commons-net
%requires_eq ant
%description -n ant-commons-net
Apache Ant is a Java-based build tool.
This package contains optional commons net tasks for Apache Ant.
%package -n ant-apache-bcel
Summary: Optional apache bcel tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: bcel
Requires: bcel
%requires_eq ant
Provides: ant-jakarta-bcel = %{version}
Obsoletes: ant-jakarta-bcel < %{version}
%description -n ant-apache-bcel
Apache Ant is a Java-based build tool.
This package contains optional apache bcel tasks for Apache Ant.
%package -n ant-apache-log4j
Summary: Optional apache log4j tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: reload4j
Requires: reload4j
%requires_eq ant
Provides: ant-jakarta-log4j = %{version}
Obsoletes: ant-jakarta-log4j < %{version}
%description -n ant-apache-log4j
Apache Ant is a Java-based build tool.
This package contains optional apache log4j tasks for Apache Ant.
%package -n ant-apache-oro
Summary: Optional apache oro tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: oro
Requires: oro
%requires_eq ant
Provides: ant-jakarta-oro = %{version}
Obsoletes: ant-jakarta-oro < %{version}
%description -n ant-apache-oro
Apache Ant is a Java-based build tool.
This package contains optional apache oro tasks for Apache Ant.
%package -n ant-apache-regexp
Summary: Optional apache regexp tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: regexp
Requires: regexp
%requires_eq ant
Provides: ant-jakarta-regexp = %{version}
Obsoletes: ant-jakarta-regexp < %{version}
%description -n ant-apache-regexp
Apache Ant is a Java-based build tool.
This package contains optional apache regexp tasks for Apache Ant.
%package -n ant-apache-xalan2
Summary: Optional apache xalan2 tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: regexp
BuildRequires: xalan-j2
Requires: regexp
%requires_eq ant
%description -n ant-apache-xalan2
Optional apache xalan2 tasks for %{name}.
%package -n ant-imageio
Summary: Optional imageio tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
%requires_eq ant
%description -n ant-imageio
Apache Ant is a Java-based build tool.
This package contains optional imageio tasks for Apache Ant.
%package -n ant-javamail
Summary: Optional javamail tasks for ant
License: CDDL-1.0
Group: Development/Tools/Building
BuildRequires: javamail >= 1.2-5jpp
Requires: javamail >= 1.2-5jpp
%requires_eq ant
%description -n ant-javamail
Apache Ant is a Java-based build tool.
This package contains optional javamail tasks for Apache Ant.
%package -n ant-jakartamail
Summary: Optional jakartamail tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jakarta-mail
Requires: jakarta-mail
%requires_eq ant
%description -n ant-jakartamail
Apache Ant is a Java-based build tool.
This package contains optional jakartamail tasks for Apache Ant.
%package -n ant-jdepend
Summary: Optional jdepend tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jdepend
Requires: jdepend
%requires_eq ant
%description -n ant-jdepend
Apache Ant is a Java-based build tool.
This package contains optional jdepend tasks for Apache Ant.
%package -n ant-jsch
Summary: Optional jsch tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
BuildRequires: jsch
Requires: jsch
%requires_eq ant
%description -n ant-jsch
Apache Ant is a Java-based build tool.
This package contains optional jsch tasks for Apache Ant.
%package -n ant-xz
Summary: Opional xz tasks for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: xz-java
%requires_eq ant
%description -n ant-xz
Apache Ant is a Java-based build tool.
This package contains optional xz tasks for Apache Ant.
%package -n ant-testutil
Summary: Test utility classes for ant
License: Apache-2.0
Group: Development/Tools/Building
Requires: junit4
%requires_eq ant
%description -n ant-testutil
Test utility tasks for %{name}.
%package -n ant-manual
Summary: Manual for ant
License: Apache-2.0
Group: Development/Tools/Building
%description -n ant-manual
Apache Ant is a Java-based build tool.
This package contains the manual for Apache Ant.
%endif
%prep
%setup -q -n apache-ant-%{version}
#Fixup version
find -name build.xml -o -name pom.xml | xargs sed -i -e s/-SNAPSHOT//
find -name \*.jar -print -delete
# When bootstrapping, we don't have junit
%if %{with bootstrap}
%patch0 -p1
%endif
%patch1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
# clean jar files
find . -name "*.jar" -print -delete
# failing testcases. TODO see why
%if %{with antlr} || %{with junit}
rm src/tests/junit/org/apache/tools/mail/MailMessageTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/ExecuteWatchdogTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java \
src/tests/junit/org/apache/tools/ant/taskdefs/TestProcess.java
%endif
# Test relies on internal JUnit 5 API that was changed
rm src/tests/junit/org/apache/tools/ant/taskdefs/optional/junitlauncher/LegacyXmlResultFormatterTest.java
#install jars
%if %{with junit} || %{with junit5}
build-jar-repository -s -p lib/optional junit4
%endif
%if %{with junit5}
build-jar-repository -s -p lib/optional junit5 opentest4j
%endif
%if %{with antlr}
# we need to build junit in antlr, but we remove it later
build-jar-repository -s -p lib/optional xerces-j2 xml-commons-apis-bootstrap antlr-bootstrap bcel javamail/mailapi jdepend junit4 reload4j/reload4j oro regexp bsf commons-logging commons-net jsch xalan-j2 xalan-j2-serializer xml-resolver xz-java
%endif
# Fix file-not-utf8 rpmlint warning
iconv KEYS -f iso-8859-1 -t utf-8 -o KEYS.utf8
mv KEYS.utf8 KEYS
iconv LICENSE -f iso-8859-1 -t utf-8 -o LICENSE.utf8
mv LICENSE.utf8 LICENSE
# -----------------------------------------------------------------------------
%build
export OPT_JAR_LIST=:
%if %{with antlr} || %{with junit} || %{with junit5}
ant -Dbuild.sysclasspath=first jars test-jar
#remove empty jai and netrexx jars. Due to missing dependencies they contain only manifests.
rm -rf build/lib/ant-jai.jar build/lib/ant-netrexx.jar
%endif
%if %{with bootstrap}
export GC_MAXIMUM_HEAP_SIZE="134217728" #128M
export JAVA_HOME="%{java_home}"
sh -x ./build.sh --noconfig jars
%endif
%?strip_all_nondeterminism
%install
# ANT_HOME and subdirs
mkdir -p %{buildroot}%{ant_home}/{lib,etc}
# jars
install -d -m 755 %{buildroot}%{_javadir}/ant
install -d -m 755 %{buildroot}%{_mavenpomdir}
%if %{without junit} && %{without junit5}
rm build/lib/ant-junit*.jar
%else
%if %{without junit}
rm build/lib/ant-junit.jar
rm build/lib/ant-junit4.jar
%else
# empty in this scenario
rm build/lib/ant-junitlauncher.jar
%endif
# remove all others
for i in build/lib/ant-*.jar ; do
case $i in
*/ant-junit*)
;;
*)
rm -v $i
;;
esac
done
%endif
for jar in build/lib/*.jar
do
jarname=$(basename $jar .jar)
pomname="${jarname}.pom"
#Determine where to put it
case $jarname in
#These go into %%{_javadir}, pom files have different names
ant | ant-bootstrap | ant-launcher)
%if %{with bootstrap}
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";pomname="$jarname.pom"
%else
continue
%endif
;;
ant-jmf|ant-swing)
%if %{with bootstrap}
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";
%else
continue
%endif
;;
#Bootstracp builds an incomplete ant-foo jars, don't ship them
*)
%if %{with bootstrap}
continue
%else
#These go into %%{_javadir}/ant
destdir="%{buildroot}%{_javadir}/ant"; destname="ant/";
%endif
;;
esac
#instal jar
install -m 644 ${jar} ${destdir}/${jarname}.jar
# jar aliases
ln -sf ../../java/${destname}${jarname}.jar %{buildroot}%{ant_home}/lib/${jarname}.jar
#bootstrap does not have a pom
if [ "$jarname" = ant-bootstrap ]; then
mkdir -p src/etc/poms/${jarname}
sed -e "s#@VERSION@#%{version}#g" < %{SOURCE10} > src/etc/poms/${jarname}/pom.xml
fi
#install pom
%{mvn_install_pom} src/etc/poms/${jarname}/pom.xml %{buildroot}/%{_mavenpomdir}/${pomname}
if [ "$jarname" = ant-launcher ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -a ant:ant-launcher
elif [ "$jarname" = ant-jmf ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f jmf
elif [ "$jarname" = ant-swing ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f swing
elif [ "$jarname" = ant ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -a org.apache.ant:ant-nodeps,apache:ant,ant:ant
elif [ "$jarname" = ant-antlr -o "$jarname" = ant-bootstrap ]; then
%add_maven_depmap ${pomname} ${destname}${jarname}.jar
else
%if %{with junit} || %{with junit5}
%add_maven_depmap ${pomname} ${destname}${jarname}.jar
%else
%add_maven_depmap ${pomname} ${destname}${jarname}.jar -f ${jarname}
%endif
fi
done
%if %{with bootstrap}
# scripts: remove dos and os/2 scripts
rm -f src/script/*.bat
rm -f src/script/*.cmd
# XSLs
cp -p src/etc/*.xsl %{buildroot}%{ant_home}%{_sysconfdir}
rm -f %{buildroot}%{ant_home}%{_sysconfdir}/{maudit-frames,jdepend,jdepend-frames,junit-frames,junit-noframes}.xsl
%endif
%if %{with junit}
cp -p src/etc/{junit-noframes,junit-frames}.xsl %{buildroot}%{ant_home}%{_sysconfdir}
%endif
%if %{with antlr}
cp -p src/etc/{maudit-frames,jdepend,jdepend-frames}.xsl %{buildroot}%{ant_home}%{_sysconfdir}
%endif
%if %{with bootstrap}
# install everything else
mkdir -p %{buildroot}%{_bindir}
cp -p src/script/* %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_datadir}/%{name}/bin/
ln -sf %{_bindir}/antRun %{buildroot}/%{_datadir}/%{name}/bin/antRun
%endif
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
%if %{with bootstrap}
# default ant.conf
mkdir -p %{buildroot}%{_sysconfdir}
cp -p %{SOURCE1} %{buildroot}%{_sysconfdir}/ant.conf
# OPT_JAR_LIST fragments
echo "ant/ant-jmf" > %{buildroot}%{_sysconfdir}/%{name}.d/jmf
echo "ant/ant-swing" > %{buildroot}%{_sysconfdir}/%{name}.d/swing
%endif
%if %{with junit}
echo "junit ant/ant-junit" > %{buildroot}%{_sysconfdir}/ant.d/junit
echo "junit4 ant/ant-junit4" > %{buildroot}%{_sysconfdir}/ant.d/junit4
%endif
%if %{with junit5}
echo "junit5 hamcrest/core junit opentest4j univocity-parsers ant/ant-junitlauncher" > %{buildroot}%{_sysconfdir}/ant.d/junitlauncher
%endif
%if %{with antlr}
echo "antlr ant/ant-antlr" > %{buildroot}%{_sysconfdir}/ant.d/antlr
echo "rhino bsf ant/ant-apache-bsf" > %{buildroot}%{_sysconfdir}/ant.d/apache-bsf
echo "xml-resolver ant/ant-apache-resolver" > %{buildroot}%{_sysconfdir}/ant.d/apache-resolver
echo "apache-commons-logging ant/ant-commons-logging" > %{buildroot}%{_sysconfdir}/ant.d/commons-logging
echo "apache-commons-net ant/ant-commons-net" > %{buildroot}%{_sysconfdir}/ant.d/commons-net
echo "bcel ant/ant-apache-bcel" > %{buildroot}%{_sysconfdir}/ant.d/apache-bcel
echo "reload4j/reload4j ant/ant-apache-log4j" > %{buildroot}%{_sysconfdir}/ant.d/apache-log4j
echo "oro ant/ant-apache-oro" > %{buildroot}%{_sysconfdir}/ant.d/apache-oro
echo "regexp ant/ant-apache-regexp" > %{buildroot}%{_sysconfdir}/ant.d/apache-regexp
echo "xalan-j2 ant/ant-apache-xalan2" > %{buildroot}%{_sysconfdir}/ant.d/apache-xalan2
echo "ant/ant-imageio" > %{buildroot}%{_sysconfdir}/ant.d/imageio
echo "javamail jaf ant/ant-javamail" > %{buildroot}%{_sysconfdir}/ant.d/javamail
echo "jakartamail jaf ant/ant-jakartamail" > %{buildroot}%{_sysconfdir}/ant.d/jakartamail
echo "jdepend ant/ant-jdepend" > %{buildroot}%{_sysconfdir}/ant.d/jdepend
echo "jsch ant/ant-jsch" > %{buildroot}%{_sysconfdir}/ant.d/jsch
echo "xz-java ant/ant-xz" > %{buildroot}%{_sysconfdir}/ant.d/xz
echo "testutil ant/ant-testutil" > %{buildroot}%{_sysconfdir}/ant.d/testutil
%endif
%if %{with bootstrap}
find %{buildroot}%{_datadir}/ant%{_sysconfdir} -type f -name "*.xsl" \
-a ! -name ant-update.xsl \
-a ! -name changelog.xsl \
-a ! -name coverage-frames.xsl \
-a ! -name junit-frames-xalan1.xsl \
-a ! -name log.xsl \
-a ! -name mmetrics-frames.xsl \
-a ! -name tagdiff.xsl \
-print -delete
%endif
# remove *.orig
rm -rf %{buildroot}%{_bindir}/ant.orig
%if %{with bootstrap}
pushd %{buildroot}%{_javadir}
for i in ant-bootstrap ant-launcher ant; do
ln -sf ant/${i}.jar ${i}.jar
done
popd
%files -f .mfiles
%license LICENSE NOTICE
%doc KEYS README WHATSNEW
%config(noreplace) %{_sysconfdir}/%{name}.conf
%attr(0755,root,root) %{_bindir}/ant
%attr(0755,root,root) %{_bindir}/antRun
%{_javadir}/%{name}.jar
%{_javadir}/%{name}-launcher.jar
%{_javadir}/%{name}-bootstrap.jar
%dir %{_javadir}/%{name}
%dir %{ant_home}
%dir %{ant_home}%{_sysconfdir}
%{ant_home}/bin
%{ant_home}%{_sysconfdir}/ant-update.xsl
%{ant_home}%{_sysconfdir}/changelog.xsl
%{ant_home}%{_sysconfdir}/coverage-frames.xsl
%{ant_home}%{_sysconfdir}/mmetrics-frames.xsl
%{ant_home}%{_sysconfdir}/log.xsl
%{ant_home}%{_sysconfdir}/tagdiff.xsl
%{ant_home}%{_sysconfdir}/junit-frames-xalan1.xsl
# % {ant_home}/etc/common2master.xsl
# % {ant_home}/etc/printFailingTests.xsl
%dir %{ant_home}/lib
%dir %{_sysconfdir}/%{name}.d
%{ant_home}/lib/ant.jar
%{ant_home}/lib/ant-bootstrap.jar
%{ant_home}/lib/ant-launcher.jar
%dir %{_sysconfdir}/ant.d
%endif
%if %{with antlr}
%files -f .mfiles
%{ant_home}/lib/ant-antlr.jar
%config(noreplace) %{_sysconfdir}/ant.d/antlr
%endif
%if %{with junit}
%files -f .mfiles
%{ant_home}/lib/ant-junit*.jar
%config(noreplace) %{_sysconfdir}/ant.d/junit
%config(noreplace) %{_sysconfdir}/ant.d/junit4
%{ant_home}%{_sysconfdir}/junit-frames.xsl
%{ant_home}%{_sysconfdir}/junit-noframes.xsl
%endif
%if %{with junit5}
%files -f .mfiles
%{ant_home}/lib/ant-junitlauncher.jar
%config(noreplace) %{_sysconfdir}/ant.d/junitlauncher
%endif
### Basic ant subpackages
%if %{with bootstrap}
%files -n ant-jmf -f .mfiles-jmf
%{ant_home}/lib/ant-jmf.jar
%config(noreplace) %{_sysconfdir}/ant.d/jmf
%files -n ant-swing -f .mfiles-swing
%{ant_home}/lib/ant-swing.jar
%config(noreplace) %{_sysconfdir}/ant.d/swing
%files -n ant-scripts
%defattr(0755,root,root,0755)
%{_bindir}/*.pl
%{_bindir}/*.py*
%endif #if bootstrap
%if %{with antlr}
%files -n ant-apache-bsf -f .mfiles-ant-apache-bsf
%{ant_home}/lib/ant-apache-bsf.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-bsf
%files -n ant-apache-resolver -f .mfiles-ant-apache-resolver
%{ant_home}/lib/ant-apache-resolver.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-resolver
%files -n ant-commons-logging -f .mfiles-ant-commons-logging
%{ant_home}/lib/ant-commons-logging.jar
%config(noreplace) %{_sysconfdir}/ant.d/commons-logging
%files -n ant-commons-net -f .mfiles-ant-commons-net
%{ant_home}/lib/ant-commons-net.jar
%config(noreplace) %{_sysconfdir}/ant.d/commons-net
%files -n ant-apache-bcel -f .mfiles-ant-apache-bcel
%{ant_home}/lib/ant-apache-bcel.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-bcel
%files -n ant-apache-log4j -f .mfiles-ant-apache-log4j
%{ant_home}/lib/ant-apache-log4j.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-log4j
%files -n ant-apache-oro -f .mfiles-ant-apache-oro
%{ant_home}/lib/ant-apache-oro.jar
%{ant_home}%{_sysconfdir}/maudit-frames.xsl
%config(noreplace) %{_sysconfdir}/ant.d/apache-oro
%files -n ant-apache-regexp -f .mfiles-ant-apache-regexp
%{ant_home}/lib/ant-apache-regexp.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-regexp
%files -n ant-apache-xalan2 -f .mfiles-ant-apache-xalan2
%{ant_home}/lib/ant-apache-xalan2.jar
%config(noreplace) %{_sysconfdir}/ant.d/apache-xalan2
%files -n ant-imageio -f .mfiles-ant-imageio
%{ant_home}/lib/ant-imageio.jar
%config(noreplace) %{_sysconfdir}/ant.d/imageio
%files -n ant-javamail -f .mfiles-ant-javamail
%{ant_home}/lib/ant-javamail.jar
%config(noreplace) %{_sysconfdir}/ant.d/javamail
%files -n ant-jakartamail -f .mfiles-ant-jakartamail
%{ant_home}/lib/ant-jakartamail.jar
%config(noreplace) %{_sysconfdir}/ant.d/jakartamail
%files -n ant-jdepend -f .mfiles-ant-jdepend
%{ant_home}/lib/ant-jdepend.jar
%config(noreplace) %{_sysconfdir}/ant.d/jdepend
%{ant_home}%{_sysconfdir}/jdepend.xsl
%{ant_home}%{_sysconfdir}/jdepend-frames.xsl
%files -n ant-jsch -f .mfiles-ant-jsch
%{ant_home}/lib/ant-jsch.jar
%config(noreplace) %{_sysconfdir}/ant.d/jsch
%files -n ant-xz -f .mfiles-ant-xz
%{ant_home}/lib/ant-xz.jar
%config(noreplace) %{_sysconfdir}/ant.d/xz
%files -n ant-testutil -f .mfiles-ant-testutil
%{ant_home}/lib/ant-testutil.jar
%config(noreplace) %{_sysconfdir}/ant.d/testutil
%files -n ant-manual
%doc manual/*
%endif
%changelog

BIN
apache-ant-1.10.14-src.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEChI8HtPxOmoBQOFmxx+3Zc2d4xMFAmTcuDkACgkQxx+3Zc2d
4xPj/A//XXu00rd4H/NHRLt5AGyaF8ezlidNLpD+xfcG7CuviK6j3rhaCKKrA/fI
XLX1zLc01nWIeuY+3/hvnJjwP08IW7Zez7O6x0Els/DT7TK5idDFetdlR7WFdJy0
7awlo1GaVGJKOHvLy3ZjZtsYz4bTC+UiZK4sJ8kzuiTjEGarMqTESxbd9kvycC0M
NBHrEVVp2sUKSOgY2bsfzN30TFEmhEd/g4t+UGPGnVZMVqJwI+13w7iA00rKnaw0
p9A5IH7C/JpycWiP3pLAdx1E5Cg9tdJrl0lAxFf0ULe/9iPIVu3FYQQKrWJ0+VL1
vH1Odrr8X6vUy4KYVIUd+l5ShFxvImMlNdC3NHTU7FoialTJ/6r78W6drM0o/q/W
9XRuHvnTfIiLqf1sdqh7MOvDNkMMAZxiL/1wr8KTeWZAiwRjbQgrh0XKk3EYBhjS
7+N3FzDNHGjP0MWDEfM4EFmF7PEj0RhMj7AiPj2Wfm1Tjl9PXxhud/am0NsXsUQM
rUt1pLVsLClCGZ3bmhQXLS0SgaFtD9waDlCONT0jbHVdM163XQ0JrFhOUrSzlcs/
t3f/8oalG1OjH70iPLnanCxLFKDybWJtulxqbf9YyPreYdGfLkSuWzAqKfmsBQ2z
JEntRvps7oTGVRi3t9ALyYheTrXZz8DtcZuX/Zq6mvfEsZazp3Y=
=8m34
-----END PGP SIGNATURE-----

20
apache-ant-1.8.ant.conf Normal file
View File

@ -0,0 +1,20 @@
# ant.conf (Ant 1.8.x)
# JPackage Project <http://www.jpackage.org/>
# Validate --noconfig setting in case being invoked
# from pre Ant 1.6.x environment
if [ -z "$no_config" ] ; then
no_config=true
fi
# Setup ant configuration
if $no_config ; then
# Disable RPM layout
rpm_mode=false
else
# Use RPM layout
rpm_mode=true
# ANT_HOME for rpm layout
ANT_HOME=/usr/share/ant
fi

View File

@ -0,0 +1,11 @@
--- apache-ant-1.10.7/bootstrap.sh 2019-09-01 08:14:10.000000000 +0200
+++ apache-ant-1.10.7/bootstrap.sh 2019-10-12 12:34:23.892369973 +0200
@@ -143,7 +143,7 @@
echo ... Compiling Ant Classes with ${JAVAC_RELEASE_VERSION}
fi
-"${JAVAC}" $BOOTJAVAC_OPTS -d ${CLASSDIR} ${JAVAC_RELEASE_VERSION} \
+"${JAVAC}" $BOOTJAVAC_OPTS -d ${CLASSDIR} -sourcepath src/main ${JAVAC_RELEASE_VERSION} \
${TOOLS}/bzip2/*.java ${TOOLS}/tar/*.java ${TOOLS}/zip/*.java \
${TOOLS}/ant/util/regexp/RegexpMatcher.java \
${TOOLS}/ant/util/regexp/RegexpMatcherFactory.java \

View File

@ -0,0 +1,13 @@
Index: build.xml
===================================================================
--- build.xml.orig
+++ build.xml
@@ -719,7 +719,7 @@
</metainf>
<manifest>
<attribute name="Main-Class" value="org.apache.tools.ant.Main"/>
- <attribute name="Class-Path" value="ant.jar xalan.jar"/>
+ <!-- <attribute name="Class-Path" value="ant.jar xalan.jar"/> -->
</manifest>
</jar>

View File

@ -0,0 +1,11 @@
--- apache-ant-1.10.7/build.xml 2019-09-01 08:14:10.000000000 +0200
+++ apache-ant-1.10.7/build.xml 2019-10-12 12:30:11.014986025 +0200
@@ -976,7 +976,7 @@
Create the essential distribution that can run Apache Ant
===================================================================
-->
- <target name="dist-lite" depends="jars,test-jar,-ant-dist-warn-jdk9+"
+ <target name="dist-lite" depends="jars,-ant-dist-warn-jdk9+"
description="--> creates a minimum distribution to run Apache Ant">
<mkdir dir="${dist.dir}"/>

11
apache-ant-xml-apis.patch Normal file
View File

@ -0,0 +1,11 @@
--- apache-ant-1.10.5/src/script/ant 2018-07-10 06:50:31.000000000 +0200
+++ apache-ant-1.10.5/src/script/ant 2018-12-10 09:12:59.451126724 +0100
@@ -206,7 +206,7 @@
# request optional jars and their dependencies via the OPT_JAR_LIST
# variable
if $rpm_mode && [ -x /usr/bin/build-classpath ]; then
- LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher jaxp_parser_impl xml-commons-apis)"
+ LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher)"
# If no optional jars have been specified then build the default list
if [ -z "$OPT_JAR_LIST" ]; then

22
pre_checkin.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/sh
EDIT_WARNING="##### WARNING: please do not edit this auto generated spec file. Use the ant.spec! #####\n"
sed "s/^%bcond_without bootstrap$/${EDIT_WARNING}%bcond_with bootstrap/;
s/^%bcond_with antlr/%bcond_without antlr/;
s/^\(Name:.*\)$/\1-antlr/;
0,/^Summary:.*/{s/^Summary:.*/Summary: Antlr Task for ant/};
" < ant.spec > ant-antlr.spec
cp ant.changes ant-antlr.changes
sed "s/^%bcond_without bootstrap$/${EDIT_WARNING}%bcond_with bootstrap/;
s/^%bcond_with junit/%bcond_without junit/;
s/^%bcond_without junit5/%bcond_with junit5/;
s/^\(Name:.*\)$/\1-junit/;
0,/^Summary:.*/{s/^Summary:.*/Summary: Optional junit tasks for ant/};
" < ant.spec > ant-junit.spec
cp ant.changes ant-junit.changes
sed "s/^%bcond_without bootstrap$/${EDIT_WARNING}%bcond_with bootstrap/;
s/^%bcond_with junit5/%bcond_without junit5/;
s/^\(Name:.*\)$/\1-junit5/;
0,/^Summary:.*/{s/^Summary:.*/Summary: Optional junit tasks for ant/};
" < ant.spec > ant-junit5.spec
cp ant.changes ant-junit5.changes

View File

@ -0,0 +1,21 @@
Author: Bernhard M. Wiedemann <bwiedemann suse.de>
Date: 2017-10-24
have fixed build dates
to make packages like rhino build more reproducibly
that use their build.xml to insert build dates into output files
Index: apache-ant-1.9.9/src/script/ant
===================================================================
--- apache-ant-1.9.9.orig/src/script/ant
+++ apache-ant-1.9.9/src/script/ant
@@ -290,6 +290,9 @@ fi
if $usejikes; then
ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
fi
+if test -n "$SOURCE_DATE_EPOCH" ; then
+ ANT_OPTS="$ANT_OPTS -Dant.tstamp.now=$SOURCE_DATE_EPOCH"
+fi
# For Cygwin, switch paths to appropriate format before running java
# For PATHs convert to unix format first, then to windows format to ensure

View File

@ -0,0 +1,32 @@
Use Java major version for manifest's Created-by
No need of detailed version such java.vm.version. Java's jar command
uses java.version when it fills the manifest's "Created-by" field,
let's make ant do the same.
Using a detailed version makes that every Java release triggers a
new publication for ant-based applications, only because a line in
manifest has changed - not because the binary or dependencies have
changed. Using a less detailed version reduces these publications.
Using a less detailed version also prevents more subtle problems
such as in boo#1110024: noarch packages differ depending on the
builder architecture, when Java vm version contains an architecture
information (which is the case for openSUSE, though it's probably
not relevant).
--
--- a/src/main/org/apache/tools/ant/taskdefs/Manifest.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Manifest.java
@@ -760,10 +760,7 @@
defManifest);
}
Manifest defaultManifest = new Manifest(new InputStreamReader(in, JAR_CHARSET));
- String version = System.getProperty("java.runtime.version");
- if (version == null) {
- version = System.getProperty("java.vm.version");
- }
+ String version = System.getProperty("java.version");
Attribute createdBy = new Attribute("Created-By", version
+ " (" + System.getProperty("java.vm.vendor") + ")");
defaultManifest.getMainSection().storeAttribute(createdBy);

View File

@ -0,0 +1,21 @@
--- apache-ant-1.10.14/src/main/org/apache/tools/ant/util/DateUtils.java 2023-09-11 14:41:39.980341631 +0200
+++ apache-ant-1.10.14/src/main/org/apache/tools/ant/util/DateUtils.java 2023-09-11 14:46:43.779148231 +0200
@@ -227,6 +227,10 @@
*/
public static String getDateForHeader() {
Calendar cal = Calendar.getInstance();
+ if (System.getenv("SOURCE_DATE_EPOCH") != null) {
+ cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ cal.setTime(new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))));
+ }
TimeZone tz = cal.getTimeZone();
int offset = tz.getOffset(cal.get(Calendar.ERA),
cal.get(Calendar.YEAR),
@@ -247,6 +251,7 @@
}
tzMarker.append(minutes);
synchronized (DATE_HEADER_FORMAT_INT) {
+ DATE_HEADER_FORMAT_INT.setTimeZone(tz);
return DATE_HEADER_FORMAT_INT.format(cal.getTime()) + tzMarker.toString();
}
}