diff mbox

[ovs-dev,1/3] Fedora: update rpm build instructions after trying them with Fedora 22

Message ID 1443997210-9377-1-git-send-email-aatteka@nicira.com
State Changes Requested
Headers show

Commit Message

Ansis Atteka Oct. 4, 2015, 10:20 p.m. UTC
Mention:
1. that these instructions have been tested with Fedora 22.
2. dependencies that need to be installed on Fedora 22.  Otherwise,
   rpmbuild command simply fails.
3. that rpmdev-setuptree utility can be used to create rpmbuild
   directory under $HOME, if one doesn't exist already.
4. directory where rpm packages that were just built can be found.
5. mention SElinux implications that could prevent OVS from starting,
   if not using designated OVS directories.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
---
 INSTALL.Fedora.md | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)

Comments

Kyle Mestery Oct. 5, 2015, 1:19 a.m. UTC | #1
On Sun, Oct 4, 2015 at 5:20 PM, Ansis Atteka <aatteka@nicira.com> wrote:

> Mention:
> 1. that these instructions have been tested with Fedora 22.
> 2. dependencies that need to be installed on Fedora 22.  Otherwise,
>    rpmbuild command simply fails.
> 3. that rpmdev-setuptree utility can be used to create rpmbuild
>    directory under $HOME, if one doesn't exist already.
> 4. directory where rpm packages that were just built can be found.
> 5. mention SElinux implications that could prevent OVS from starting,
>    if not using designated OVS directories.
>
> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
> ---
>  INSTALL.Fedora.md | 33 +++++++++++++++++++++++++++------
>  1 file changed, 27 insertions(+), 6 deletions(-)
>
> diff --git a/INSTALL.Fedora.md b/INSTALL.Fedora.md
> index 75b6375..02d99be 100644
> --- a/INSTALL.Fedora.md
> +++ b/INSTALL.Fedora.md
> @@ -5,7 +5,7 @@ This document describes how to build and install Open
> vSwitch on a Fedora
>  Linux host.  If you want to install Open vSwitch on a generic Linux host,
>  see [INSTALL.md] instead.
>
> -We have tested these instructions with Fedora 16 and Fedora 17.
> +We have tested these instructions with Fedora 16, Fedora 17 and Fedora 22.
>
> Is the RPM build still tested for Fedora 16 and 17 at this point? Is that
automated? If not, maybe those can be removed.

 Building Open vSwitch for Fedora
