commit 3071231fdb4abd48f9f97f42b1bf5a5fbef54d87 Author: Adrian Schröter Date: Mon Feb 19 15:35:09 2024 +0100 Sync from SUSE:ALP:Source:Standard:1.0 apache-commons-cli revision 8774cd4e186456e713c33a60f97b20f1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fecc750 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/CLI-253-workaround.patch b/CLI-253-workaround.patch new file mode 100644 index 0000000..4534717 --- /dev/null +++ b/CLI-253-workaround.patch @@ -0,0 +1,95 @@ +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 + +Index: commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/Options.java +=================================================================== +--- commons-cli-1.5.0-src.orig/src/main/java/org/apache/commons/cli/Options.java ++++ commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/Options.java +@@ -186,6 +186,20 @@ public class Options implements Serializ + return this; + } + ++ /* ++ * 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); ++ } ++ + /** + * Gets the options with a long name starting with the name specified. + * +Index: commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/PosixParser.java +=================================================================== +--- commons-cli-1.5.0-src.orig/src/main/java/org/apache/commons/cli/PosixParser.java ++++ commons-cli-1.5.0-src/src/main/java/org/apache/commons/cli/PosixParser.java +@@ -145,7 +145,7 @@ public class PosixParser extends Parser + } else if (matchingOpts.size() > 1) { + throw new AmbiguousOptionException(opt, matchingOpts); + } else { +- currentOption = options.getOption(matchingOpts.get(0)); ++ currentOption = options.getLongOption(matchingOpts.get(0)); + + tokens.add("--" + currentOption.getLongOpt()); + if (pos != -1) { +Index: commons-cli-1.5.0-src/src/test/java/org/apache/commons/cli/bug/BugCLI253Test.java +=================================================================== +--- /dev/null ++++ commons-cli-1.5.0-src/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/apache-commons-cli-build.xml b/apache-commons-cli-build.xml new file mode 100644 index 0000000..6664d1b --- /dev/null +++ b/apache-commons-cli-build.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apache-commons-cli-rpmlintrc b/apache-commons-cli-rpmlintrc new file mode 100644 index 0000000..406af4f --- /dev/null +++ b/apache-commons-cli-rpmlintrc @@ -0,0 +1 @@ +addFilter("apache-commons-cli-javadoc.noarch: W: package-with-huge-docs") \ No newline at end of file diff --git a/apache-commons-cli.changes b/apache-commons-cli.changes new file mode 100644 index 0000000..f5b8c49 --- /dev/null +++ b/apache-commons-cli.changes @@ -0,0 +1,171 @@ +------------------------------------------------------------------- +Thu Sep 21 05:39:25 UTC 2023 - Fridrich Strba + +- Build with java source/target levels 8 + +------------------------------------------------------------------- +Thu Dec 16 16:26:28 UTC 2021 - David Anes + +- Rebased patch CLI-253-workaround.patch to new version. +- Updated build XML file to new version. +- Harmonized the use of X.Y.X strings everywhere. +- Updated new source locations from Apache. +- Added 'apache-commons-cli-rpmlintrc' to silence 'package-with-huge-docs' warning (Javadoc generates many files...) + +- Update to 1.5: + * New features: + - (CLI-217) Accommodate toggling partial matching in DefaultParser. Thanks to Rubin Simons. + - (CLI-274) Option parser type EXISTING_FILE_VALUE not check file existing Thanks to Béla Schaum. + - (CLI-271) CommandLine.getXXX and CommandLine.hasXXX should accept an Option as a parameter Thanks to Christoph Läubrich. + - (CLI-276) Adjust access-modifier of checkRequiredOptions() to protected. Thanks to Jason Dillon. + - (CLI-282) TypeHandler should throw ParseException for an unsupported class. Thanks to Alex Nordlund. + - Added setter for Builder.option #33. Thanks to Waldemar Sojka, Gary Gregory. + - Add Option unit tests #76. Thanks to Waldemar Sojka, Gary Gregory. + * Fixed bugs: + - Fix NPE in DefaultParser.isLongOption(String). Thanks to Gary Gregory. + - (CLI-279) @param or @return lines should end with a period in CommandLine.java Thanks to Krishna Mohan Rao Kandunoori. + - Replace deprecated FindBugs with SpotBugs. Thanks to Gary Gregory. + - Replace CLIRR with JApiCmp. Thanks to Gary Gregory. + - Option Javadocs grammar nits #55. Thanks to Elliotte Rusty Harold. + - Minor Improvements #57, #61. Thanks to Arturo Bernal, Gary Gregory. + - (CLI-254) Input "test" gets parsed as test, quotes die #58. Thanks to stoty. + - (CLI-287) Allow whitespace-only header and footer #26. Thanks to MrQubo, Gary Gregory. + * Updates: + - (CLI-294) Update Java from version 5 to 7. + - Docs: Replace OptionBuilder in usage page #30. Thanks to Mincong Huang. + - Remove deprecated sudo setting. #36. Thanks to dengliming. + - Bump junit:junit from 4.12 to 4.13.2, #53, #60. Thanks to Gary Gregory, Dependabot. + - Bump commons-parent from 48 to 52. Thanks to Dependabot. + - Bump maven-pmd-plugin from 3.12.0 to 3.15.0, #44, #54, #67. Thanks to Dependabot. + - Bump actions/checkout from v2.3.1 to v2.3.5 #46, #72. Thanks to Dependabot. + - Bump actions/setup-java from v1.4.2 to v2 #50. Thanks to Dependabot, Gary Gregory. + - Bump maven-antrun-plugin from 1.7 to 3.0.0 #43. Thanks to Dependabot. + - Bump maven-checkstyle-plugin from 2.15 to 3.1.2 #41. Thanks to Gary Gregory. + - Bump checkstyle to 9.0.1 #68. Thanks to Gary Gregory. + - Bump actions/cache from 2 to 2.1.6 #64, #65. Thanks to Dependabot. + - Bump commons.animal-sniffer.version 1.19 -> 1.20. Thanks to Gary Gregory. + - Bump maven-bundle-plugin 5.1.1 -> 5.1.2. Thanks to Gary Gregory. + - Bump biz.aQute.bndlib.version 5.1.2 -> 6.0.0. Thanks to Gary Gregory. + - Bump spotbugs from 4.4.1 to 4.4.2 #70. Thanks to Dependabot. + - Bump spotbugs-maven-plugin from 4.4.1 to 4.4.2.2 #71. Thanks to Dependabot.- + +------------------------------------------------------------------- +Fri Feb 12 12:54:07 UTC 2021 - Fridrich Strba + +- Add OSGi manifest to the build files. +- Set java source/target levels to 6 + +------------------------------------------------------------------- +Mon Mar 25 17:19:16 UTC 2019 - Fridrich Strba + +- Remove pom parent, since we don't use it when not building with + maven + +------------------------------------------------------------------- +Tue Feb 5 13:30:36 UTC 2019 - Jan Engelhardt + +- Trim bias from description; update RPM groups. + +------------------------------------------------------------------- +Tue Feb 5 12:10:09 UTC 2019 - Fridrich Strba + +- Clean-up the spec file +- Removed patch: + * commons-cli-1.4-jdk9.patch + + not needed since we are not building with maven +- Added patch: + * CLI-253-workaround.patch + + [CLI-253] Prevent "Unrecognized option: --null" when handling + long opts in PosixParser + +------------------------------------------------------------------- +Tue Oct 23 17:55:39 UTC 2018 - Fridrich Strba + +- Upgrade to version 1.4 +- Modify the build.xml.tar.bz2 to build with source/target 8 and + adapt for the commons-cli-1.4 +- Modified patch: + * commons-cli-1.2-jdk9.patch -> commons-cli-1.4-jdk9.patch + + Rediff the remaining hunk to the changed context of pom.xml + +------------------------------------------------------------------- +Tue May 15 06:21:41 UTC 2018 - fstrba@suse.com + +- Modified patch: + * commons-cli-1.2-jdk9.patch + + Build with source and target 8 to prepare for a possible + removal of 1.6 compatibility +- Run fdupes on the documentation + +------------------------------------------------------------------- +Fri Sep 29 06:41:14 UTC 2017 - fstrba@suse.com + +- Don't condition the maven defines on release version, but on + _maven_repository being defined + +------------------------------------------------------------------- +Thu Sep 14 09:33:27 UTC 2017 - fstrba@suse.com + +- Added patch: + * commons-cli-1.2-jdk9.patch + - Specify java source and target level 1.6 in order to allow + building with jdk9 + +------------------------------------------------------------------- +Fri May 19 08:41:33 UTC 2017 - tchvatal@suse.com + +- Fix build with new javapackages-tools + +------------------------------------------------------------------- +Wed Mar 18 09:37:41 UTC 2015 - tchvatal@suse.com + +- Fix build with new javapackages-tools + +------------------------------------------------------------------- +Thu Dec 4 18:55:52 UTC 2014 - p.drouand@gmail.com + +- Remove java-devel dependency; not needed anymore + +------------------------------------------------------------------- +Fri Jun 27 11:14:46 UTC 2014 - tchvatal@suse.com + +- Fix the pom providing on 13.2 + +------------------------------------------------------------------- +Sat Mar 8 18:22:40 UTC 2014 - badshah400@gmail.com + +- For openSUSE >= 13.1 remove all references to maven scripts as + these do not work; fixes building for openSUSE >= 13.1 +- Lots of specfile formatting cleanups +- Move old %changelog section entries to .changes with proper + formatting +- Add copyright info to spec file. + +------------------------------------------------------------------- +Mon Dec 12 23:47:58 UTC 2011 - dmacvicar@suse.de + +- rename apache-cli to apache-commons-cli +- add java() provides + +------------------------------------------------------------------- +Tue Jul 19 10:07:32 UTC 2011 - dmacvicar@suse.de + +- converted to build with ant:ant +- removed reference to non existing target/osgi/MANIFEST + in maven-build.xml + +------------------------------------------------------------------- +Tue Nov 09 00:00:00 UTC 2010 - chris.spike@arcor.de + +- Removed maven* BRs in favour of apache-commons-parent +- Added deprecated groupId to depmap for compatibility reasons + +------------------------------------------------------------------- +Mon Oct 18 00:00:00 UTC 2010 - chris.spike@arcor.de + +- Removed Epoch + +------------------------------------------------------------------- +Sun Oct 03 00:00:00 UTC 2010 - chris.spike@arcor.de + +- Rename and rebase from jakarta-commons-cli diff --git a/apache-commons-cli.spec b/apache-commons-cli.spec new file mode 100644 index 0000000..7e89407 --- /dev/null +++ b/apache-commons-cli.spec @@ -0,0 +1,88 @@ +# +# spec file for package apache-commons-cli +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global base_name cli +%global short_name commons-%{base_name} +Name: apache-commons-cli +Version: 1.5.0 +Release: 0 +Summary: Command Line Interface Library for Java +License: Apache-2.0 +Group: Development/Libraries/Java +URL: https://commons.apache.org/%{base_name}/ +Source0: https://dlcdn.apache.org/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz +Source1: %{name}-build.xml +Source2: apache-commons-cli-rpmlintrc +Patch0: CLI-253-workaround.patch +BuildRequires: ant +BuildRequires: fdupes +BuildRequires: javapackages-local +Provides: jakarta-%{short_name} = %{version}-%{release} +Obsoletes: jakarta-%{short_name} < %{version}-%{release} +Provides: apache-cli = %{version}-%{release} +Obsoletes: apache-cli < %{version}-%{release} +BuildArch: noarch + +%description +The CLI library provides an API for working with the +command line arguments and options. + +%package javadoc +Summary: Javadoc for %{name} +Group: Documentation/HTML +Provides: jakarta-%{short_name}-javadoc = %{version}-%{release} +Obsoletes: jakarta-%{short_name}-javadoc < %{version}-%{release} + +%description javadoc +This package contains the API documentation for %{name}. + +%prep +%setup -q -n %{short_name}-%{version}-src +cp %{SOURCE1} build.xml +%patch0 -p1 + +%pom_remove_parent + +%build +%ant package javadoc + +%install +# jars +install -Dpm 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{short_name}.jar +ln -sf %{short_name}.jar %{buildroot}%{_javadir}/%{name}.jar + +# pom +install -d -m 755 %{buildroot}%{_mavenpomdir} +install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/%{short_name}.pom +%add_maven_depmap %{short_name}.pom %{short_name}.jar -a "org.apache.commons:%{short_name}" + +# javadoc +install -d -m 0755 %{buildroot}%{_javadocdir}/%{name} +cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name} +%fdupes -s %{buildroot}%{_javadocdir}/%{name} + +%files -f .mfiles +%license LICENSE.txt NOTICE.txt +%doc README.md RELEASE-NOTES.txt +%{_javadir}/%{name}.jar + +%files javadoc +%license LICENSE.txt +%{_javadocdir}/%{name} + +%changelog diff --git a/commons-cli-1.5.0-src.tar.gz b/commons-cli-1.5.0-src.tar.gz new file mode 100644 index 0000000..17a7427 --- /dev/null +++ b/commons-cli-1.5.0-src.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26420d8a09a71cce936c40a1c977cbb20d1cdb0d25473c25164d4837927f7ee3 +size 156731