Update to latest java packaging guidelines

This commit is contained in:
Stanislav Ochotnicky 2012-03-19 14:16:06 +01:00
parent a421fc82bf
commit dc0e7eb912

View File

@ -12,13 +12,13 @@
Summary: Protocol Buffers - Google's data interchange format Summary: Protocol Buffers - Google's data interchange format
Name: protobuf Name: protobuf
Version: 2.4.1 Version: 2.4.1
Release: 4%{?dist} Release: 5%{?dist}
License: BSD License: BSD
Group: Development/Libraries Group: Development/Libraries
Source: http://protobuf.googlecode.com/files/%{name}-%{version}.tar.bz2 Source: http://protobuf.googlecode.com/files/%{name}-%{version}.tar.bz2
Source1: ftdetect-proto.vim Source1: ftdetect-proto.vim
Patch1: protobuf-2.3.0-fedora-gtest.patch Patch1: protobuf-2.3.0-fedora-gtest.patch
Patch2: protobuf-2.4.1-java-fixes.patch Patch2: protobuf-2.4.1-java-fixes.patch
URL: http://code.google.com/p/protobuf/ URL: http://code.google.com/p/protobuf/
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: automake autoconf libtool pkgconfig zlib-devel BuildRequires: automake autoconf libtool pkgconfig zlib-devel
@ -84,7 +84,7 @@ Requires: %{name}-devel = %{version}-%{release}
Requires: %{name}-lite = %{version}-%{release} Requires: %{name}-lite = %{version}-%{release}
%description lite-devel %description lite-devel
This package contains development libraries built with This package contains development libraries built with
optimize_for = LITE_RUNTIME. optimize_for = LITE_RUNTIME.
The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
@ -97,7 +97,7 @@ Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release} Requires: %{name}-devel = %{version}-%{release}
%description lite-static %description lite-static
This package contains static development libraries built with This package contains static development libraries built with
optimize_for = LITE_RUNTIME. optimize_for = LITE_RUNTIME.
The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
@ -132,7 +132,7 @@ Summary: Java Protocol Buffers runtime library
Group: Development/Languages Group: Development/Languages
BuildRequires: java-devel >= 1.6 BuildRequires: java-devel >= 1.6
BuildRequires: jpackage-utils BuildRequires: jpackage-utils
BuildRequires: maven2 BuildRequires: maven
BuildRequires: maven-compiler-plugin BuildRequires: maven-compiler-plugin
BuildRequires: maven-install-plugin BuildRequires: maven-install-plugin
BuildRequires: maven-jar-plugin BuildRequires: maven-jar-plugin
@ -144,8 +144,6 @@ BuildRequires: maven-doxia
BuildRequires: maven-doxia-sitetools BuildRequires: maven-doxia-sitetools
Requires: java Requires: java
Requires: jpackage-utils Requires: jpackage-utils
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
Conflicts: %{name}-compiler > %{version} Conflicts: %{name}-compiler > %{version}
Conflicts: %{name}-compiler < %{version} Conflicts: %{name}-compiler < %{version}
@ -193,9 +191,7 @@ popd
%if %{with java} %if %{with java}
pushd java pushd java
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository mvn-rpmbuild install javadoc:javadoc
mkdir -p $MAVEN_REPO_LOCAL
mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL install javadoc:javadoc
popd popd
%endif %endif
@ -225,7 +221,7 @@ cp -rp target/site/apidocs %{buildroot}%{_javadocdir}/%{name}
install -d -m 755 %{buildroot}%{_mavenpomdir} 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
%add_to_maven_depmap com.google.protobuf %{name}-java %{version} JPP %{name} %add_maven_depmap JPP-%{name}.pom %{name}.jar
%endif %endif
@ -238,14 +234,6 @@ install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%post compiler -p /sbin/ldconfig %post compiler -p /sbin/ldconfig
%postun compiler -p /sbin/ldconfig %postun compiler -p /sbin/ldconfig
%if %{with java}
%post java
%update_maven_depmap
%postun java
%update_maven_depmap
%endif
%clean %clean
rm -rf %{buildroot} rm -rf %{buildroot}
@ -294,7 +282,7 @@ rm -rf %{buildroot}
%{python_sitelib}/google/protobuf/ %{python_sitelib}/google/protobuf/
%{python_sitelib}/protobuf-%{version}-py2.?.egg-info/ %{python_sitelib}/protobuf-%{version}-py2.?.egg-info/
%{python_sitelib}/protobuf-%{version}-py2.?-nspkg.pth %{python_sitelib}/protobuf-%{version}-py2.?-nspkg.pth
%doc python/README.txt %doc python/README.txt
%doc examples/add_person.py examples/list_people.py examples/addressbook.proto %doc examples/add_person.py examples/list_people.py examples/addressbook.proto
%endif %endif
@ -306,9 +294,9 @@ rm -rf %{buildroot}
%if %{with java} %if %{with java}
%files java %files java
%defattr(-, root, root, -) %defattr(-, root, root, -)
%{_mavenpomdir}/JPP-protobuf.pom %{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/protobuf %{_mavendepmapfragdir}/%{name}
%{_javadir}/* %{_javadir}/%{name}.jar
%doc examples/AddPerson.java examples/ListPeople.java %doc examples/AddPerson.java examples/ListPeople.java
%files javadoc %files javadoc
@ -317,6 +305,9 @@ rm -rf %{buildroot}
%endif %endif
%changelog %changelog
* Mon Mar 19 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.4.1-5
- Update to latest java packaging guidelines
* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-4 * Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-4
- Rebuilt for c++ ABI breakage - Rebuilt for c++ ABI breakage