diff mbox series

[ovs-dev] Add ability to override default Release suffix in RPM packages

Message ID dd3b5b6baa803e57a1844ff691d9658d19e75fe6.camel@exatel.pl
State Superseded
Headers show
Series [ovs-dev] Add ability to override default Release suffix in RPM packages | expand

Commit Message

Guzowski Adrian May 4, 2021, 6:24 a.m. UTC
In some cases, like building OvS packages in Jenkins, it may be
useful to set a custom version suffix that will correspond with
job's build number, etc. Currently, version number is explicitly
set to 1. This change adds a define "release_number" that may be
overridden during package bulding process:

rpmbuild -ba --define="release_number X" ...

Signed-off-by: Adrian Guzowski <adrian.guzowski@exatel.pl>
---
 rhel/kmod-openvswitch-rhel6.spec.in  | 3 ++-
 rhel/openvswitch-dkms.spec.in        | 4 ++--
 rhel/openvswitch-fedora.spec.in      | 4 +++-
 rhel/openvswitch-kmod-fedora.spec.in | 4 +++-
 rhel/openvswitch.spec.in             | 4 +++-
 5 files changed, 13 insertions(+), 6 deletions(-)

--
2.30.2



Spółka wpisana do rejestru przedsiębiorców w Sądzie Rejonowym dla m. st. Warszawy, XIII Wydział Gospodarczy, pod numerem KRS: 0000044577, kapitał zakładowy: 576 854 559 PLN, kapitał opłacony w całości, NIP: 527-010-45-68, BDO: 000250055, EXATEL SA, ul. Perkuna 47, 04-164 Warszawa.

Niniejsza wiadomość jest własnością EXATEL SA i może zawierać informacje poufne i/lub prawnie chronione. Jeśli nie są Państwo właściwym adresatem (lub otrzymali Państwo tę wiadomość na skutek pomyłki), prosimy o tym fakcie niezwłocznie poinformować nadawcę i usunąć otrzymaną wiadomość. Każde nieautoryzowane kopiowanie, ujawnianie lub rozpowszechnianie załączonej informacji jest zabronione.

This e-mail is a property of EXATEL SA and may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail by mistake) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Comments

Timothy Redaelli May 5, 2021, 10:33 a.m. UTC | #1
On Tue, 4 May 2021 06:24:33 +0000
Guzowski Adrian via dev <ovs-dev@openvswitch.org> wrote:

> In some cases, like building OvS packages in Jenkins, it may be
> useful to set a custom version suffix that will correspond with
> job's build number, etc. Currently, version number is explicitly
> set to 1. This change adds a define "release_number" that may be
> overridden during package bulding process:
> 
> rpmbuild -ba --define="release_number X" ...
> 
> Signed-off-by: Adrian Guzowski <adrian.guzowski@exatel.pl>
> ---
>  rhel/kmod-openvswitch-rhel6.spec.in  | 3 ++-
>  rhel/openvswitch-dkms.spec.in        | 4 ++--
>  rhel/openvswitch-fedora.spec.in      | 4 +++-
>  rhel/openvswitch-kmod-fedora.spec.in | 4 +++-
>  rhel/openvswitch.spec.in             | 4 +++-
>  5 files changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/rhel/kmod-openvswitch-rhel6.spec.in b/rhel/kmod-openvswitch-rhel6.spec.in
> index 7d3d9b498..de69863d7 100644
> --- a/rhel/kmod-openvswitch-rhel6.spec.in
> +++ b/rhel/kmod-openvswitch-rhel6.spec.in
> @@ -9,10 +9,11 @@
>  # without warranty of any kind.
> 
>  %define oname openvswitch
> +%{!?release_number:%define release_number 1}
> 
>  Name:           kmod-%{oname}
>  Version:        @VERSION@
> -Release:        1%{?dist}
> +Release:        %{release_number}%{?dist}

Hi,
%{?release_number}%{?!release_number:1}
^ this pattern is more common, instead of defining if not defined, but I
don't have a strong preference about it

