%global namedreltag .RELEASE
%global namedversion %{version}%{?namedreltag}
%global oname spring-shell
Name: springframework-shell
Version: 1.1.0
Release: 1%{?dist}
Summary: Spring based interactive shell
License: ASL 2.0
URL: https://github.com/spring-projects/spring-shell
Source0: https://github.com/spring-projects/spring-shell/archive/%{namedversion}.tar.gz
Source1: http://central.maven.org/maven2/org/springframework/shell/spring-shell/%{namedversion}/spring-shell-%{namedversion}.pom
BuildRequires: maven-local
BuildRequires: mvn(cglib:cglib)
BuildRequires: mvn(com.google.guava:guava)
BuildRequires: mvn(commons-io:commons-io)
BuildRequires: mvn(jline:jline)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.fusesource.jansi:jansi)
BuildRequires: mvn(org.hamcrest:hamcrest-library)
BuildRequires: mvn(org.mockito:mockito-core)
BuildRequires: mvn(org.springframework:spring-context-support)
BuildRequires: mvn(org.springframework:spring-core)
%if 0
# Test deps
BuildRequires: mvn(uk.co.modular-it:hamcrest-date:0.9.3)
%endif
BuildArch: noarch
%description
Spring Shell is an interactive shell that can be easily extended with
commands using a Spring based programming model.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n %{oname}-%{namedversion}
find . -name "*.bat" -print -delete
find . -name "*.class" -print -delete
find . -name "*.jar" -print -delete
mv docs/src/info/{license,notice}.txt .
cp -p %{SOURCE1} pom.xml
%pom_xpath_set "pom:dependency[pom:artifactId='jline']/pom:version" 2.10
%pom_xpath_set "pom:dependency[pom:artifactId='guava']/pom:version" 18.0
# package org.fusesource.jansi does not exist
%pom_add_dep org.fusesource.jansi:jansi
# Fix manifest entries
%pom_add_plugin "org.apache.maven.plugins:maven-jar-plugin:2.4" . "
true
"
# Add OSGi support
%pom_xpath_inject "pom:project" "bundle"
%pom_add_plugin org.apache.felix:maven-bundle-plugin:2.3.7 . '
true
org.springframework.shell
Spring Shell
SpringSource
${project.version}
bundle-manifest
process-classes
manifest
'
%pom_xpath_inject "pom:build" "
src/main/resources
false
**/*.txt
.
META-INF
license.txt
notice.txt
"
# Add test deps
%pom_add_dep junit:junit:4.7:test
%pom_add_dep org.mockito:mockito-core:1.8.5:test
%pom_add_dep org.hamcrest:hamcrest-library:1.3:test
# package uk.co.it.modular.hamcrest.date does not exist
rm -r src/test/java/org/springframework/shell/commands/BuiltInCommandTests.java \
src/test/java/org/springframework/shell/core/SimpleParserTests.java
%mvn_file :%{oname} %{oname}
%build
%mvn_build -- -Dproject.build.sourceEncoding=UTF-8
%install
%mvn_install
%files -f .mfiles
%doc docs/src/info/*.txt readme.dev README.md
%license license.txt notice.txt
%files javadoc -f .mfiles-javadoc
%license license.txt notice.txt
%changelog
* Sun Jun 28 2015 gil cattaneo 1.1.0-1
- initial rpm