Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: spec: support fedora-19 new maven directives
......................................................................

packaging: spec: support fedora-19 new maven directives

Change-Id: Idd40e33a6950e5bf97ec2d8f78519fda468a652a
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M ovirt-host-deploy.spec.in
1 file changed, 49 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-host-deploy 
refs/changes/20/17620/1

diff --git a/ovirt-host-deploy.spec.in b/ovirt-host-deploy.spec.in
index 046c372..d2f8b2e 100644
--- a/ovirt-host-deploy.spec.in
+++ b/ovirt-host-deploy.spec.in
@@ -25,6 +25,13 @@
 %global                maven2brewrepodir 
%{_javadir}/repository.jboss.com/maven2-brew/dummy
 %endif
 
+# rhel does not support complex boolean statements
+%if 0%{?fedora:1}
+%if %{fedora} >= 19
+%global                fedora_19_maven 1
+%endif
+%endif
+
 Summary:       oVirt host deploy tool
 Name:          @PACKAGE_NAME@
 Version:       @PACKAGE_RPM_VERSION@
@@ -42,18 +49,23 @@
 BuildRequires: gettext
 BuildRequires: otopi-devel
 BuildRequires: python2-devel
-
 BuildRequires: java-devel
-BuildRequires: jpackage-utils
 
 %if 0%{?fedora:1}
-BuildRequires: maven
 BuildRequires: maven-compiler-plugin
 BuildRequires: maven-enforcer-plugin
 BuildRequires: maven-install-plugin
 BuildRequires: maven-jar-plugin
 BuildRequires: maven-javadoc-plugin
 BuildRequires: maven-source-plugin
+
+%if 0%{?fedora_19_maven:1}
+BuildRequires: maven-local
+%else
+BuildRequires: maven
+BuildRequires: jpackage-utils
+%endif
+
 %endif
 
 %description
@@ -63,7 +75,11 @@
 Summary:       %{name} java support
 Requires:      %{name} = %{version}-%{release}
 Requires:      java
+
+%if !0%{?fedora_19_maven:1}
 Requires:      jpackage-utils
+%endif
+
 Requires:      otopi-java
 %description java
 java libraries.
@@ -72,7 +88,10 @@
 %package javadoc
 Summary:       Javadocs for %{name}
 Group:         Documentation
+
+%if !0%{?fedora_19_maven:1}
 Requires:      jpackage-utils
+%endif
 
 %description javadoc
 This package contains the API documentation for %{name}.
@@ -115,7 +134,11 @@
 
 %if 0%{?fedora:1}
 cd src/java
+%if 0%{?fedora_19_maven:1}
+%mvn_build
+%else
 mvn-rpmbuild install javadoc:aggregate
+%endif
 cd ../..
 %endif
 
@@ -124,15 +147,22 @@
 make %{?_smp_mflags} install DESTDIR="%{buildroot}"
 
 %if 0%{?fedora:1}
+
+%if 0%{?fedora_19_maven:1}
+cd src/java
+%mvn_install
+cd ../..
+%else
 install -d -m 755 "%{buildroot}%{_javadir}/%{name}"
 install -d -m 755 "%{buildroot}%{_mavenpomdir}"
 install -pm 644 src/java/target/%{name}-%{package_maven_version}.jar 
%{buildroot}%{_javadir}/%{name}
 ln -s "%{name}-%{package_maven_version}.jar" 
"%{buildroot}%{_javadir}/%{name}/%{name}.jar"
 install -pm 644 "src/java/pom.xml" 
"%{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}.pom"
 %add_maven_depmap "JPP.%{name}-%{name}.pom" "%{name}/%{name}.jar"
-
 mkdir -p "%{buildroot}%{_javadocdir}/%{name}"
 cp -rp src/java/target/apidocs/*  "%{buildroot}%{_javadocdir}/%{name}"
+%endif
+
 %else
 install -d "%{buildroot}%{_javadir}/%{name}"
 install target/%{name}-%{package_maven_version}.jar 
%{buildroot}%{_javadir}/%{name}
@@ -148,14 +178,13 @@
 cp src/java/pom.xml 
"%{buildroot}%{maven2brewrepodir}/%{name}-%{package_maven_version}.pom"
 %endif
 
-%post java
 %if 0%{?fedora:1}
+%if !0%{?fedora_19_maven:1}
+%post java
+%update_maven_depmap
+%postun java
 %update_maven_depmap
 %endif
-
-%postun java
-%if 0%{?fedora:1}
-%update_maven_depmap
 %endif
 
 %files
@@ -185,6 +214,9 @@
 %{ovirt_host_deploy_root}/otopi-plugins
 #%{ovirt_host_deploy_root}/locale/*/*/*.mo
 
+%if 0%{?fedora_19_maven:1}
+%files java -f src/java/.mfiles
+%else
 %files java
 %dir %{_javadir}/%{name}
 %{_javadir}/%{name}/%{name}*.jar
@@ -192,11 +224,18 @@
 %{_mavenpomdir}/JPP.%{name}-%{name}.pom
 %{_mavendepmapfragdir}/%{name}
 %endif
+%endif
 
 %if 0%{?fedora:1}
+
+%if 0%{?fedora_19_maven:1}
+%files javadoc -f src/java/.mfiles-javadoc
+%else
 %files javadoc
 %dir %{_javadocdir}/%{name}
 %{_javadocdir}/%{name}
+%endif
+
 %endif
 
 %files offline
@@ -211,5 +250,5 @@
 * Thu Feb 14 2013 Alon Bar-Lev <[email protected]> - 1.0.0-1
 - Release.
 
-* Tue Oct 13 2012 Alon Bar-Lev <[email protected]> - 1.0.0-0.1_beta
+* Sat Oct 13 2012 Alon Bar-Lev <[email protected]> - 1.0.0-0.1_beta
 - Initial add.


-- 
To view, visit http://gerrit.ovirt.org/17620
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd40e33a6950e5bf97ec2d8f78519fda468a652a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-host-deploy
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to