[args4j] Adapt to current guidelines

Michal Srb msrb at fedoraproject.org
Thu Feb 20 13:13:07 UTC 2014


commit 9ff2f11735dbe78dcc2006aebc68170df9ab6e72
Author: Michal Srb <msrb at redhat.com>
Date:   Thu Feb 20 14:08:50 2014 +0100

    Adapt to current guidelines

 args4j.spec |  118 ++++++++++++++++++++++++----------------------------------
 1 files changed, 49 insertions(+), 69 deletions(-)
---
diff --git a/args4j.spec b/args4j.spec
index ff75faa..65a2ed4 100644
--- a/args4j.spec
+++ b/args4j.spec
@@ -1,102 +1,82 @@
+Name:           args4j
+Version:        2.0.26
+Release:        2%{?dist}
+Summary:        Java command line arguments parser
+License:        MIT
+URL:            http://args4j.kohsuke.org/
+Source0:        https://github.com/kohsuke/%{name}/archive/%{name}-site-%{version}.tar.gz
+
+BuildArch:      noarch
+
+BuildRequires:  maven-local
+BuildRequires:  mvn(com.sun:tools)
+BuildRequires:  mvn(junit:junit)
+BuildRequires:  mvn(org.apache.ant:ant)
+BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
+BuildRequires:  mvn(org.apache.maven.plugins:maven-shade-plugin)
+BuildRequires:  mvn(org.apache.maven.plugins:maven-site-plugin)
+BuildRequires:  mvn(org.kohsuke:pom:pom:)
+BuildRequires:  mvn(org.mockito:mockito-all)
 
-Name:              args4j
-%global tools_name %{name}-tools
-%global site_name  %{name}-site
-
-Version:          2.0.26
-Release:          1%{?dist}
-Summary:          Small Java lib that makes it easy to parse command line options/args in CUI apps
-License:          MIT and BSD
-Group:            Development/Libraries
-# http://args4j.java.net/
-URL:              http://%{name}.java.net/
-Source0:          https://github.com/kohsuke/%{name}/archive/%{site_name}-%{version}.tar.gz
-
-BuildArch:        noarch
-
-BuildRequires:    java-devel
-BuildRequires:    jpackage-utils
-BuildRequires:    maven-local
-BuildRequires:    maven-dependency-plugin
-BuildRequires:    maven-install-plugin
-BuildRequires:    maven-shade-plugin
-BuildRequires:    mockito
-
-Requires:         java
-Requires:         jpackage-utils
 
 %description
 args4j is a small Java class library that makes it easy
 to parse command line options/arguments in your CUI application.
-- It makes the command line parsing very easy by using annotations.
-- You can generate the usage screen very easily.
-- You can generate HTML/XML that lists all options for your documentation.
-- Fully supports localization.
+- It makes the command line parsing very easy by using annotations
+- You can generate the usage screen very easily
+- You can generate HTML/XML that lists all options for your documentation
+- Fully supports localization
 - It is designed to parse javac like options (as opposed to GNU-style
-  where ls -lR is considered to have two options l and R.)
-
-args4j-tools are development-time tools for generating additional artifacits.
+  where ls -lR is considered to have two options l and R)
 
 %package javadoc
-Summary:          API documentation for %{name}
-Group:            Documentation
-Requires:         jpackage-utils
+Summary:        API documentation for %{name}
 
 %description javadoc
 This package contains the API documentation for %{name}.
 
 %prep
-%setup -q -n %{name}-%{site_name}-%{version}
+%setup -q -n %{name}-%{name}-site-%{version}
 
 # removing classpath addition
-sed -i 's/<addClasspath>true/<addClasspath>false/g' %{tools_name}/pom.xml
+sed -i 's/<addClasspath>true/<addClasspath>false/g' %{name}-tools/pom.xml
 
 # fix ant group id
-sed -i 's/<groupId>ant/<groupId>org.apache.ant/g' %{tools_name}/pom.xml
+sed -i 's/<groupId>ant/<groupId>org.apache.ant/g' %{name}-tools/pom.xml
 
 # removing bundled stuff
 find -name '*.class' -exec rm -f '{}' \;
 find -name '*.jar' -exec rm -f '{}' \;
 
-%pom_xpath_remove "pom:parent"
+# XMvn cannot generate requires on dependecies with scope "system"
+%pom_xpath_remove "pom:profile[pom:id[text()='jdk-tools-jar']]" %{name}-tools
+%pom_add_dep com.sun:tools %{name}-tools
+
+# we don't need these now
+%pom_disable_module args4j-maven-plugin
+%pom_disable_module args4j-maven-plugin-example
+
+# install also compat symlinks
+%mvn_file ":{*}" %{name}/@1 @1
 
 %build
-mvn-rpmbuild -pl :args4j-site,:args4j,:args4j-tools install javadoc:aggregate
+%mvn_build
 
 %install
-# jars
-install -d -m 755 %{buildroot}%{_javadir}
-install -p -m 644 %{name}/target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
-install -p -m 644 %{tools_name}/target/%{tools_name}-%{version}.jar %{buildroot}%{_javadir}/%{tools_name}.jar
-
-# pom
-install -d -m 755 %{buildroot}%{_mavenpomdir}
-install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{site_name}.pom
-install -pm 644 %{name}/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
-install -pm 644 %{tools_name}/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{tools_name}.pom
-
-%add_maven_depmap JPP-%{site_name}.pom
-%add_maven_depmap JPP-%{name}.pom %{name}.jar
-%add_maven_depmap JPP-%{tools_name}.pom %{tools_name}.jar
-
-# javadoc
-install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
-cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
-
-%files
+%mvn_install
+
+
+%files -f .mfiles
+%dir %{_javadir}/%{name}
 %doc %{name}/LICENSE.txt
-%{_javadir}/%{name}.jar
-%{_javadir}/%{tools_name}.jar
-%{_mavenpomdir}/JPP-%{site_name}.pom
-%{_mavenpomdir}/JPP-%{name}.pom
-%{_mavenpomdir}/JPP-%{tools_name}.pom
-%{_mavendepmapfragdir}/%{name}
-
-%files javadoc
+
+%files javadoc -f .mfiles-javadoc
 %doc %{name}/LICENSE.txt
-%doc %{_javadocdir}/%{name}
 
 %changelog
+* Thu Feb 20 2014 Michal Srb <msrb at redhat.com> - 2.0.26-2
+- Adapt to current guidelines
+
 * Thu Feb 20 2014 Michal Srb <msrb at redhat.com> - 2.0.26-1
 - Update to latest upstream 2.0.26
 


More information about the scm-commits mailing list