I also see that "0-day Robot" reported an error since the From: field
of you email is ovs-dev@openvswitch.org instead of your email address

>  Summary:        Open vSwitch kernel module
> 
>  Group:          System/Kernel
> diff --git a/rhel/openvswitch-dkms.spec.in b/rhel/openvswitch-dkms.spec.in
> index a47c038fd..c8a978a17 100644
> --- a/rhel/openvswitch-dkms.spec.in
> +++ b/rhel/openvswitch-dkms.spec.in
> @@ -8,10 +8,11 @@
>  # without warranty of any kind.
> 
>  %define oname openvswitch
> +%{!?release_number:%define release_number 1}
> 
>  Name:             %{oname}-dkms
>  Version:          @VERSION@
> -Release:          1%{?dist}
> +Release:          %{release_number}%{?dist}
>  Summary:          Open vSwitch kernel module
> 
>  Group:            System/Kernel
> @@ -27,7 +28,6 @@ BuildRoot:        %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
>  # conflicts with the openvswitch-debuginfo package for OVS userspace).
>  %undefine _enable_debug_packages
> 
> -
>  %description
>  Open vSwitch Linux kernel module.
> 
> diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
> index e457fa679..90f242b1f 100644
> --- a/rhel/openvswitch-fedora.spec.in
> +++ b/rhel/openvswitch-fedora.spec.in
> @@ -44,6 +44,8 @@
>  %define _rundir /run
>  %endif
> 
> +%{!?release_number:%define release_number 1}
> +
>  Name: openvswitch
>  Summary: Open vSwitch
>  Group: System Environment/Daemons
> @@ -54,7 +56,7 @@ Version: @VERSION@
>  # lib/sflow*.[ch] files are SISSL
>  # datapath/ is GPLv2 (although not built into any of the binary packages)
>  License: ASL 2.0 and LGPLv2+ and SISSL
> -Release: 1%{?dist}
> +Release: %{release_number}%{?dist}
>  Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
> 
>  BuildRequires: gcc gcc-c++
> diff --git a/rhel/openvswitch-kmod-fedora.spec.in b/rhel/openvswitch-kmod-fedora.spec.in
> index ff190064f..e5f78701f 100644
> --- a/rhel/openvswitch-kmod-fedora.spec.in
> +++ b/rhel/openvswitch-kmod-fedora.spec.in
> @@ -25,6 +25,8 @@
>  #define kernel %{kernel_source}
>  %{?kversion:%define kernel %kversion}
> 
> +%{!?release_number:%define release_number 1}
> +
>  Name: openvswitch-kmod
>  Summary: Open vSwitch Kernel Modules
>  Group: System Environment/Daemons
> @@ -34,7 +36,7 @@ Version: @VERSION@
> 
>  # The entire source code is ASL 2.0 except datapath/ which is GPLv2
>  License: GPLv2
> -Release: 1%{?dist}
> +Release: %{release_number}%{?dist}
>  Source: openvswitch-%{version}.tar.gz
>  #Source1: openvswitch-init
>  Buildroot: /tmp/openvswitch-xen-rpm
> diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
> index ee8b3c9ea..220e5c747 100644
> --- a/rhel/openvswitch.spec.in
> +++ b/rhel/openvswitch.spec.in
> @@ -21,6 +21,8 @@
>  # testing out of tree kernel modules the appropriate openvswitch-kmod
>  # package should be installed first.
> 
> +%{!?release_number:%define release_number 1}
> +
>  Name: openvswitch
>  Summary: Open vSwitch daemon/database/utilities
>  Group: System Environment/Daemons
> @@ -29,7 +31,7 @@ Vendor: Nicira, Inc.
>  Version: @VERSION@
> 
>  License: ASL 2.0
> -Release: 1
> +Release: %{release_number}%{?dist}
>  Source: openvswitch-%{version}.tar.gz
>  Buildroot: /tmp/openvswitch-rpm
>  Requires: logrotate, hostname, python >= 2.7, python-six
> --
> 2.30.2
Guzowski Adrian May 5, 2021, 10:51 a.m. UTC | #2
W dniu śro, 05.05.2021 o godzinie 12∶33 +0200, użytkownik Timothy Redaelli napisał:
> On Tue, 4 May 2021 06:24:33 +0000

