Blob Blame History Raw
Name:           apache-mime4j
Version:        0.7.1
Release:        1%{?dist}
Summary:        Apache JAMES Mime4j

Group:          Development/Libraries
License:        ASL 2.0
URL:            http://james.apache.org/mime4j
Source0:        http://apache.online.bg//james/mime4j/apache-mime4j-project-%{version}-source-release.zip
BuildArch: noarch

BuildRequires: apache-commons-logging
BuildRequires: log4j
BuildRequires: junit
BuildRequires: apache-commons-io
BuildRequires: apache-james-project
BuildRequires: javacc-maven-plugin
Requires: apache-commons-logging
Requires: log4j
Requires: apache-commons-io

%description
Java stream based MIME message parser

%package javadoc
Group:          Documentation
Summary:        Javadoc for %{name}
Requires:       jpackage-utils

%description javadoc
API documentation for %{name}.


%prep
%setup -q -n %{name}-project-%{version}
rm -fr stage
# prevents rat plugin from failing the build
rm -fr DEPENDENCIES

%build
mvn-rpmbuild install javadoc:aggregate

%install
# jars
install -d -m 0755 %{buildroot}%{_javadir}

# poms
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml \
    %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom

for sub in core dom storage; do
    # install jar
    install -Dpm 644 ${sub}/target/%{name}-${sub}-%{version}.jar \
            $RPM_BUILD_ROOT/%{_javadir}/%{name}/${sub}.jar;

    # intall pom
    install -Dpm 644 ${sub}/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP.%{name}-${sub}.pom

    # maven depmap
    %add_maven_depmap JPP.%{name}-${sub}.pom %{name}/${sub}.jar
done

# javadoc
install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}/
rm -rf target/site/api*

%files
%doc LICENSE NOTICE RELEASE_NOTES.txt
%{_javadir}/*
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*

%files javadoc
%doc LICENSE
%{_javadocdir}/%{name}

%changelog
* Wed Nov 30 2011 Alexander Kurtakov <akurtako@redhat.com> 0.7.1-1
- Update to latest upstream.

* Wed Nov 30 2011 Alexander Kurtakov <akurtako@redhat.com> 0.6.1-2
- Adapt to current guidelines.

* Wed Feb 23 2011 Alexander Kurtakov <akurtako@redhat.com> 0.6.1-1
- Initial package.