diff --git a/.apache-commons-cli.metadata b/.apache-commons-cli.metadata index cbea3a0..10d247f 100644 --- a/.apache-commons-cli.metadata +++ b/.apache-commons-cli.metadata @@ -1 +1 @@ -c238aeb10a5114b50a6351a8b452a687426ce5b6 SOURCES/commons-cli-1.4-src.tar.gz +c05d24c0b19733adee226d28063f4fc028cfacd3 SOURCES/commons-cli-1.9.0-src.tar.gz diff --git a/.gitignore b/.gitignore index e47fecd..86436ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/commons-cli-1.4-src.tar.gz +SOURCES/commons-cli-1.9.0-src.tar.gz diff --git a/SOURCES/CLI-253-workaround.patch b/SOURCES/CLI-253-workaround.patch deleted file mode 100644 index 798c5a4..0000000 --- a/SOURCES/CLI-253-workaround.patch +++ /dev/null @@ -1,96 +0,0 @@ -commit 77218790904f40395304669f5d79740f459c0a90 (HEAD -> cli-253, origin/cli-253) -Author: Michal Srb -AuthorDate: Mon Jun 22 15:01:30 2015 +0200 -Commit: Michal Srb -CommitDate: Mon Jun 22 15:04:05 2015 +0200 - - [CLI-253] Prevent "Unrecognized option: --null" when handling long opts in PosixParser - -diff --git a/src/main/java/org/apache/commons/cli/Options.java b/src/main/java/org/apache/commons/cli/Options.java -index 0ee4eea..1c38194 100644 ---- a/src/main/java/org/apache/commons/cli/Options.java -+++ b/src/main/java/org/apache/commons/cli/Options.java -@@ -224,6 +224,20 @@ public class Options implements Serializable - } - - /** -+ * Retrieve the {@link Option} matching the long name specified. -+ * The leading hyphens in the name are ignored (up to 2). -+ * -+ * @param opt long name of the {@link Option} -+ * @return the option represented by opt -+ */ -+ Option getLongOption(String opt) -+ { -+ opt = Util.stripLeadingHyphens(opt); -+ -+ return longOpts.get(opt); -+ } -+ -+ /** - * Returns the options with a long name starting with the name specified. - * - * @param opt the partial name of the option -diff --git a/src/main/java/org/apache/commons/cli/PosixParser.java b/src/main/java/org/apache/commons/cli/PosixParser.java -index c13a65e..14d2936 100644 ---- a/src/main/java/org/apache/commons/cli/PosixParser.java -+++ b/src/main/java/org/apache/commons/cli/PosixParser.java -@@ -131,7 +131,7 @@ public class PosixParser extends Parser - } - else - { -- currentOption = options.getOption(matchingOpts.get(0)); -+ currentOption = options.getLongOption(matchingOpts.get(0)); - - tokens.add("--" + currentOption.getLongOpt()); - if (pos != -1) -diff --git a/src/test/java/org/apache/commons/cli/bug/BugCLI253Test.java b/src/test/java/org/apache/commons/cli/bug/BugCLI253Test.java -new file mode 100644 -index 0000000..e37b7bc ---- /dev/null -+++ b/src/test/java/org/apache/commons/cli/bug/BugCLI253Test.java -@@ -0,0 +1,44 @@ -+/* -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed with -+ * this work for additional information regarding copyright ownership. -+ * The ASF licenses this file to You under the Apache License, Version 2.0 -+ * (the "License"); you may not use this file except in compliance with -+ * the License. You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+package org.apache.commons.cli.bug; -+ -+import static org.junit.Assert.assertTrue; -+ -+import org.apache.commons.cli.CommandLine; -+import org.apache.commons.cli.Option; -+import org.apache.commons.cli.Options; -+import org.apache.commons.cli.ParseException; -+import org.apache.commons.cli.PosixParser; -+import org.junit.Test; -+ -+@SuppressWarnings("deprecation") // tests some deprecated classes -+public class BugCLI253Test { -+ -+ @Test -+ public void testGroovyUseCase() throws ParseException { -+ CommandLine cli = new PosixParser().parse(getOptions(), new String[] { "--classpath" }); -+ assertTrue(cli.hasOption("--classpath")); -+ } -+ -+ private Options getOptions() { -+ Options options = new Options(); -+ options.addOption(Option.builder("classpath").build()); -+ options.addOption(Option.builder("cp").longOpt("classpath").build()); -+ return options; -+ } -+} diff --git a/SPECS/apache-commons-cli.spec b/SPECS/apache-commons-cli.spec index fd82760..609a259 100644 --- a/SPECS/apache-commons-cli.spec +++ b/SPECS/apache-commons-cli.spec @@ -1,33 +1,38 @@ %bcond_with bootstrap Name: apache-commons-cli -Version: 1.4 -Release: 20%{?dist} +Version: 1.9.0 +Release: 4%{?dist} Summary: Command Line Interface Library for Java -License: ASL 2.0 -URL: http://commons.apache.org/cli/ +License: Apache-2.0 +URL: https://commons.apache.org/proper/commons-cli/ BuildArch: noarch -ExclusiveArch: aarch64 ppc64le s390x x86_64 noarch +ExclusiveArch: %{java_arches} noarch -Source0: http://www.apache.org/dist/commons/cli/source/commons-cli-%{version}-src.tar.gz +Source0: https://www.apache.org/dist/commons/cli/source/commons-cli-%{version}-src.tar.gz -# workaround for https://issues.apache.org/jira/browse/CLI-253 -Patch0: CLI-253-workaround.patch - -BuildRequires: maven-local-openjdk8 %if %{with bootstrap} BuildRequires: javapackages-bootstrap %else -BuildRequires: mvn(junit:junit) +BuildRequires: maven-local +BuildRequires: mvn(commons-io:commons-io) BuildRequires: mvn(org.apache.commons:commons-parent:pom:) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) +BuildRequires: mvn(org.junit.jupiter:junit-jupiter-api) +BuildRequires: mvn(org.junit.jupiter:junit-jupiter-engine) +BuildRequires: mvn(org.junit.jupiter:junit-jupiter-params) +BuildRequires: mvn(org.mockito:mockito-core) %endif %description The CLI library provides a simple and easy to use API for working with the command line arguments and options. -%{?javadoc_package} +%package javadoc +Summary: API documentation for %{name} + +%description javadoc +API documentation for %{name}. %prep %autosetup -p1 -n commons-cli-%{version}-src @@ -37,7 +42,7 @@ command line arguments and options. %mvn_file : commons-cli %{name} %build -%mvn_build -- -Dmaven.compiler.source=1.6 -Dmaven.compiler.target=1.6 +%mvn_build %install %mvn_install @@ -46,28 +51,66 @@ command line arguments and options. %license LICENSE.txt NOTICE.txt %doc README.md RELEASE-NOTES.txt +%files javadoc -f .mfiles-javadoc + %changelog -* Sat Nov 23 2024 Marián Konček - 1.4-20 -- Add noarch to ExclusiveArch +* Fri Nov 29 2024 Mikolaj Izdebski - 1.9.0-3 +- Update javapackages test plan to f42 -* Sat Nov 23 2024 Marián Konček - 1.4-19 -- Disable building on i686 +* Tue Sep 03 2024 Mikolaj Izdebski - 1.9.0-2 +- Use %%autosetup -C -* Wed Nov 20 2024 Marián Konček - 1.4-18 -- Rebuild with regenerated Requires on Java +* Fri Aug 23 2024 Mikolaj Izdebski - 1.9.0-1 +- Update to upstream version 1.9.0 +- Resolves: rhbz#2305042 -* Mon Jan 30 2023 Mikolaj Izdebski - 1.4-17 -- Rebuild to regenerate auto-requires +* Wed Jul 17 2024 Fedora Release Engineering - 1.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild -* Mon Aug 09 2021 Mohan Boddu - 1.4-16 -- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Related: rhbz#1991688 +* Tue Jul 16 2024 Marian Koncek - 1.8.0-1 +- Update to upstream version 1.8.0 -* Wed Jun 09 2021 Mikolaj Izdebski - 1.4-15 -- Rebuild to workaround DistroBaker issue +* Tue Feb 27 2024 Jiri Vanek - 1.6.0-5 +- Rebuilt for java-21-openjdk as system jdk -* Tue Jun 08 2021 Mikolaj Izdebski - 1.4-14 -- Bootstrap Maven for CentOS Stream 9 +* Fri Feb 23 2024 Jiri Vanek - 1.6.0-4 +- bump of release for for java-21-openjdk as system jdk + +* Mon Jan 22 2024 Fedora Release Engineering - 1.6.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 1.6.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Dec 04 2023 Mikolaj Izdebski - 1.6.0-1 +- Update to upstream version 1.6.0 + +* Wed Sep 20 2023 Mikolaj Izdebski - 1.5.0-8 +- Rebuild to regenerate auto-Requires on java + +* Fri Sep 01 2023 Mikolaj Izdebski - 1.5.0-7 +- Convert License tag to SPDX format + +* Wed Jul 19 2023 Fedora Release Engineering - 1.5.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jan 18 2023 Fedora Release Engineering - 1.5.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Wed Jul 20 2022 Fedora Release Engineering - 1.5.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Feb 05 2022 Jiri Vanek - 1.5.0-3 +- Rebuilt for java-17-openjdk as system jdk + +* Wed Jan 19 2022 Fedora Release Engineering - 1.5.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Nov 4 2021 Christian Schuermann 1.5.0-1 +- Update to upstream version 1.5.0 + +* Wed Jul 21 2021 Fedora Release Engineering - 1.4-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Mon May 17 2021 Mikolaj Izdebski - 1.4-13 - Bootstrap build