Spółka wpisana do rejestru przedsiębiorców w Sądzie Rejonowym dla m. st. Warszawy, XIII Wydział Gospodarczy, pod numerem KRS: 0000044577, kapitał zakładowy: 576 854 559 PLN, kapitał opłacony w całości, NIP: 527-010-45-68, BDO: 000250055, EXATEL SA, ul. Perkuna 47, 04-164 Warszawa.

Niniejsza wiadomość jest własnością EXATEL SA i może zawierać informacje poufne i/lub prawnie chronione. Jeśli nie są Państwo właściwym adresatem (lub otrzymali Państwo tę wiadomość na skutek pomyłki), prosimy o tym fakcie niezwłocznie poinformować nadawcę i usunąć otrzymaną wiadomość. Każde nieautoryzowane kopiowanie, ujawnianie lub rozpowszechnianie załączonej informacji jest zabronione.

This e-mail is a property of EXATEL SA and may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail by mistake) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
> Guzowski Adrian via dev <ovs-dev@openvswitch.org> wrote:
>
> > In some cases, like building OvS packages in Jenkins, it may be
> > useful to set a custom version suffix that will correspond with
> > job's build number, etc. Currently, version number is explicitly
> > set to 1. This change adds a define "release_number" that may be
> > overridden during package bulding process:
> >
> > rpmbuild -ba --define="release_number X" ...
> >
> > Signed-off-by: Adrian Guzowski <adrian.guzowski@exatel.pl>
> > ---
> >  rhel/kmod-openvswitch-rhel6.spec.in  | 3 ++-
> >  rhel/openvswitch-dkms.spec.in        | 4 ++--
> >  rhel/openvswitch-fedora.spec.in      | 4 +++-
> >  rhel/openvswitch-kmod-fedora.spec.in | 4 +++-
> >  rhel/openvswitch.spec.in             | 4 +++-
> >  5 files changed, 13 insertions(+), 6 deletions(-)
> >
> > diff --git a/rhel/kmod-openvswitch-rhel6.spec.in b/rhel/kmod-openvswitch-rhel6.spec.in
> > index 7d3d9b498..de69863d7 100644
> > --- a/rhel/kmod-openvswitch-rhel6.spec.in
> > +++ b/rhel/kmod-openvswitch-rhel6.spec.in
> > @@ -9,10 +9,11 @@
> >  # without warranty of any kind.
> >
> >  %define oname openvswitch
> > +%{!?release_number:%define release_number 1}
> >
> >  Name:           kmod-%{oname}
> >  Version:        @VERSION@
> > -Release:        1%{?dist}
> > +Release:        %{release_number}%{?dist}
>
> Hi,
> %{?release_number}%{?!release_number:1}
> ^ this pattern is more common, instead of defining if not defined, but I
> don't have a strong preference about it
>
I was wondering which one to use and decidec to follow the style of defining package name (one
before the added line) - just in case the value would be reused. I don't have a strong preference
for it either, can be changed accordingly if anyone objects.

> I also see that "0-day Robot" reported an error since the From: field
> of you email is ovs-dev@openvswitch.org instead of your email address
>
Actually, that's the error from the first attempt of sending a patch to OVS - turned out that our
company mail server puts From: in the form of {last-name} {first-name}, where my local git settings
were {first-name} {last-name}, so my patch came from "Guzowski Adrian", but was signed off by
"Adrian Guzowski". Once I'll get through the process of submitting the first patch (fixing shebangs
in DKMS RPM package), I'll send out remaining fixed patches.