>  --------------------------------
> @@ -21,6 +21,9 @@ the top-level:
>  4. SPECS/ Contains the spec files for each package to be built.
>  5. SRPMS/ Where the newly created source package files are written.
>
> +If these directories do not exist on your system by default (as in Fedora
> 22),
> +then use rpmdev-setuptree utility to create them.
> +
>  Before you begin, note the RPM sources directory on your version of
>  Fedora.  The command "rpmbuild --showrc" will show the configuration
>  for each of those directories. Alternatively, the command "rpm --eval
> @@ -30,7 +33,16 @@ for the sources directory.  On Fedora 17, the default
> RPM _topdir is
>  $HOME/rpmbuild and the default RPM sources directory is
>  $HOME/rpmbuild/SOURCES.
>
> -1. If you are building from a distribution tarball, skip to step 2.
> +1. Install build prerequisites with dnf (or yum on older Fedora versions):
> +
> +   ```
> +   dnf install gcc make python-devel openssl-devel kernel-devel graphviz \
> +       kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
> +       libtool pyqt4 groff libcap-ng-devel python-twisted-core \
> +       python-zope-interface
> +   ```
> +
> +2. If you are building from a distribution tarball, skip to step 2.
>     Otherwise, you must be building from an Open vSwitch Git tree.
>     Create a distribution tarball from the root of the Git tree by
>     running:
> @@ -41,21 +53,22 @@ $HOME/rpmbuild/SOURCES.
>         make dist
>            ```
>
> -2. Now you have a distribution tarball, named something like
> +3. Now you have a distribution tarball, named something like
>     openvswitch-x.y.z.tar.gz.  Copy this file into the RPM sources
>     directory, e.g.:
>
>         `cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES`
>
> -3. Make another copy of the distribution tarball in a temporary
> +4. Make another copy of the distribution tarball in a temporary
>     directory.  Then unpack the tarball and "cd" into its root, e.g.:
>
>         ```
> +       cd $HOME/rpmbuild/SOURCES
>         tar xzf openvswitch-x.y.z.tar.gz
>         cd openvswitch-x.y.z
>            ```
>
> -4. To build Open vSwitch userspace, run:
> +5. To build Open vSwitch userspace, run:
>
>         `rpmbuild -bb rhel/openvswitch-fedora.spec`
>
> @@ -66,7 +79,7 @@ $HOME/rpmbuild/SOURCES.
>
>         `rpmbuild -bb --without check rhel/openvswitch-fedora.spec`
>
> -5. On Fedora 17, to build the Open vSwitch kernel module, run:
> +6. On Fedora 17, to build the Open vSwitch kernel module, run:
>
>         `rpmbuild -bb rhel/openvswitch-kmod-fedora.spec`
>
> @@ -83,6 +96,14 @@ $HOME/rpmbuild/SOURCES.
>      in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and
>      "kmod-openvswitch-kdump".
>
> +7. Find the created packages in $HOME/rpmbuild/RPMS directory.
> +
> +Fedora based distributions nowadays ship with SElinux enabled in
> enforcing mode
> +by default.  This means that, if you have problems starting Open vSwitch,
> then
> +first check that Open vSwitch is configured to run inside its SElinux
> confined
> +area.  For more details see "man (8) openvswitch_selinux" that is
> distributed
> +with selinux-policy-devel package on your distribution.
> +
>  Reporting Bugs
>  --------------
>
> --
> 2.1.4
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
Ansis Atteka Oct. 5, 2015, 10:36 p.m. UTC | #2
On Sun, Oct 4, 2015 at 6:19 PM, Kyle Mestery <mestery@mestery.com> wrote:
> On Sun, Oct 4, 2015 at 5:20 PM, Ansis Atteka <aatteka@nicira.com> wrote:
>>
>> Mention:
>> 1. that these instructions have been tested with Fedora 22.
>> 2. dependencies that need to be installed on Fedora 22.  Otherwise,
>>    rpmbuild command simply fails.
>> 3. that rpmdev-setuptree utility can be used to create rpmbuild
>>    directory under $HOME, if one doesn't exist already.
>> 4. directory where rpm packages that were just built can be found.
>> 5. mention SElinux implications that could prevent OVS from starting,
>>    if not using designated OVS directories.
>>
>> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
>> ---
>>  INSTALL.Fedora.md | 33 +++++++++++++++++++++++++++------
>>  1 file changed, 27 insertions(+), 6 deletions(-)
>>
>> diff --git a/INSTALL.Fedora.md b/INSTALL.Fedora.md
>> index 75b6375..02d99be 100644
>> --- a/INSTALL.Fedora.md
>> +++ b/INSTALL.Fedora.md
>> @@ -5,7 +5,7 @@ This document describes how to build and install Open
>> vSwitch on a Fedora
>>  Linux host.  If you want to install Open vSwitch on a generic Linux host,
>>  see [INSTALL.md] instead.
>>
>> -We have tested these instructions with Fedora 16 and Fedora 17.
>> +We have tested these instructions with Fedora 16, Fedora 17 and Fedora
>> 22.
>>
> Is the RPM build still tested for Fedora 16 and 17 at this point? Is that
> automated? If not, maybe those can be removed.

Thanks for the review! Indeed, according to
[https://en.wikipedia.org/wiki/Fedora_(operating_system)] Fedora 20
and older are marked as "old" which, I guess, implies that no one is
supporting them anymore and I don't see a reason why latest OVS should
claim to support old Fedora versions too. Will remove the claimed
support for older Fedora versions as you suggested.


>
>>  Building Open vSwitch for Fedora
>>  --------------------------------
>> @@ -21,6 +21,9 @@ the top-level:
>>  4. SPECS/ Contains the spec files for each package to be built.
>>  5. SRPMS/ Where the newly created source package files are written.
>>
>> +If these directories do not exist on your system by default (as in Fedora
>> 22),
>> +then use rpmdev-setuptree utility to create them.
>> +
>>  Before you begin, note the RPM sources directory on your version of
>>  Fedora.  The command "rpmbuild --showrc" will show the configuration
>>  for each of those directories. Alternatively, the command "rpm --eval
>> @@ -30,7 +33,16 @@ for the sources directory.  On Fedora 17, the default
>> RPM _topdir is
>>  $HOME/rpmbuild and the default RPM sources directory is
>>  $HOME/rpmbuild/SOURCES.
>>
>> -1. If you are building from a distribution tarball, skip to step 2.
>> +1. Install build prerequisites with dnf (or yum on older Fedora
>> versions):
>> +
>> +   ```
>> +   dnf install gcc make python-devel openssl-devel kernel-devel graphviz
>> \
>> +       kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
>> +       libtool pyqt4 groff libcap-ng-devel python-twisted-core \
>> +       python-zope-interface
>> +   ```
>> +
>> +2. If you are building from a distribution tarball, skip to step 2.
>>     Otherwise, you must be building from an Open vSwitch Git tree.
>>     Create a distribution tarball from the root of the Git tree by
>>     running:
>> @@ -41,21 +53,22 @@ $HOME/rpmbuild/SOURCES.
>>         make dist
>>            ```
>>
>> -2. Now you have a distribution tarball, named something like
>> +3. Now you have a distribution tarball, named something like
>>     openvswitch-x.y.z.tar.gz.  Copy this file into the RPM sources
>>     directory, e.g.:
>>
>>         `cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES`
>>
>> -3. Make another copy of the distribution tarball in a temporary
>> +4. Make another copy of the distribution tarball in a temporary
>>     directory.  Then unpack the tarball and "cd" into its root, e.g.:
>>
>>         ```
>> +       cd $HOME/rpmbuild/SOURCES
>>         tar xzf openvswitch-x.y.z.tar.gz
>>         cd openvswitch-x.y.z
>>            ```
>>
>> -4. To build Open vSwitch userspace, run:
>> +5. To build Open vSwitch userspace, run:
>>
>>         `rpmbuild -bb rhel/openvswitch-fedora.spec`
>>
>> @@ -66,7 +79,7 @@ $HOME/rpmbuild/SOURCES.
>>
>>         `rpmbuild -bb --without check rhel/openvswitch-fedora.spec`
>>
>> -5. On Fedora 17, to build the Open vSwitch kernel module, run:
>> +6. On Fedora 17, to build the Open vSwitch kernel module, run:
>>
>>         `rpmbuild -bb rhel/openvswitch-kmod-fedora.spec`
>>
>> @@ -83,6 +96,14 @@ $HOME/rpmbuild/SOURCES.
>>      in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and
>>      "kmod-openvswitch-kdump".
>>
>> +7. Find the created packages in $HOME/rpmbuild/RPMS directory.
>> +
>> +Fedora based distributions nowadays ship with SElinux enabled in
>> enforcing mode
>> +by default.  This means that, if you have problems starting Open vSwitch,
>> then
>> +first check that Open vSwitch is configured to run inside its SElinux
>> confined
>> +area.  For more details see "man (8) openvswitch_selinux" that is
>> distributed
>> +with selinux-policy-devel package on your distribution.
>> +
>>  Reporting Bugs
>>  --------------
>>
>> --
>> 2.1.4
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> http://openvswitch.org/mailman/listinfo/dev
>
>
Flavio Leitner Oct. 6, 2015, 7:20 p.m. UTC | #3
On Sun, Oct 04, 2015 at 03:20:08PM -0700, Ansis Atteka wrote:
> Mention:
> 1. that these instructions have been tested with Fedora 22.
> 2. dependencies that need to be installed on Fedora 22.  Otherwise,
>    rpmbuild command simply fails.
> 3. that rpmdev-setuptree utility can be used to create rpmbuild
>    directory under $HOME, if one doesn't exist already.
> 4. directory where rpm packages that were just built can be found.
> 5. mention SElinux implications that could prevent OVS from starting,
>    if not using designated OVS directories.
> 
> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
> ---
>  INSTALL.Fedora.md | 33 +++++++++++++++++++++++++++------
>  1 file changed, 27 insertions(+), 6 deletions(-)
> 
> diff --git a/INSTALL.Fedora.md b/INSTALL.Fedora.md
> index 75b6375..02d99be 100644
> --- a/INSTALL.Fedora.md
> +++ b/INSTALL.Fedora.md
> @@ -5,7 +5,7 @@ This document describes how to build and install Open vSwitch on a Fedora
>  Linux host.  If you want to install Open vSwitch on a generic Linux host,
>  see [INSTALL.md] instead.
>  
> -We have tested these instructions with Fedora 16 and Fedora 17.
> +We have tested these instructions with Fedora 16, Fedora 17 and Fedora 22.

