diff --git a/.beust-jcommander.metadata b/.beust-jcommander.metadata new file mode 100644 index 0000000..fbfb43b --- /dev/null +++ b/.beust-jcommander.metadata @@ -0,0 +1 @@ +8ba3dc3ac84185a4969e27fa0e985a70352fd2dc SOURCES/beust-jcommander-1.71.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..95cc97b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/beust-jcommander-1.71.tar.gz diff --git a/SOURCES/0001-ParseValues-NullPointerException-patch.patch b/SOURCES/0001-ParseValues-NullPointerException-patch.patch new file mode 100644 index 0000000..4ce87b8 --- /dev/null +++ b/SOURCES/0001-ParseValues-NullPointerException-patch.patch @@ -0,0 +1,61 @@ +From 2b813829d02b89206493520eb86075a43b145db9 Mon Sep 17 00:00:00 2001 +From: Roman Vais +Date: Tue, 13 Jun 2017 13:24:24 +0200 +Subject: [PATCH] ParseValues-NullPointerException-patch + +--- + .../java/com/beust/jcommander/Parameterized.java | 27 ++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +diff --git a/src/main/java/com/beust/jcommander/Parameterized.java b/src/main/java/com/beust/jcommander/Parameterized.java +index 3264008..e937a66 100644 +--- a/src/main/java/com/beust/jcommander/Parameterized.java ++++ b/src/main/java/com/beust/jcommander/Parameterized.java +@@ -13,6 +13,8 @@ import java.lang.reflect.Type; + import java.util.Collections; + import java.util.List; + import java.util.Set; ++import java.util.logging.Level; ++import java.util.logging.Logger; + + /** + * Encapsulate a field or a method annotated with @Parameter or @DynamicParameter +@@ -180,12 +182,33 @@ public class Parameterized { + String fieldName = Character.toLowerCase(name.charAt(3)) + name.substring(4); + Object result = null; + try { +- Field field = method.getDeclaringClass().getDeclaredField(fieldName); ++ Field field = object.getClass().getDeclaredField(fieldName); + if (field != null) { + setFieldAccessible(field); + result = field.get(object); + } +- } catch(NoSuchFieldException | IllegalAccessException ex) { ++ } catch(NoSuchFieldException ex) { ++ Class clazz = object.getClass(); ++ Field found = null; ++ while (clazz != null && method.getDeclaringClass().isAssignableFrom(clazz)) { ++ try { ++ found = clazz.getDeclaredField(fieldName); ++ } catch (NoSuchFieldException nfex) { ++ // ignore ++ } ++ if (found != null) break; ++ clazz = clazz.getSuperclass(); ++ } ++ if (found != null) { ++ setFieldAccessible(found); ++ try { ++ result = found.get(object); ++ } catch (IllegalAccessException iex) { ++ // ignore ++ } ++ } ++ ++ } catch(IllegalAccessException ex) { + // ignore + } + return result; +-- +2.7.4 + diff --git a/SOURCES/beust-jcommander.pom b/SOURCES/beust-jcommander.pom new file mode 100644 index 0000000..f36c4ad --- /dev/null +++ b/SOURCES/beust-jcommander.pom @@ -0,0 +1,277 @@ + + + + 4.0.0 + com.beust + jcommander + jar + JCommander + @VERSION@ + A Java framework to parse command line options with annotations. + http://beust.com/jcommander + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + scm:git:git@github.com:cbeust/jcommander.git + scm:git:git@github.com:cbeust/jcommander.git + git@github.com:cbeust/jcommander.git + + + + + jcenter + bintray + http://jcenter.bintray.com + + + + + + + sonatype-nexus-staging + Nexus Staging Repository + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + Cedric Beust + + + + + org.sonatype.oss + oss-parent + 3 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.1 + + 1.8 + 1.8 + UTF-8 + + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.4.1 + + UTF-8 + + + + + + org.apache.felix + maven-bundle-plugin + 2.1.0 + + + bundle-manifest + process-classes + + manifest + + + + <_versionpolicy>$(@) + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.3.1 + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.10 + + false + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.7 + + *.internal + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.apache.felix + + maven-bundle-plugin + + + [2.1.0,) + + + manifest + + + + + + + + + + + + + + + + + org.testng + testng + 6.8.21 + jar + test + + + jcommander + com.beust + + + + + + + + + + license + + + + com.mycila.maven-license-plugin + maven-license-plugin + 1.7.0 + + false +
src/main/license/license-header.txt
+ + src/** + pom.xml + + + **/.git/** + + **/target/** + + false +
+ + + + check + + + +
+
+
+
+ + + + sign + + + + maven-gpg-plugin + 1.4 + + + sign-artifacts + verify + + sign + + + + + + + +
+ +
diff --git a/SOURCES/generate-tarball.sh b/SOURCES/generate-tarball.sh new file mode 100755 index 0000000..cb89cee --- /dev/null +++ b/SOURCES/generate-tarball.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +name=beust-jcommander +version="$(sed -n 's/Version:\s*//p' *.spec)" + +# RETRIEVE +wget "https://github.com/cbeust/jcommander/archive/${version}.tar.gz" -O "${name}-${version}.orig.tar.gz" + +rm -rf tarball-tmp +mkdir tarball-tmp +cd tarball-tmp +tar xf "../${name}-${version}.orig.tar.gz" + +# CLEAN TARBALL +rm -r */gradle* */kobalt* */lib + +tar cf "../${name}-${version}.tar.gz" * +cd .. +rm -r tarball-tmp "${name}-${version}.orig.tar.gz" diff --git a/SPECS/beust-jcommander.spec b/SPECS/beust-jcommander.spec new file mode 100644 index 0000000..bd361c5 --- /dev/null +++ b/SPECS/beust-jcommander.spec @@ -0,0 +1,144 @@ +Name: beust-jcommander +Version: 1.71 +Release: 5%{?dist} +Summary: Java framework for parsing command line parameters +License: ASL 2.0 +URL: http://jcommander.org/ +BuildArch: noarch + +# ./generate-tarball.sh +Source0: %{name}-%{version}.tar.gz +# Adapted from earlier version that still shipped poms. It uses kobalt for building now +Source1: %{name}.pom +# Cleaned up bundled jars hose licensing cannot be easily verified +Source2: generate-tarball.sh + +Patch0: 0001-ParseValues-NullPointerException-patch.patch + +BuildRequires: maven-local +BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) +BuildRequires: mvn(org.testng:testng) + +%description +JCommander is a very small Java framework that makes it trivial to +parse command line parameters (with annotations). + +%package javadoc +Summary: API documentation for %{name} + +%description javadoc +This package contains the %{summary}. + +%prep +%setup -q -n jcommander-%{version} +%patch0 -p1 + +chmod -x license.txt +cp -p %SOURCE1 pom.xml +sed -i 's/@VERSION@/%{version}/g' pom.xml + +%build +%mvn_file : %{name} +%mvn_build + +%install +%mvn_install + +%files -f .mfiles +%doc license.txt notice.md README.markdown + +%files javadoc -f .mfiles-javadoc +%doc license.txt notice.md + +%changelog +* Mon Jul 30 2018 Michael Simacek - 1.71-5 +- Repack the tarball without binaries + +* Thu Jul 12 2018 Fedora Release Engineering - 1.71-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 1.71-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.71-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Jun 13 2017 Roman Vais - 1.71-1 +- Update to upstream version 1.71 +- Add patch for issue https://github.com/cbeust/jcommander/issues/367 + +* Fri Mar 10 2017 Roman Vais - 1.66-1 +- Update to upstream version 1.66 + +* Fri Feb 17 2017 Roman Vais - 1.65-1 +- Update to upstream version 1.65 + +* Thu Jan 26 2017 Roman Vais - 1.62-1 +- Update to upstream version 1.62 + +* Wed Dec 14 2016 Michael Simacek - 1.60-1 +- Update to upstream version 1.60 + +* Tue Nov 01 2016 Roman Vais - 1.58-1 +- Update to upstream version 1.58 + +* Fri Sep 30 2016 Roman Vais - 1.57-1 +- Update to upstream version 1.57 +- Correct directory setup in prep section +- Change of tarball name in source url to correspond to upstream + +* Tue Sep 27 2016 Roman Vais - 1.56-1 +- New version release. + +* Wed Feb 03 2016 Fedora Release Engineering - 1.47-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.47-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Jan 28 2015 Michael Simacek - 1.47-1 +- Update to upstream version 1.47 +- Enable tests + +* Mon Oct 13 2014 Mikolaj Izdebski - 1.45-1 +- Update to upstream version 1.45 + +* Sat Jun 07 2014 Fedora Release Engineering - 1.35-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Feb 26 2014 Mikolaj Izdebski - 1.35-1 +- Update to upstream version 1.35 + +* Sat Aug 03 2013 Fedora Release Engineering - 1.30-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Feb 06 2013 Java SIG - 1.30-3 +- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild +- Replace maven BuildRequires with maven-local + +* Wed Feb 6 2013 Mikolaj Izdebski - 1.30-2 +- Replace BR: xmvn with maven-local + +* Thu Jan 10 2013 Mikolaj Izdebski - 1.30-1 +- Update to upstream version 1.30 +- Build with xmvn + +* Thu Aug 16 2012 Mikolaj Izdebski - 1.17-6 +- Install NOTICE files + +* Wed Jul 18 2012 Fedora Release Engineering - 1.17-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jan 12 2012 Fedora Release Engineering - 1.17-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Nov 30 2011 Alexander Kurtakov 1.17-3 +- Use the new maven macro. + +* Mon May 16 2011 Jaromir Capik - 1.17-2 +- Unwanted comment removal +- Target javadoc:jar replaced with javadoc:aggregate + +* Fri May 13 2011 Jaromir Capik - 1.17-1 +- Initial version of the package