diff --git a/.gitignore b/.gitignore
index f8e7695..d4f0a29 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,11 @@
commons-math-2.0-src.tar.gz
/commons-math-2.1-src.tar.gz
/commons-math-2.2-src.tar.gz
+/commons-math3-3.0-src.tar.gz
+/commons-math3-3.1-src.tar.gz
+/commons-math3-3.1.1-src.tar.gz
+/commons-math3-3.2-src.tar.gz
+/commons-math3-3.3-src.tar.gz
+/commons-math3-3.4-src.tar.gz
+/commons-math3-3.4.1-src.tar.gz
+/commons-math3-3.6.1-src.tar.gz
diff --git a/apache-commons-math-2.2-remove_clirr_from_pom.patch b/apache-commons-math-2.2-remove_clirr_from_pom.patch
deleted file mode 100644
index 357a5a0..0000000
--- a/apache-commons-math-2.2-remove_clirr_from_pom.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -up commons-math-2.2-src/pom.xml.orig commons-math-2.2-src/pom.xml
---- commons-math-2.2-src/pom.xml.orig 2011-02-26 19:14:36.000000000 +0100
-+++ commons-math-2.2-src/pom.xml 2011-03-10 15:05:36.988244002 +0100
-@@ -280,17 +280,6 @@
-
-
-
--
-- org.codehaus.mojo
-- clirr-maven-plugin
-- 2.3
--
--
--
--
--
--
--
-
-
-
-@@ -350,14 +339,6 @@
- ${basedir}/license-header.txt
-
-
--
-- org.codehaus.mojo
-- clirr-maven-plugin
-- 2.2.3
--
-- ${minSeverity}
--
--
-
-
-
diff --git a/apache-commons-math-3.4.1-RHBZ1402145.patch b/apache-commons-math-3.4.1-RHBZ1402145.patch
new file mode 100644
index 0000000..656d37e
--- /dev/null
+++ b/apache-commons-math-3.4.1-RHBZ1402145.patch
@@ -0,0 +1,43 @@
+X-Git-Url: https://git1-us-west.apache.org/repos/asf?p=commons-math.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fapache%2Fcommons%2Fmath3%2Fml%2Fneuralnet%2Fsofm%2FKohonenUpdateActionTest.java;h=b209d56b8651eb6e7bbfca10ad9bdb1802fb24f3;hp=334a5a8ebbbd011aa7d10bebbc5478df5f82becc;hb=a9006aa;hpb=838788fd6302d6cc91e1743144e0f14b71e4812e
+
+diff --git a/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java b/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java
+index 334a5a8..b209d56 100644
+--- a/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java
++++ b/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java
+@@ -17,18 +17,19 @@
+
+ package org.apache.commons.math3.ml.neuralnet.sofm;
+
+-import org.apache.commons.math3.ml.neuralnet.Neuron;
+-import org.apache.commons.math3.ml.neuralnet.Network;
+-import org.apache.commons.math3.ml.neuralnet.MapUtils;
+-import org.apache.commons.math3.ml.neuralnet.UpdateAction;
+-import org.apache.commons.math3.ml.neuralnet.OffsetFeatureInitializer;
+-import org.apache.commons.math3.ml.neuralnet.FeatureInitializer;
+-import org.apache.commons.math3.ml.neuralnet.FeatureInitializerFactory;
+ import org.apache.commons.math3.ml.distance.DistanceMeasure;
+ import org.apache.commons.math3.ml.distance.EuclideanDistance;
++import org.apache.commons.math3.ml.neuralnet.FeatureInitializer;
++import org.apache.commons.math3.ml.neuralnet.FeatureInitializerFactory;
++import org.apache.commons.math3.ml.neuralnet.MapUtils;
++import org.apache.commons.math3.ml.neuralnet.Network;
++import org.apache.commons.math3.ml.neuralnet.Neuron;
++import org.apache.commons.math3.ml.neuralnet.OffsetFeatureInitializer;
++import org.apache.commons.math3.ml.neuralnet.UpdateAction;
+ import org.apache.commons.math3.ml.neuralnet.oned.NeuronString;
+-import org.junit.Test;
++import org.apache.commons.math3.util.Precision;
+ import org.junit.Assert;
++import org.junit.Test;
+
+ /**
+ * Tests for {@link KohonenUpdateAction} class.
+@@ -82,7 +83,7 @@ public class KohonenUpdateActionTest {
+
+ Assert.assertEquals(bestBefore, bestAfter);
+ // Distance is now zero.
+- Assert.assertEquals(0, dist.compute(bestAfter.getFeatures(), features), 0d);
++ Assert.assertEquals(0, dist.compute(bestAfter.getFeatures(), features), Precision.EPSILON);
+
+ for (int i = 0; i < netSize; i++) {
+ // All distances have decreased.
diff --git a/apache-commons-math.spec b/apache-commons-math.spec
index d152f3a..bcc8b29 100644
--- a/apache-commons-math.spec
+++ b/apache-commons-math.spec
@@ -1,39 +1,19 @@
-%global base_name math
-%global short_name commons-%{base_name}
+%global short_name commons-math3
-Name: apache-%{short_name}
-Version: 2.2
-Release: 1%{?dist}
+Name: apache-commons-math
+Version: 3.6.1
+Release: 24%{?dist}
Summary: Java library of lightweight mathematics and statistics components
+# Automatically converted from old format: ASL 1.1 and ASL 2.0 and BSD - review is highly recommended.
+License: Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD
+URL: http://commons.apache.org/math/
+Source0: http://www.apache.org/dist/commons/math/source/%{short_name}-%{version}-src.tar.gz
-Group: Development/Libraries
-License: ASL 1.1 and ASL 2.0 and BSD
-URL: http://commons.apache.org/%{base_name}/
-Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
-Patch0: %{name}-2.2-remove_clirr_from_pom.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-BuildRequires: java-devel >= 1:1.6.0
-BuildRequires: jpackage-utils
-BuildRequires: junit4
-BuildRequires: maven2 >= 2.2.1
-BuildRequires: maven-antrun-plugin
-BuildRequires: maven-assembly-plugin
-BuildRequires: maven-compiler-plugin
-BuildRequires: maven-idea-plugin
-BuildRequires: maven-install-plugin
-BuildRequires: maven-jar-plugin
-BuildRequires: maven-javadoc-plugin
-BuildRequires: maven-plugin-bundle
-BuildRequires: maven-resources-plugin
-# Should be replaced by maven-surefire-plugin after f15 branch
-BuildRequires: maven-surefire-maven-plugin
-BuildRequires: maven-surefire-provider-junit4
-Requires: java >= 1:1.6.0
-Requires: jpackage-utils
-Requires(post): jpackage-utils
-Requires(postun): jpackage-utils
+BuildRequires: maven-local-openjdk25
+BuildRequires: mvn(junit:junit)
+BuildRequires: mvn(org.apache.commons:commons-parent:pom:)
BuildArch: noarch
+ExclusiveArch: %{java_arches} noarch
%description
Commons Math is a library of lightweight, self-contained mathematics and
@@ -43,76 +23,203 @@ Java programming language or Commons Lang.
%package javadoc
Summary: Javadoc for %{name}
-Group: Documentation
-Requires: jpackage-utils
%description javadoc
This package contains the API documentation for %{name}.
%prep
-%setup -q -n %{short_name}-%{version}-src
-%patch0 -p1 -b .remove_clirr_from_pom
+%autosetup -n %{short_name}-%{version}-src -p1
+# Skip test that fails on Java 11
+sed -i -e '/checkMissingFastMathClasses/i@Ignore' \
+src/test/java/org/apache/commons/math3/util/FastMathTest.java
+
+# Compatibility links
+%mvn_alias "org.apache.commons:%{short_name}" "%{short_name}:%{short_name}"
+%mvn_file :%{short_name} %{short_name} %{name}
%build
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mkdir -p $MAVEN_REPO_LOCAL
-mvn-jpp \
- -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
- install javadoc:javadoc
+%mvn_build -- -Dcommons.packageId=math3
+
%install
-rm -rf %{buildroot}
-
-# jars
-install -d -m 0755 %{buildroot}%{_javadir}
-install -pm 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
-(cd %{buildroot}%{_javadir} && for jar in *; do ln -sf ${jar} `echo $jar| sed "s|apache-||g"`; done)
-
-# pom
-install -d -m 755 %{buildroot}%{_mavenpomdir}
-install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_name}.pom
-%add_to_maven_depmap org.apache.commons %{short_name} %{version} JPP %{short_name}
-
-# javadoc
-install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
-cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}/
+%mvn_install
-%clean
-rm -rf %{buildroot}
+%files -f .mfiles
+%doc NOTICE.txt RELEASE-NOTES.txt
+%license LICENSE.txt
-%post
-%update_maven_depmap
-
-
-%postun
-%update_maven_depmap
-
-
-%pre javadoc
-# workaround for rpm bug, can be removed in F-17
-[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
-rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
-
-
-%files
-%defattr(-,root,root,-)
-%doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt
-%{_javadir}/*
-%{_mavenpomdir}/*
-%{_mavendepmapfragdir}/*
-
-%files javadoc
-%defattr(-,root,root,-)
-%doc LICENSE.txt
-%{_javadocdir}/%{name}
-
+%files javadoc -f .mfiles-javadoc
+%doc NOTICE.txt
+%license LICENSE.txt
%changelog
+* Fri Jan 16 2026 Fedora Release Engineering - 3.6.1-24
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
+
+* Tue Jul 29 2025 jiri vanek - 3.6.1-23
+- Rebuilt for java-25-openjdk as preffered jdk
+
+* Wed Jul 23 2025 Fedora Release Engineering - 3.6.1-22
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
+
+* Thu Jan 16 2025 Fedora Release Engineering - 3.6.1-21
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
+
+* Wed Aug 28 2024 Miroslav Suchý - 3.6.1-20
+- convert license to SPDX
+
+* Wed Jul 17 2024 Fedora Release Engineering - 3.6.1-19
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
+
+* Tue Feb 27 2024 Jiri Vanek - 3.6.1-18
+- Rebuilt for java-21-openjdk as system jdk
+
+* Wed Jan 31 2024 Mikolaj Izdebski - 3.6.1-17
+- Port to apache-commons-parent 65
+
+* Mon Jan 22 2024 Fedora Release Engineering - 3.6.1-16
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
+
+* Fri Jan 19 2024 Fedora Release Engineering - 3.6.1-15
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
+
+* Wed Jul 19 2023 Fedora Release Engineering - 3.6.1-14
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
+
+* Wed Jan 18 2023 Fedora Release Engineering - 3.6.1-13
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
+
+* Wed Jul 20 2022 Fedora Release Engineering - 3.6.1-12
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
+
+* Fri Jul 08 2022 Jiri Vanek - 3.6.1-11
+- Rebuilt for Drop i686 JDKs
+
+* Sat Feb 05 2022 Jiri Vanek - 3.6.1-10
+- Rebuilt for java-17-openjdk as system jdk
+
+* Wed Jan 19 2022 Fedora Release Engineering - 3.6.1-9
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
+
+* Tue Jul 27 2021 Mohamed El Morabity - 3.6.1-8
+- Add explicit BuildRequires on JUnit
+
+* Wed Jul 21 2021 Fedora Release Engineering - 3.6.1-7
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
+
+* Tue Jan 26 2021 Fedora Release Engineering - 3.6.1-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
+
+* Mon Jul 27 2020 Fedora Release Engineering - 3.6.1-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
+
+* Thu Jul 16 2020 Mat Booth - 3.6.1-4
+- Allow building on JDK 11
+
+* Fri Jul 10 2020 Jiri Vanek - 3.6.1-3
+- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
+
+* Tue Jan 28 2020 Fedora Release Engineering - 3.6.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
+
+* Fri Aug 09 2019 Mohamed El Morabity - 3.6.1-1
+- Update to 3.6.1
+
+* Wed Jul 24 2019 Fedora Release Engineering - 3.4.1-11
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
+
+* Thu Jan 31 2019 Fedora Release Engineering - 3.4.1-10
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
+* Thu Jul 12 2018 Fedora Release Engineering - 3.4.1-9
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
+* Wed Feb 07 2018 Fedora Release Engineering - 3.4.1-8
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
+* Wed Jul 26 2017 Fedora Release Engineering - 3.4.1-7
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
+* Fri Feb 10 2017 Fedora Release Engineering - 3.4.1-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
+* Wed Feb 01 2017 Michael Simacek - 3.4.1-5
+- Remove BR on jacoco
+
+* Fri Dec 16 2016 Mohamed El Morabity - 3.4.1-4
+- Fix RHBZ #1402145
+- Spec cleanup
+
+* Wed Feb 03 2016 Fedora Release Engineering - 3.4.1-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
+
+* Wed Jun 17 2015 Fedora Release Engineering - 3.4.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
+
+* Tue Jan 13 2015 Mohamed El Morabity - 3.4.1-1
+- Update to 3.4.1
+
+* Mon Jan 05 2015 Mohamed El Morabity - 3.4-1
+- Update to 3.4
+
+* Fri Jun 13 2014 Mohamed El Morabity - 3.3-1
+- Update to 3.3
+- Drop apache-commons-math-3.2-RHBZ1084441.patch (fixed in 3.3)
+- Drop apache-commons-math-3.2-JDK8.patch (Java 8 support enabled in 3.3)
+
+* Sat Jun 07 2014 Fedora Release Engineering - 3.2-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
+
+* Wed Apr 23 2014 Mohamed El Morabity - 3.2-4
+- Fix RHBZ #1084441 (see
+ https://issues.apache.org/jira/browse/MATH-1057)
+- Disable unit test checking that all StrictMath methods are reimplemented in
+ commons-math
+
+* Fri Mar 28 2014 Michael Simacek - 3.2-4
+- Use Requires: java-headless rebuild (#1067528)
+
+* Tue Aug 06 2013 Mat Booth - 3.2-3
+- Update for newer guidelines
+
+* Sat Aug 03 2013 Fedora Release Engineering - 3.2-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
+* Sat May 11 2013 Mohamed El Morabity - 3.2-1
+- Update to 3.2
+
+* Wed Feb 13 2013 Fedora Release Engineering - 3.1.1-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Wed Feb 06 2013 Java SIG - 3.1.1-2
+- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild
+- Replace maven BuildRequires with maven-local
+
+* Tue Jan 15 2013 Mohamed El Morabity - 3.1.1-1
+- Update to 3.1.1
+
+* Sun Dec 30 2012 Mohamed El Morabity - 3.1-1
+- Update to 3.1
+
+* Wed Jul 18 2012 Fedora Release Engineering - 3.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Thu Mar 22 2012 Mohamed El Morabity - 3.0-1
+- Update to 3.0
+
+* Mon Jan 16 2012 Mohamed El Morabity - 2.2-3
+- Add missing apache-rat-plugin dependency
+- Use Maven 3
+- Spec cleanup
+
+* Thu Jan 12 2012 Fedora Release Engineering - 2.2-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
* Thu Mar 10 2011 Mohamed El Morabity - 2.2-1
- Update to 2.2
diff --git a/sources b/sources
index 610c9ba..50c46f7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6261d7991154c992477b32b8f3bea18b commons-math-2.2-src.tar.gz
+SHA512 (commons-math3-3.6.1-src.tar.gz) = cd3d4736257999bb1affd0a3d9e86be983c24651e074c9819d85770a37cf1bd3f9a809e426a41036ba3fc10e992f7d164685b964b9cda05b6c9b7a70f62d237b