Use maven3 to build

- Versionless jars & javadocs
This commit is contained in:
Stanislav Ochotnicky 2011-06-10 10:45:46 +02:00
parent b06842e459
commit b4a97b55c1

View File

@ -2,7 +2,7 @@
Name: atinject
Version: 1
Release: 2.20100611svn86%{?dist}
Release: 3.20100611svn86%{?dist}
Summary: Dependency injection specification for Java (JSR-330)
Group: Development/Libraries
@ -14,10 +14,9 @@ URL: http://code.google.com/p/atinject/
# svn export -r86 http://atinject.googlecode.com/svn/trunk atinject-1
# tar caf atinject-1.tar.xz atinject-1
Source0: %{name}-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: maven2
BuildRequires: maven
BuildRequires: maven-install-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-surefire-provider-junit4
@ -54,15 +53,9 @@ Requires: jpackage-utils
rm -rf lib/
%build
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL
mvn-jpp \
-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
install javadoc:javadoc
mvn-rpmbuild install javadoc:aggregate
%install
rm -rf %{buildroot}
install -d -m 755 %{buildroot}%{_javadir}
install -d -m 755 %{buildroot}%{_mavenpomdir}
@ -70,25 +63,17 @@ install -d -m 755 %{buildroot}%{_mavenpomdir}
# poms
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml \
%{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
# jar files
install -pm 644 target/%{artifactId}-*.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
# symlinks
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
install -pm 644 target/%{artifactId}-*.jar %{buildroot}%{_javadir}/%{name}.jar
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name} # ghost symlink
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%clean
rm -rf %{buildroot}
%post
%update_maven_depmap
@ -97,16 +82,18 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*
%{_javadir}/*.jar
%files javadoc
%defattr(-,root,root,-)
%doc %{_javadocdir}/%{name}*
%doc %{_javadocdir}/%{name}
%changelog
* Fri Jun 10 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1-3.20100611svn86
- Use maven3 to build
- Versionless jars & javadocs
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1-2.20100611svn86
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild