[ovs-dev,ovn,2/2] rhel: Fix make rpm-fedora
diff mbox series

Message ID 20200214184918.904899-1-numans@ovn.org
State Accepted
Headers show
Series
  • [ovs-dev,ovn,1/2] Fix incorrect version display
Related show

Commit Message

Numan Siddique Feb. 14, 2020, 6:49 p.m. UTC
From: Numan Siddique <numans@ovn.org>

After the OVN version change to 20.03.90, make rpm-fedora is broken.
This patch fixes it. It now detects the OVS version from the configured
ovs build dir and uses it.

Signed-off-by: Numan Siddique <numans@ovn.org>
---
 Makefile.am             | 1 +
 acinclude.m4            | 3 +++
 rhel/automake.mk        | 2 +-
 rhel/ovn-fedora.spec.in | 2 +-
 4 files changed, 6 insertions(+), 2 deletions(-)

Comments

Dumitru Ceara Feb. 17, 2020, 1:03 p.m. UTC | #1
On 2/14/20 7:49 PM, numans@ovn.org wrote:
> From: Numan Siddique <numans@ovn.org>
> 
> After the OVN version change to 20.03.90, make rpm-fedora is broken.
> This patch fixes it. It now detects the OVS version from the configured
> ovs build dir and uses it.
> 
> Signed-off-by: Numan Siddique <numans@ovn.org>

Acked-by: Dumitru Ceara <dceara@redhat.com>

Thanks,
Dumitru

> ---
>  Makefile.am             | 1 +
>  acinclude.m4            | 3 +++
>  rhel/automake.mk        | 2 +-
>  rhel/ovn-fedora.spec.in | 2 +-
>  4 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 490a27608..af3fa1ed3 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -179,6 +179,7 @@ SUFFIXES += .in
>  	    -e 's,[@]OVN_RUNDIR[@],$(OVN_RUNDIR),g' \
>  	    -e 's,[@]OVSBUILDDIR[@],$(OVSBUILDDIR),g' \
>  	    -e 's,[@]VERSION[@],$(VERSION),g' \
> +	    -e 's,[@]OVSVERSION[@],$(OVSVERSION),g' \
>  	    -e 's,[@]localstatedir[@],$(localstatedir),g' \
>  	    -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
>  	    -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
> diff --git a/acinclude.m4 b/acinclude.m4
> index 414deccab..a797adc82 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -362,4 +362,7 @@ AC_DEFUN([OVN_CHECK_OVS], [
>    fi
>    AC_MSG_RESULT([$OVSBUILDDIR])
>    AC_SUBST(OVSBUILDDIR)
> +  OVSVERSION=`sed -n 's/^#define PACKAGE_VERSION//p' $OVSBUILDDIR/config.h | tr \\\n ' ' | sed 's/^[ \t]*//;s/[ \t]*$//' | sed 's/\"//g'`
> +  AC_SUBST(OVSVERSION)
> +  AC_MSG_RESULT([OVS version is $OVSVERSION])
>  ])
> diff --git a/rhel/automake.mk b/rhel/automake.mk
> index a46e6579b..661975ea9 100644
> --- a/rhel/automake.mk
> +++ b/rhel/automake.mk
> @@ -29,7 +29,7 @@ RPMBUILD_OPT ?= --without check
>  rpm-fedora: dist $(srcdir)/rhel/ovn-fedora.spec
>  	${MKDIR_P} ${RPMBUILD_TOP}/SOURCES
>  	cp ${DIST_ARCHIVES} ${RPMBUILD_TOP}/SOURCES
> -	cp $(ovs_builddir)/openvswitch-$(VERSION).tar.gz ${RPMBUILD_TOP}/SOURCES
> +	cp $(ovs_builddir)/openvswitch-$(OVSVERSION).tar.gz ${RPMBUILD_TOP}/SOURCES
>  	rpmbuild ${RPMBUILD_OPT} \
>                   -D "_topdir ${RPMBUILD_TOP}" \
>                   -ba $(srcdir)/rhel/ovn-fedora.spec
> diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
> index 59d05673c..6a59ccc40 100644
> --- a/rhel/ovn-fedora.spec.in
> +++ b/rhel/ovn-fedora.spec.in
> @@ -33,7 +33,7 @@ Version: @VERSION@
>  Obsoletes: openvswitch-ovn-common < %{?epoch:%{epoch}:}%{version}-%{release}
>  Provides: openvswitch-ovn-common = %{?epoch:%{epoch}:}%{version}-%{release}
>  
> -%define ovsver %{version}
> +%define ovsver @OVSVERSION@
>  %define ovsdir openvswitch-%{ovsver}
>  
>  # Nearly all of openvswitch is ASL 2.0.  The bugtool is LGPLv2+, and the
>

Patch
diff mbox series

diff --git a/Makefile.am b/Makefile.am
index 490a27608..af3fa1ed3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -179,6 +179,7 @@  SUFFIXES += .in
 	    -e 's,[@]OVN_RUNDIR[@],$(OVN_RUNDIR),g' \
 	    -e 's,[@]OVSBUILDDIR[@],$(OVSBUILDDIR),g' \
 	    -e 's,[@]VERSION[@],$(VERSION),g' \
+	    -e 's,[@]OVSVERSION[@],$(OVSVERSION),g' \
 	    -e 's,[@]localstatedir[@],$(localstatedir),g' \
 	    -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
 	    -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
diff --git a/acinclude.m4 b/acinclude.m4
index 414deccab..a797adc82 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -362,4 +362,7 @@  AC_DEFUN([OVN_CHECK_OVS], [
   fi
   AC_MSG_RESULT([$OVSBUILDDIR])
   AC_SUBST(OVSBUILDDIR)
+  OVSVERSION=`sed -n 's/^#define PACKAGE_VERSION//p' $OVSBUILDDIR/config.h | tr \\\n ' ' | sed 's/^[ \t]*//;s/[ \t]*$//' | sed 's/\"//g'`
+  AC_SUBST(OVSVERSION)
+  AC_MSG_RESULT([OVS version is $OVSVERSION])
 ])
diff --git a/rhel/automake.mk b/rhel/automake.mk
index a46e6579b..661975ea9 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -29,7 +29,7 @@  RPMBUILD_OPT ?= --without check
 rpm-fedora: dist $(srcdir)/rhel/ovn-fedora.spec
 	${MKDIR_P} ${RPMBUILD_TOP}/SOURCES
 	cp ${DIST_ARCHIVES} ${RPMBUILD_TOP}/SOURCES
-	cp $(ovs_builddir)/openvswitch-$(VERSION).tar.gz ${RPMBUILD_TOP}/SOURCES
+	cp $(ovs_builddir)/openvswitch-$(OVSVERSION).tar.gz ${RPMBUILD_TOP}/SOURCES
 	rpmbuild ${RPMBUILD_OPT} \
                  -D "_topdir ${RPMBUILD_TOP}" \
                  -ba $(srcdir)/rhel/ovn-fedora.spec
diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
index 59d05673c..6a59ccc40 100644
--- a/rhel/ovn-fedora.spec.in
+++ b/rhel/ovn-fedora.spec.in
@@ -33,7 +33,7 @@  Version: @VERSION@
 Obsoletes: openvswitch-ovn-common < %{?epoch:%{epoch}:}%{version}-%{release}
 Provides: openvswitch-ovn-common = %{?epoch:%{epoch}:}%{version}-%{release}
 
-%define ovsver %{version}
+%define ovsver @OVSVERSION@
 %define ovsdir openvswitch-%{ovsver}
 
 # Nearly all of openvswitch is ASL 2.0.  The bugtool is LGPLv2+, and the