I am maintaining OVS on F21, F22, F23 and F24.  I don't know the
current state of F16 and F17 though the RPM instructions should be
the same.


>  Building Open vSwitch for Fedora
>  --------------------------------
> @@ -21,6 +21,9 @@ the top-level:
>  4. SPECS/ Contains the spec files for each package to be built.
>  5. SRPMS/ Where the newly created source package files are written.
>  
> +If these directories do not exist on your system by default (as in Fedora 22),
> +then use rpmdev-setuptree utility to create them.
> +
>  Before you begin, note the RPM sources directory on your version of
>  Fedora.  The command "rpmbuild --showrc" will show the configuration
>  for each of those directories. Alternatively, the command "rpm --eval
> @@ -30,7 +33,16 @@ for the sources directory.  On Fedora 17, the default RPM _topdir is
>  $HOME/rpmbuild and the default RPM sources directory is
>  $HOME/rpmbuild/SOURCES.
>  
> -1. If you are building from a distribution tarball, skip to step 2.
> +1. Install build prerequisites with dnf (or yum on older Fedora versions):
> +
> +   ```
> +   dnf install gcc make python-devel openssl-devel kernel-devel graphviz \
> +       kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
> +       libtool pyqt4 groff libcap-ng-devel python-twisted-core \
> +       python-zope-interface
> +   ```
> +