> >  Summary:        Open vSwitch kernel module
> >
> >  Group:          System/Kernel
> > diff --git a/rhel/openvswitch-dkms.spec.in b/rhel/openvswitch-dkms.spec.in
> > index a47c038fd..c8a978a17 100644
> > --- a/rhel/openvswitch-dkms.spec.in
> > +++ b/rhel/openvswitch-dkms.spec.in
> > @@ -8,10 +8,11 @@
> >  # without warranty of any kind.
> >
> >  %define oname openvswitch
> > +%{!?release_number:%define release_number 1}
> >
> >  Name:             %{oname}-dkms
> >  Version:          @VERSION@
> > -Release:          1%{?dist}
> > +Release:          %{release_number}%{?dist}
> >  Summary:          Open vSwitch kernel module
> >
> >  Group:            System/Kernel
> > @@ -27,7 +28,6 @@ BuildRoot:        %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-
> > XXXXXX)
> >  # conflicts with the openvswitch-debuginfo package for OVS userspace).
> >  %undefine _enable_debug_packages
> >
> > -
> >  %description
> >  Open vSwitch Linux kernel module.
> >
> > diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
> > index e457fa679..90f242b1f 100644
> > --- a/rhel/openvswitch-fedora.spec.in
> > +++ b/rhel/openvswitch-fedora.spec.in
> > @@ -44,6 +44,8 @@
> >  %define _rundir /run
> >  %endif
> >
> > +%{!?release_number:%define release_number 1}
> > +
> >  Name: openvswitch
> >  Summary: Open vSwitch
> >  Group: System Environment/Daemons
> > @@ -54,7 +56,7 @@ Version: @VERSION@
> >  # lib/sflow*.[ch] files are SISSL
> >  # datapath/ is GPLv2 (although not built into any of the binary packages)
> >  License: ASL 2.0 and LGPLv2+ and SISSL
> > -Release: 1%{?dist}
> > +Release: %{release_number}%{?dist}
> >  Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz
> >
> >  BuildRequires: gcc gcc-c++
> > diff --git a/rhel/openvswitch-kmod-fedora.spec.in b/rhel/openvswitch-kmod-fedora.spec.in
> > index ff190064f..e5f78701f 100644
> > --- a/rhel/openvswitch-kmod-fedora.spec.in
> > +++ b/rhel/openvswitch-kmod-fedora.spec.in
> > @@ -25,6 +25,8 @@
> >  #define kernel %{kernel_source}
> >  %{?kversion:%define kernel %kversion}
> >
> > +%{!?release_number:%define release_number 1}
> > +
> >  Name: openvswitch-kmod
> >  Summary: Open vSwitch Kernel Modules
> >  Group: System Environment/Daemons
> > @@ -34,7 +36,7 @@ Version: @VERSION@
> >
> >  # The entire source code is ASL 2.0 except datapath/ which is GPLv2
> >  License: GPLv2
> > -Release: 1%{?dist}
> > +Release: %{release_number}%{?dist}
> >  Source: openvswitch-%{version}.tar.gz
> >  #Source1: openvswitch-init
> >  Buildroot: /tmp/openvswitch-xen-rpm
> > diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
> > index ee8b3c9ea..220e5c747 100644
> > --- a/rhel/openvswitch.spec.in
> > +++ b/rhel/openvswitch.spec.in
> > @@ -21,6 +21,8 @@
> >  # testing out of tree kernel modules the appropriate openvswitch-kmod
> >  # package should be installed first.
> >
> > +%{!?release_number:%define release_number 1}
> > +
> >  Name: openvswitch
> >  Summary: Open vSwitch daemon/database/utilities
> >  Group: System Environment/Daemons
> > @@ -29,7 +31,7 @@ Vendor: Nicira, Inc.
> >  Version: @VERSION@
> >
> >  License: ASL 2.0
> > -Release: 1
> > +Release: %{release_number}%{?dist}
> >  Source: openvswitch-%{version}.tar.gz
> >  Buildroot: /tmp/openvswitch-rpm
> >  Requires: logrotate, hostname, python >= 2.7, python-six
> > --
> > 2.30.2
>
diff mbox series

Patch

