Use maven 3 to build

Packaging fixes according to latest guidelines
This commit is contained in:
Stanislav Ochotnicky 2011-11-24 16:20:42 +01:00
parent 69cd362312
commit 64a3b17a87

View File

@ -4,7 +4,7 @@
Name: apache-%{short_name} Name: apache-%{short_name}
Version: 2.2 Version: 2.2
Release: 2%{?dist} Release: 3%{?dist}
Summary: Internet protocol suite Java library Summary: Internet protocol suite Java library
License: ASL 2.0 License: ASL 2.0
Group: Development/Libraries Group: Development/Libraries
@ -22,9 +22,6 @@ BuildRequires: apache-commons-parent
Requires: java >= 1:1.6.0 Requires: java >= 1:1.6.0
Requires: jpackage-utils >= 0:1.7.2 Requires: jpackage-utils >= 0:1.7.2
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
Provides: jakarta-%{short_name} = 0:%{version}-%{release} Provides: jakarta-%{short_name} = 0:%{version}-%{release}
Obsoletes: jakarta-%{short_name} < 0:2.0-3 Obsoletes: jakarta-%{short_name} < 0:2.0-3
@ -56,9 +53,8 @@ export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL mkdir -p $MAVEN_REPO_LOCAL
# test.failure.ignore added because package would not build on koji # test.failure.ignore added because package would not build on koji
# with TimeTCPClientTest failing # with TimeTCPClientTest failing
mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL \ mvn-rpmbuild -Dmaven.test.failure.ignore=true \
-Dmaven.test.failure.ignore=true \ install javadoc:aggregate
install javadoc:javadoc
%install %install
# jars # jars
@ -70,41 +66,33 @@ ln -s %{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{short_name}.jar
# pom # pom
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir} install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
%add_to_maven_depmap org.apache.commons %{short_name} %{version} JPP %{name} %add_maven_depmap JPP-%{name}.pom %{name}.jar -a "org.apache.commons:%{short_name}"
# following line is only for backwards compatibility. New packages
# should use proper groupid org.apache.commons and also artifactid
%add_to_maven_depmap %{short_name} %{short_name} %{version} JPP %{name}
# javadoc # javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name} install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%post
%update_maven_depmap
%postun
%update_maven_depmap
%pre javadoc %pre javadoc
# workaround for rpm bug, can be removed in F-17 # workaround for rpm bug, can be removed in F-17
[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \ [ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || : rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
%files %files
%defattr(-,root,root,-)
%doc LICENSE.txt NOTICE.txt %doc LICENSE.txt NOTICE.txt
%{_javadir}/* %{_javadir}/*
%{_mavenpomdir}/JPP-%{name}.pom %{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir} %{_mavendepmapfragdir}/%{name}
%files javadoc %files javadoc
%defattr(-,root,root,-)
%doc %{_javadocdir}/%{name} %doc %{_javadocdir}/%{name}
%doc LICENSE.txt NOTICE.txt %doc LICENSE.txt NOTICE.txt
%changelog %changelog
* Thu Nov 24 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.2-3
- Use maven 3 to build
- Packaging fixes according to latest guidelines
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2-2 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild