..
      Licensed under the Apache License, Version 2.0 (the "License"); you may
      not use this file except in compliance with the License. You may obtain
      a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
      WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
      License for the specific language governing permissions and limitations
      under the License.

      Convention for heading levels in OVN documentation:

      =======  Heading 0 (reserved for the title in a document)
      -------  Heading 1
      ~~~~~~~  Heading 2
      +++++++  Heading 3
      '''''''  Heading 4

      Avoid deeper levels because they do not render well.

===========================================
Fedora, RHEL 7.x+ Packaging for OVN
===========================================

This document provides instructions for building and installing OVN
RPM packages on a Fedora Linux host. Instructions for the installation of OVN
Fedora Linux host without using RPM packages can be found in the
:doc:`general`.

These instructions have been tested with Fedora 29 and 30, and are also
applicable for RHEL 7.x and its derivatives, including CentOS 7.x and
Scientific Linux 7.x.

Build Requirements
------------------

You will need to install all required packages to build the RPMs.
Newer distributions use ``dnf`` but if it's not available, then use
``yum`` instructions.

The command below will install RPM tools and generic build dependencies.
And (optionally) include these packages: libcap-ng libcap-ng-devel.

DNF:
::

    $ dnf install @'Development Tools' rpm-build dnf-plugins-core

YUM:
::

    $ yum install @'Development Tools' rpm-build yum-utils

Then it is necessary to install OVN specific build dependencies.
The dependencies are listed in the SPEC file, but first it is necessary
to replace the VERSION tag to be a valid SPEC.

The command below will create a temporary SPEC file::

    $ sed -e 's/@VERSION@/0.0.1/' rhel/ovn-fedora.spec.in \
      > /tmp/ovn.spec

And to install specific dependencies, use the corresponding tool below.
For some of the dependencies on RHEL you may need to add two additional
repositories to help yum-builddep, e.g.::

    $ subscription-manager repos --enable=rhel-7-server-extras-rpms
    $ subscription-manager repos --enable=rhel-7-server-optional-rpms

DNF::

    $ dnf builddep /tmp/ovn.spec

YUM::

    $ yum-builddep /tmp/ovn.spec

Once that is completed, remove the file ``/tmp/ovn.spec``.

Bootstraping
------------

Refer to :ref:`general-bootstrapping`.

Configuring
-----------

Refer to :ref:`general-configuring`.

Building
--------

OVN RPMs
~~~~~~~~~~~~~~~

To build OVN RPMs, first generate openvswitch source tarball in
your openvwitch source directory by running

::

    $make dist

And then execute the following in the OVN source directory
(in which `./configure` was executed):

::

    $ make rpm-fedora

This will create the RPMs `ovn`, `ovn-central`, `ovn-host`, `ovn-vtep`,
`ovn-docker`, ``ovn-debuginfo``, ``ovn-central-debuginfo``,
``ovn-host-debuginfo`` and ```ovn-vtep-debuginfo```.


You can also have the above commands automatically run the OVN unit
tests.  This can take several minutes.

::

    $ make rpm-fedora RPMBUILD_OPT="--with check"


Installing
----------

RPM packages can be installed by using the command ``rpm -i``. Package
installation requires superuser privileges.

Reporting Bugs
--------------

Report problems to bugs@openvswitch.org.