diff --git a/rhel/kmod-openvswitch-rhel6.spec.in b/rhel/kmod-openvswitch-rhel6.spec.in
index 7d3d9b498..de69863d7 100644
--- a/rhel/kmod-openvswitch-rhel6.spec.in
+++ b/rhel/kmod-openvswitch-rhel6.spec.in
@@ -9,10 +9,11 @@ 
 # without warranty of any kind.

 %define oname openvswitch
+%{!?release_number:%define release_number 1}

 Name:           kmod-%{oname}
 Version:        @VERSION@
-Release:        1%{?dist}
+Release:        %{release_number}%{?dist}
 Summary:        Open vSwitch kernel module

 Group:          System/Kernel
diff --git a/rhel/openvswitch-dkms.spec.in b/rhel/openvswitch-dkms.spec.in
index a47c038fd..c8a978a17 100644
--- a/rhel/openvswitch-dkms.spec.in
+++ b/rhel/openvswitch-dkms.spec.in
@@ -8,10 +8,11 @@ 
 # without warranty of any kind.

 %define oname openvswitch
+%{!?release_number:%define release_number 1}

 Name:             %{oname}-dkms
 Version:          @VERSION@
-Release:          1%{?dist}
+Release:          %{release_number}%{?dist}
 Summary:          Open vSwitch kernel module

 Group:            System/Kernel
@@ -27,7 +28,6 @@  BuildRoot:        %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 # conflicts with the openvswitch-debuginfo package for OVS userspace).
 %undefine _enable_debug_packages

-
 %description
 Open vSwitch Linux kernel module.

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index e457fa679..90f242b1f 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -44,6 +44,8 @@ 
 %define _rundir /run
 %endif

+%{!?release_number:%define release_number 1}
+
 Name: openvswitch
 Summary: Open vSwitch
 Group: System Environment/Daemons
@@ -54,7 +56,7 @@  Version: @VERSION@
 # lib/sflow*.[ch] files are SISSL
 # datapath/ is GPLv2 (although not built into any of the binary packages)
 License: ASL 2.0 and LGPLv2+ and SISSL
-Release: 1%{?dist}
+Release: %{release_number}%{?dist}
 Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz

 BuildRequires: gcc gcc-c++
diff --git a/rhel/openvswitch-kmod-fedora.spec.in b/rhel/openvswitch-kmod-fedora.spec.in
index ff190064f..e5f78701f 100644
--- a/rhel/openvswitch-kmod-fedora.spec.in
+++ b/rhel/openvswitch-kmod-fedora.spec.in
@@ -25,6 +25,8 @@ 
 #define kernel %{kernel_source}
 %{?kversion:%define kernel %kversion}

+%{!?release_number:%define release_number 1}
+
 Name: openvswitch-kmod
 Summary: Open vSwitch Kernel Modules
 Group: System Environment/Daemons
@@ -34,7 +36,7 @@  Version: @VERSION@

 # The entire source code is ASL 2.0 except datapath/ which is GPLv2
 License: GPLv2
-Release: 1%{?dist}
+Release: %{release_number}%{?dist}
 Source: openvswitch-%{version}.tar.gz
 #Source1: openvswitch-init
 Buildroot: /tmp/openvswitch-xen-rpm
diff --git a/rhel/openvswitch.spec.in b/rhel/openvswitch.spec.in
index ee8b3c9ea..220e5c747 100644
--- a/rhel/openvswitch.spec.in
+++ b/rhel/openvswitch.spec.in
@@ -21,6 +21,8 @@ 
 # testing out of tree kernel modules the appropriate openvswitch-kmod
 # package should be installed first.

+%{!?release_number:%define release_number 1}
+
 Name: openvswitch
 Summary: Open vSwitch daemon/database/utilities
 Group: System Environment/Daemons
@@ -29,7 +31,7 @@  Vendor: Nicira, Inc.
 Version: @VERSION@

 License: ASL 2.0
-Release: 1
+Release: %{release_number}%{?dist}
 Source: openvswitch-%{version}.tar.gz
 Buildroot: /tmp/openvswitch-rpm
 Requires: logrotate, hostname, python >= 2.7, python-six