I am not sure if that list is complete.  I use yum-builddep <spec>
to install all the build requisites.  The nice thing about it is that
when libcap-ng-devel deps was added, the documentation would remain
updated.

For dnf I think it's dnf builddep --spec <spec>


> +2. If you are building from a distribution tarball, skip to step 2.
>     Otherwise, you must be building from an Open vSwitch Git tree.
>     Create a distribution tarball from the root of the Git tree by
>     running:
> @@ -41,21 +53,22 @@ $HOME/rpmbuild/SOURCES.
>         make dist
>  	   ```
>  
> -2. Now you have a distribution tarball, named something like
> +3. Now you have a distribution tarball, named something like
>     openvswitch-x.y.z.tar.gz.  Copy this file into the RPM sources
>     directory, e.g.:
>  
>         `cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES`
>  
> -3. Make another copy of the distribution tarball in a temporary
> +4. Make another copy of the distribution tarball in a temporary
>     directory.  Then unpack the tarball and "cd" into its root, e.g.:
>  
>         ```
> +       cd $HOME/rpmbuild/SOURCES

You need to change the text above because it says to make a copy
somewhere else, and here you are using SOURCES/

>         tar xzf openvswitch-x.y.z.tar.gz
>         cd openvswitch-x.y.z
>  	   ```
>  
> -4. To build Open vSwitch userspace, run:
> +5. To build Open vSwitch userspace, run:
>  
>         `rpmbuild -bb rhel/openvswitch-fedora.spec`
>  
> @@ -66,7 +79,7 @@ $HOME/rpmbuild/SOURCES.
>  
>         `rpmbuild -bb --without check rhel/openvswitch-fedora.spec`
>  
> -5. On Fedora 17, to build the Open vSwitch kernel module, run:
> +6. On Fedora 17, to build the Open vSwitch kernel module, run:
>  
>  	`rpmbuild -bb rhel/openvswitch-kmod-fedora.spec`
>  
> @@ -83,6 +96,14 @@ $HOME/rpmbuild/SOURCES.
>      in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and
>      "kmod-openvswitch-kdump".
>  
> +7. Find the created packages in $HOME/rpmbuild/RPMS directory.
> +
> +Fedora based distributions nowadays ship with SElinux enabled in enforcing mode
> +by default.  This means that, if you have problems starting Open vSwitch, then
> +first check that Open vSwitch is configured to run inside its SElinux confined
> +area.  For more details see "man (8) openvswitch_selinux" that is distributed
> +with selinux-policy-devel package on your distribution.
> +

makes sense.
fbl


>  Reporting Bugs
>  --------------
>  
> -- 
> 2.1.4
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
Russell Bryant Oct. 6, 2015, 10:22 p.m. UTC | #4
On 10/06/2015 08:20 PM, Flavio Leitner wrote:
> On Sun, Oct 04, 2015 at 03:20:08PM -0700, Ansis Atteka wrote:
>> Mention:
>> 1. that these instructions have been tested with Fedora 22.
>> 2. dependencies that need to be installed on Fedora 22.  Otherwise,
>>    rpmbuild command simply fails.
>> 3. that rpmdev-setuptree utility can be used to create rpmbuild
>>    directory under $HOME, if one doesn't exist already.
>> 4. directory where rpm packages that were just built can be found.
>> 5. mention SElinux implications that could prevent OVS from starting,
>>    if not using designated OVS directories.
>>
>> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
>> ---
>>  INSTALL.Fedora.md | 33 +++++++++++++++++++++++++++------
>>  1 file changed, 27 insertions(+), 6 deletions(-)
>>
>> diff --git a/INSTALL.Fedora.md b/INSTALL.Fedora.md
>> index 75b6375..02d99be 100644
>> --- a/INSTALL.Fedora.md
>> +++ b/INSTALL.Fedora.md
>> @@ -5,7 +5,7 @@ This document describes how to build and install Open vSwitch on a Fedora
>>  Linux host.  If you want to install Open vSwitch on a generic Linux host,
>>  see [INSTALL.md] instead.
>>  
>> -We have tested these instructions with Fedora 16 and Fedora 17.
>> +We have tested these instructions with Fedora 16, Fedora 17 and Fedora 22.
> 
> I am maintaining OVS on F21, F22, F23 and F24.  I don't know the
> current state of F16 and F17 though the RPM instructions should be
> the same.
> 
> 
>>  Building Open vSwitch for Fedora
>>  --------------------------------
>> @@ -21,6 +21,9 @@ the top-level:
>>  4. SPECS/ Contains the spec files for each package to be built.
>>  5. SRPMS/ Where the newly created source package files are written.
>>  
>> +If these directories do not exist on your system by default (as in Fedora 22),
>> +then use rpmdev-setuptree utility to create them.
>> +
>>  Before you begin, note the RPM sources directory on your version of
>>  Fedora.  The command "rpmbuild --showrc" will show the configuration
>>  for each of those directories. Alternatively, the command "rpm --eval
>> @@ -30,7 +33,16 @@ for the sources directory.  On Fedora 17, the default RPM _topdir is
>>  $HOME/rpmbuild and the default RPM sources directory is
>>  $HOME/rpmbuild/SOURCES.
>>  
>> -1. If you are building from a distribution tarball, skip to step 2.
>> +1. Install build prerequisites with dnf (or yum on older Fedora versions):
>> +
>> +   ```
>> +   dnf install gcc make python-devel openssl-devel kernel-devel graphviz \
>> +       kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
>> +       libtool pyqt4 groff libcap-ng-devel python-twisted-core \
>> +       python-zope-interface
>> +   ```
>> +
> 
> I am not sure if that list is complete.  I use yum-builddep <spec>
> to install all the build requisites.  The nice thing about it is that
> when libcap-ng-devel deps was added, the documentation would remain
> updated.
> 
> For dnf I think it's dnf builddep --spec <spec>

Another approach would be to change the instructions to build the
package using mock.  That's actually what I'd prefer, I just hadn't
gotten around to documenting it and proposing it properly.
Ansis Atteka Oct. 8, 2015, 7:11 p.m. UTC | #5
On Tue, Oct 6, 2015 at 3:22 PM, Russell Bryant <rbryant@redhat.com> wrote:
> On 10/06/2015 08:20 PM, Flavio Leitner wrote:
>> On Sun, Oct 04, 2015 at 03:20:08PM -0700, Ansis Atteka wrote:
>>> Mention:
>>> 1. that these instructions have been tested with Fedora 22.
>>> 2. dependencies that need to be installed on Fedora 22.  Otherwise,
>>>    rpmbuild command simply fails.
>>> 3. that rpmdev-setuptree utility can be used to create rpmbuild
>>>    directory under $HOME, if one doesn't exist already.
>>> 4. directory where rpm packages that were just built can be found.
>>> 5. mention SElinux implications that could prevent OVS from starting,
>>>    if not using designated OVS directories.
>>>
>>> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
>>> ---
>>>  INSTALL.Fedora.md | 33 +++++++++++++++++++++++++++------
>>>  1 file changed, 27 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/INSTALL.Fedora.md b/INSTALL.Fedora.md
>>> index 75b6375..02d99be 100644
>>> --- a/INSTALL.Fedora.md
>>> +++ b/INSTALL.Fedora.md
>>> @@ -5,7 +5,7 @@ This document describes how to build and install Open vSwitch on a Fedora
>>>  Linux host.  If you want to install Open vSwitch on a generic Linux host,
>>>  see [INSTALL.md] instead.
>>>
>>> -We have tested these instructions with Fedora 16 and Fedora 17.
>>> +We have tested these instructions with Fedora 16, Fedora 17 and Fedora 22.
>>
>> I am maintaining OVS on F21, F22, F23 and F24.  I don't know the
>> current state of F16 and F17 though the RPM instructions should be
>> the same.

How about: "These instructions are tested with Fedora 21-24. However,
they could also still work with other Fedora versions."?

Another approach would be not to give exact Fedora versions and simply
state that OVS supports Fedora versions that are still being actively
maintained by Fedora Project. And then if these instructions don't
work on one of those Fedoras then we would consider that as a bug.



>>
>>
>>>  Building Open vSwitch for Fedora
>>>  --------------------------------
>>> @@ -21,6 +21,9 @@ the top-level:
>>>  4. SPECS/ Contains the spec files for each package to be built.
>>>  5. SRPMS/ Where the newly created source package files are written.
>>>
>>> +If these directories do not exist on your system by default (as in Fedora 22),
>>> +then use rpmdev-setuptree utility to create them.
>>> +
>>>  Before you begin, note the RPM sources directory on your version of
>>>  Fedora.  The command "rpmbuild --showrc" will show the configuration
>>>  for each of those directories. Alternatively, the command "rpm --eval
>>> @@ -30,7 +33,16 @@ for the sources directory.  On Fedora 17, the default RPM _topdir is
>>>  $HOME/rpmbuild and the default RPM sources directory is
>>>  $HOME/rpmbuild/SOURCES.
>>>
>>> -1. If you are building from a distribution tarball, skip to step 2.
>>> +1. Install build prerequisites with dnf (or yum on older Fedora versions):
>>> +
>>> +   ```
>>> +   dnf install gcc make python-devel openssl-devel kernel-devel graphviz \
>>> +       kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
>>> +       libtool pyqt4 groff libcap-ng-devel python-twisted-core \
>>> +       python-zope-interface
>>> +   ```
>>> +
>>
>> I am not sure if that list is complete.  I use yum-builddep <spec>
>> to install all the build requisites.  The nice thing about it is that
>> when libcap-ng-devel deps was added, the documentation would remain
>> updated.
>>
>> For dnf I think it's dnf builddep --spec <spec>

Neither yum-builddep nor dnf-builddep seem to accept --spec argument:

# dnf builddep --spec rhel/openvswitch-fedora.spec
usage: dnf builddep [--help-cmd] [-D 'MACRO EXPR'] [package [package ...]]

I guess you might have meant:

# dnf builddep rhel/openvswitch-fedora.spec




>
> Another approach would be to change the instructions to build the
> package using mock.  That's actually what I'd prefer, I just hadn't
> gotten around to documenting it and proposing it properly.

Russell, can you provide me sample mock commands that you use? Mock
seems to have plenty of plugins and I did not have a chance to go
through all of them yet.

I think there are two approaches here regarding to mock:
1. replace these rpmbuild commands with mock (if it is easy to set up mock); or
2. document Mock alongside these rpmbuild commands (in the same or
another INSTALL document).
Flavio Leitner Oct. 8, 2015, 7:38 p.m. UTC | #6
On Thu, Oct 08, 2015 at 12:11:22PM -0700, Ansis Atteka wrote:
> On Tue, Oct 6, 2015 at 3:22 PM, Russell Bryant <rbryant@redhat.com> wrote:
> > On 10/06/2015 08:20 PM, Flavio Leitner wrote:
> >> On Sun, Oct 04, 2015 at 03:20:08PM -0700, Ansis Atteka wrote:
> >>> Mention:
> >>> 1. that these instructions have been tested with Fedora 22.
> >>> 2. dependencies that need to be installed on Fedora 22.  Otherwise,
> >>>    rpmbuild command simply fails.
> >>> 3. that rpmdev-setuptree utility can be used to create rpmbuild
> >>>    directory under $HOME, if one doesn't exist already.
> >>> 4. directory where rpm packages that were just built can be found.
> >>> 5. mention SElinux implications that could prevent OVS from starting,
> >>>    if not using designated OVS directories.
> >>>
> >>> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
> >>> ---
> >>>  INSTALL.Fedora.md | 33 +++++++++++++++++++++++++++------
> >>>  1 file changed, 27 insertions(+), 6 deletions(-)
> >>>
> >>> diff --git a/INSTALL.Fedora.md b/INSTALL.Fedora.md
> >>> index 75b6375..02d99be 100644
> >>> --- a/INSTALL.Fedora.md
> >>> +++ b/INSTALL.Fedora.md
> >>> @@ -5,7 +5,7 @@ This document describes how to build and install Open vSwitch on a Fedora
> >>>  Linux host.  If you want to install Open vSwitch on a generic Linux host,
> >>>  see [INSTALL.md] instead.
> >>>
> >>> -We have tested these instructions with Fedora 16 and Fedora 17.
> >>> +We have tested these instructions with Fedora 16, Fedora 17 and Fedora 22.
> >>
> >> I am maintaining OVS on F21, F22, F23 and F24.  I don't know the
> >> current state of F16 and F17 though the RPM instructions should be
> >> the same.
> 
> How about: "These instructions are tested with Fedora 21-24. However,
> they could also still work with other Fedora versions."?
> 
> Another approach would be not to give exact Fedora versions and simply
> state that OVS supports Fedora versions that are still being actively
> maintained by Fedora Project. And then if these instructions don't
> work on one of those Fedoras then we would consider that as a bug.

Sounds good to me.


> >>>  Building Open vSwitch for Fedora
> >>>  --------------------------------
> >>> @@ -21,6 +21,9 @@ the top-level:
> >>>  4. SPECS/ Contains the spec files for each package to be built.
> >>>  5. SRPMS/ Where the newly created source package files are written.
> >>>
> >>> +If these directories do not exist on your system by default (as in Fedora 22),
> >>> +then use rpmdev-setuptree utility to create them.
> >>> +
> >>>  Before you begin, note the RPM sources directory on your version of
> >>>  Fedora.  The command "rpmbuild --showrc" will show the configuration
> >>>  for each of those directories. Alternatively, the command "rpm --eval
> >>> @@ -30,7 +33,16 @@ for the sources directory.  On Fedora 17, the default RPM _topdir is
> >>>  $HOME/rpmbuild and the default RPM sources directory is
> >>>  $HOME/rpmbuild/SOURCES.
> >>>
> >>> -1. If you are building from a distribution tarball, skip to step 2.
> >>> +1. Install build prerequisites with dnf (or yum on older Fedora versions):
> >>> +
> >>> +   ```
> >>> +   dnf install gcc make python-devel openssl-devel kernel-devel graphviz \
> >>> +       kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
> >>> +       libtool pyqt4 groff libcap-ng-devel python-twisted-core \
> >>> +       python-zope-interface
> >>> +   ```
> >>> +
> >>
> >> I am not sure if that list is complete.  I use yum-builddep <spec>
> >> to install all the build requisites.  The nice thing about it is that
> >> when libcap-ng-devel deps was added, the documentation would remain
> >> updated.
> >>
> >> For dnf I think it's dnf builddep --spec <spec>
> 
> Neither yum-builddep nor dnf-builddep seem to accept --spec argument:
> 
> # dnf builddep --spec rhel/openvswitch-fedora.spec
> usage: dnf builddep [--help-cmd] [-D 'MACRO EXPR'] [package [package ...]]
> 
> I guess you might have meant:
> 
> # dnf builddep rhel/openvswitch-fedora.spec

$ dnf builddep
usage: dnf builddep [--help-cmd] [-D 'MACRO EXPR'] [--spec | --srpm]
                    package [package ...]

positional arguments:
  package               packages with builddeps to install

optional arguments:
  --help-cmd            show this help about this tool
  -D 'MACRO EXPR', --define 'MACRO EXPR'
                        define a macro for spec file parsing
  --spec                treat commandline arguments as spec files
  --srpm                treat commandline arguments as source rpm

$ sudo dnf builddep --spec rhel/openvswitch-fedora.spec
Last metadata expiration check performed 2:30:42 ago on Thu Oct  8 13:53:57 2015.
Package PyQt4-4.11.4-1.fc22.x86_64 is already installed, skipping.
Package autoconf-2.69-20.fc22.noarch is already installed, skipping.
...

$ rpm -q dnf
dnf-1.1.1-2.fc22.noarch



and:
master]$ sudo yum-builddep rhel/openvswitch-fedora.spec

Yum-utils package has been deprecated, use dnf instead.
See 'man yum2dnf' for more information.


Loaded plugins: auto-update-debuginfo, fastestmirror, langpacks
...
Checking for new repos for mirrors
Getting requirements for rhel/openvswitch-fedora.spec
 --> Already installed : PyQt4-4.11.4-1.fc22.x86_64
 --> Already installed : autoconf-2.69-20.fc22.noarch
...
No uninstalled build requires
$



> > Another approach would be to change the instructions to build the
> > package using mock.  That's actually what I'd prefer, I just hadn't
> > gotten around to documenting it and proposing it properly.
> 
> Russell, can you provide me sample mock commands that you use? Mock
> seems to have plenty of plugins and I did not have a chance to go
> through all of them yet.
> 
> I think there are two approaches here regarding to mock:
> 1. replace these rpmbuild commands with mock (if it is easy to set up mock); or
> 2. document Mock alongside these rpmbuild commands (in the same or
> another INSTALL document).


master]$ rpmbuild -bs rhel/openvswitch-fedora.spec 
Wrote: /home/fleitner/ovs/master/SRPMS/openvswitch-2.4.90-1.fc22.src.rpm
[fleitner@x240 master]$ mock -r fedora-21-x86_64 /home/fleitner/ovs/master/SRPMS/openvswitch-2.4.90-1.fc22.src.rpm
You are attempting to run "mock" which requires administrative
privileges, but more information is needed in order to do so.
Authenticating as "root"
Password: 
[...]
Finish: yum install
Start: creating cache
Finish: creating cache
Finish: chroot init
INFO: Installed packages:
Start: build phase for openvswitch-2.4.90-1.fc22.src.rpm
Start: build setup for openvswitch-2.4.90-1.fc22.src.rpm
[...]
Finish: build phase for openvswitch-2.4.90-1.fc22.src.rpm
INFO: Done(/home/fleitner/ovs/master/SRPMS/openvswitch-2.4.90-1.fc22.src.rpm) Config(fedora-21-x86_64) 1 minutes 33 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-21-x86_64/result
Finish: run
[fleitner@x240 master]$ ls /var/lib/mock/fedora-21-x86_64/result
build.log                             openvswitch-debuginfo-2.4.90-1.fc21.x86_64.rpm  openvswitch-test-2.4.90-1.fc21.noarch.rpm    state.log
openvswitch-2.4.90-1.fc21.src.rpm     openvswitch-devel-2.4.90-1.fc21.x86_64.rpm      python-openvswitch-2.4.90-1.fc21.noarch.rpm
openvswitch-2.4.90-1.fc21.x86_64.rpm  openvswitch-ovn-2.4.90-1.fc21.x86_64.rpm        root.log

but ``make check´´ didn't like it.


fbl
diff mbox

Patch

diff --git a/INSTALL.Fedora.md b/INSTALL.Fedora.md
index 75b6375..02d99be 100644
--- a/INSTALL.Fedora.md
+++ b/INSTALL.Fedora.md
@@ -5,7 +5,7 @@  This document describes how to build and install Open vSwitch on a Fedora
 Linux host.  If you want to install Open vSwitch on a generic Linux host,
 see [INSTALL.md] instead.
 
-We have tested these instructions with Fedora 16 and Fedora 17.
+We have tested these instructions with Fedora 16, Fedora 17 and Fedora 22.
 
 Building Open vSwitch for Fedora
 --------------------------------
@@ -21,6 +21,9 @@  the top-level:
 4. SPECS/ Contains the spec files for each package to be built.
 5. SRPMS/ Where the newly created source package files are written.
 
+If these directories do not exist on your system by default (as in Fedora 22),
+then use rpmdev-setuptree utility to create them.
+
 Before you begin, note the RPM sources directory on your version of
 Fedora.  The command "rpmbuild --showrc" will show the configuration
 for each of those directories. Alternatively, the command "rpm --eval
@@ -30,7 +33,16 @@  for the sources directory.  On Fedora 17, the default RPM _topdir is
 $HOME/rpmbuild and the default RPM sources directory is
 $HOME/rpmbuild/SOURCES.
 
-1. If you are building from a distribution tarball, skip to step 2.
+1. Install build prerequisites with dnf (or yum on older Fedora versions):
+
+   ```
+   dnf install gcc make python-devel openssl-devel kernel-devel graphviz \
+       kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
+       libtool pyqt4 groff libcap-ng-devel python-twisted-core \
+       python-zope-interface
+   ```
+
+2. If you are building from a distribution tarball, skip to step 2.
    Otherwise, you must be building from an Open vSwitch Git tree.
    Create a distribution tarball from the root of the Git tree by
    running:
@@ -41,21 +53,22 @@  $HOME/rpmbuild/SOURCES.
        make dist
 	   ```
 
