%global oname base64
Name: java-base64
Version: 2.3.8
Release: 2%{?dist}
Summary: Java class for encoding and decoding Base64 notation
Group: Development/Libraries
# pom file license comment
# I have released this software into the Public Domain. That
# means you can do whatever you want with it. Really. You don't
# have to match it up with any other open source license -
# just use it. You can rename the files, move the Java packages,
# whatever you want. If your lawyers say you have to have a
# license, contact me, and I'll make a special release to you
# under whatever reasonable license you desire: MIT, BSD, GPL,
# whatever.
License: Public Domain
URL: http://iharder.net/base64/
Source0: https://github.com/omalley/base64/archive/release-%{version}.tar.gz
BuildRequires: java-devel
# test deps
BuildRequires: junit
BuildRequires: maven-local
BuildRequires: maven-compiler-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-resources-plugin
BuildRequires: maven-source-plugin
BuildRequires: maven-surefire-plugin
BuildRequires: maven-surefire-provider-junit4
Provides: %{oname} = %{version}-%{release}
Requires: java
BuildArch: noarch
%description
Base64 is a Public Domain Java class for encoding and
decoding Base64 notation. There are one-liner convenience
methods as well as Input and Output Streams.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n %{oname}-release-%{version}
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-compiler-plugin']" "2.5.1"
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-source-plugin']" "2.1.2"
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-javadoc-plugin']" "2.9"
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-release-plugin']" "2.2.1"
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-scm-plugin']" "1.7"
%pom_xpath_inject "pom:reporting/pom:plugins/pom:plugin[pom:artifactId ='maven-project-info-reports-plugin']" "2.4"
%pom_xpath_inject "pom:reporting/pom:plugins/pom:plugin[pom:artifactId ='maven-javadoc-plugin']" "2.9"
sed -i "s|2.3.9-SNAPSHOT|%{version}|" pom.xml
%build
mvn-rpmbuild package javadoc:aggregate
%install
mkdir -p %{buildroot}%{_javadir}
install -m 644 target/%{oname}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
(
cd %{buildroot}%{_javadir}
ln -sf %{name}.jar %{oname}.jar
)
mkdir -p %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
(
cd %{buildroot}%{_javadocdir}
ln -sf %{name} %{oname}
)
%files
%{_javadir}/%{name}.jar
%{_javadir}/%{oname}.jar
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%files javadoc
%{_javadocdir}/%{name}
%{_javadocdir}/%{oname}
%changelog
* Thu May 02 2013 gil cattaneo 2.3.8-2
- fix artifact name, added symlink
- fix javadoc name, added symlink
* Sun Apr 28 2013 gil cattaneo 2.3.8-1
- initial rpm