-2. Now you have a distribution tarball, named something like
+3. Now you have a distribution tarball, named something like
    openvswitch-x.y.z.tar.gz.  Copy this file into the RPM sources
    directory, e.g.:
 
        `cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES`
 
-3. Make another copy of the distribution tarball in a temporary
+4. Make another copy of the distribution tarball in a temporary
    directory.  Then unpack the tarball and "cd" into its root, e.g.:
 
        ```
+       cd $HOME/rpmbuild/SOURCES
        tar xzf openvswitch-x.y.z.tar.gz
        cd openvswitch-x.y.z
 	   ```
 
-4. To build Open vSwitch userspace, run:
+5. To build Open vSwitch userspace, run:
 
        `rpmbuild -bb rhel/openvswitch-fedora.spec`
 
@@ -66,7 +79,7 @@  $HOME/rpmbuild/SOURCES.
 
        `rpmbuild -bb --without check rhel/openvswitch-fedora.spec`
 
-5. On Fedora 17, to build the Open vSwitch kernel module, run:
+6. On Fedora 17, to build the Open vSwitch kernel module, run:
 
 	`rpmbuild -bb rhel/openvswitch-kmod-fedora.spec`
 
@@ -83,6 +96,14 @@  $HOME/rpmbuild/SOURCES.
     in this example: "kmod-openvswitch", "kmod-openvswitch-debug", and
     "kmod-openvswitch-kdump".
 
+7. Find the created packages in $HOME/rpmbuild/RPMS directory.
+
+Fedora based distributions nowadays ship with SElinux enabled in enforcing mode
+by default.  This means that, if you have problems starting Open vSwitch, then
+first check that Open vSwitch is configured to run inside its SElinux confined
+area.  For more details see "man (8) openvswitch_selinux" that is distributed
+with selinux-policy-devel package on your distribution.
+
 Reporting Bugs
 --------------