From 9251d1f596b15963d9b5d7729a84b96332c54f62 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 21 Mar 2019 21:08:52 +0000 Subject: [PATCH] doc: move rpm build doc to dev docs ------------{ <(O.O)> }------------ Signed-off-by: Quentin Young --- Makefile.am | 1 - doc/developer/building-frr-for-centos6.rst | 7 +- doc/developer/building-frr-for-centos7.rst | 5 +- doc/developer/building-frr-for-fedora24.rst | 5 +- doc/developer/packaging-debian.rst | 2 + doc/developer/packaging-redhat.rst | 85 ++++++++++++++ doc/developer/packaging.rst | 1 + doc/developer/subdir.am | 5 +- redhat/README.rpm_build.md | 119 -------------------- 9 files changed, 99 insertions(+), 131 deletions(-) create mode 100644 doc/developer/packaging-redhat.rst delete mode 100644 redhat/README.rpm_build.md diff --git a/Makefile.am b/Makefile.am index 6e3c2a418..8797a8e5f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -181,7 +181,6 @@ EXTRA_DIST += \ redhat/frr.logrotate \ redhat/frr.pam \ redhat/frr.spec \ - redhat/README.rpm_build.md \ \ snapcraft/snapcraft.yaml \ snapcraft/README.snap_build.md \ diff --git a/doc/developer/building-frr-for-centos6.rst b/doc/developer/building-frr-for-centos6.rst index c57573cb9..fb58d5925 100644 --- a/doc/developer/building-frr-for-centos6.rst +++ b/doc/developer/building-frr-for-centos6.rst @@ -1,9 +1,10 @@ +.. _building-centos6: + CentOS 6 ======================================== -(As an alternative to this installation, you may prefer to create a FRR -rpm package yourself and install that package instead. See instructions -in redhat/README.rpm\_build.md on how to build a rpm package) +This document describes installation from source. If you want to build an RPM, +see :ref:`packaging-redhat`. Instructions are tested with ``CentOS 6.8`` on ``x86_64`` platform diff --git a/doc/developer/building-frr-for-centos7.rst b/doc/developer/building-frr-for-centos7.rst index 8f82cd6c9..1cec5f40d 100644 --- a/doc/developer/building-frr-for-centos7.rst +++ b/doc/developer/building-frr-for-centos7.rst @@ -1,9 +1,8 @@ CentOS 7 ======================================== -(As an alternative to this installation, you may prefer to create a FRR -rpm package yourself and install that package instead. See instructions -in redhat/README.rpm\_build.md on how to build a rpm package) +This document describes installation from source. If you want to build an RPM, +see :ref:`packaging-redhat`. CentOS 7 restrictions: ---------------------- diff --git a/doc/developer/building-frr-for-fedora24.rst b/doc/developer/building-frr-for-fedora24.rst index 2edf9b3e4..db3fa8256 100644 --- a/doc/developer/building-frr-for-fedora24.rst +++ b/doc/developer/building-frr-for-fedora24.rst @@ -1,9 +1,8 @@ Fedora 24 ========================================= -(As an alternative to this installation, you may prefer to create a FRR -rpm package yourself and install that package instead. See instructions -in redhat/README.rpm\_build.md on how to build a rpm package) +This document describes installation from source. If you want to build an RPM, +see :ref:`packaging-redhat`. Install required packages ------------------------- diff --git a/doc/developer/packaging-debian.rst b/doc/developer/packaging-debian.rst index c660f9868..b57286d5a 100644 --- a/doc/developer/packaging-debian.rst +++ b/doc/developer/packaging-debian.rst @@ -1,3 +1,5 @@ +.. _packaging-debian: + Packaging Debian ================ diff --git a/doc/developer/packaging-redhat.rst b/doc/developer/packaging-redhat.rst new file mode 100644 index 000000000..f6b993115 --- /dev/null +++ b/doc/developer/packaging-redhat.rst @@ -0,0 +1,85 @@ +.. _packaging-redhat: + +Packaging Red Hat +================= + +Tested on CentOS 6, CentOS 7 and Fedora 24. + +1. On CentOS 6, refer to :ref:`building-centos6` for details on installing + sufficiently up-to-date package versions to enable building FRR. + + Newer automake/autoconf/bison is only needed to build the RPM and is **not** + needed to install the binary RPM package. + +2. Install the build dependencies for your platform. Refer to the + platform-specific build documentation on how to do this. + +3. Install the following additional packages:: + + yum install rpm-build net-snmp-devel pam-devel libcap-devel + + If your platform uses systemd:: + + yum install systemd-devel + + If ``yum`` is not present on your system, use ``dnf`` instead. + +3. Checkout FRR:: + + git clone https://github.com/frrouting/frr.git frr + +4. Run Bootstrap and make distribution tar.gz:: + + cd frr + ./bootstrap.sh + ./configure --with-pkg-extra-version=-MyRPMVersion SPHINXBUILD=sphinx-build2.7 + make dist + + .. note:: + + The only ``configure`` option respected when building RPMs is + ``--with-pkg-extra-version``. + +5. Create RPM directory structure and populate with sources:: + + mkdir rpmbuild + mkdir rpmbuild/SOURCES + mkdir rpmbuild/SPECS + cp redhat/*.spec rpmbuild/SPECS/ + cp frr*.tar.gz rpmbuild/SOURCES/ + +6. Edit :file:`rpm/SPECS/frr.spec` with configuration as needed. + + Look at the beginning of the file and adjust the following parameters to + enable or disable features as required:: + + ############### FRRouting (FRR) configure options ################# + # with-feature options + %{!?with_pam: %global with_pam 0 } + %{!?with_ospfclient: %global with_ospfclient 1 } + %{!?with_ospfapi: %global with_ospfapi 1 } + %{!?with_irdp: %global with_irdp 1 } + %{!?with_rtadv: %global with_rtadv 1 } + %{!?with_ldpd: %global with_ldpd 1 } + %{!?with_nhrpd: %global with_nhrpd 1 } + %{!?with_eigrp: %global with_eigrpd 1 } + %{!?with_shared: %global with_shared 1 } + %{!?with_multipath: %global with_multipath 256 } + %{!?frr_user: %global frr_user frr } + %{!?vty_group: %global vty_group frrvty } + %{!?with_fpm: %global with_fpm 0 } + %{!?with_watchfrr: %global with_watchfrr 1 } + %{!?with_bgp_vnc: %global with_bgp_vnc 0 } + %{!?with_pimd: %global with_pimd 1 } + %{!?with_rpki: %global with_rpki 0 } + +7. Build the RPM:: + + rpmbuild --define "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/frr.spec + + If building with RPKI, then download and install the additional RPKI + packages from + https://ci1.netdef.org/browse/RPKI-RTRLIB/latestSuccessful/artifact + +If all works correctly, then you should end up with the RPMs under +:file:`rpmbuild/RPMS` and the source RPM under :file:`rpmbuild/SRPMS`. diff --git a/doc/developer/packaging.rst b/doc/developer/packaging.rst index 27e6e155f..b174a9660 100644 --- a/doc/developer/packaging.rst +++ b/doc/developer/packaging.rst @@ -7,3 +7,4 @@ Packaging maintainer-release-build packaging-debian + packaging-redhat diff --git a/doc/developer/subdir.am b/doc/developer/subdir.am index d76991367..a0c5e6fc9 100644 --- a/doc/developer/subdir.am +++ b/doc/developer/subdir.am @@ -5,7 +5,6 @@ dev_RSTFILES = \ doc/developer/bgp-typecodes.rst \ doc/developer/bgpd.rst \ - doc/developer/building-frr-for-openwrt.rst \ doc/developer/building-frr-for-alpine.rst \ doc/developer/building-frr-for-centos6.rst \ doc/developer/building-frr-for-centos7.rst \ @@ -19,6 +18,7 @@ dev_RSTFILES = \ doc/developer/building-frr-for-netbsd7.rst \ doc/developer/building-frr-for-omnios.rst \ doc/developer/building-frr-for-openbsd6.rst \ + doc/developer/building-frr-for-openwrt.rst \ doc/developer/building-frr-for-ubuntu1404.rst \ doc/developer/building-frr-for-ubuntu1604.rst \ doc/developer/building-frr-for-ubuntu1804.rst \ @@ -37,8 +37,9 @@ dev_RSTFILES = \ doc/developer/ospf-api.rst \ doc/developer/ospf-sr.rst \ doc/developer/ospf.rst \ - doc/developer/packaging.rst \ doc/developer/packaging-debian.rst \ + doc/developer/packaging-redhat.rst + doc/developer/packaging.rst \ doc/developer/testing.rst \ doc/developer/topotests-snippets.rst \ doc/developer/topotests.rst \ diff --git a/redhat/README.rpm_build.md b/redhat/README.rpm_build.md deleted file mode 100644 index a3f095786..000000000 --- a/redhat/README.rpm_build.md +++ /dev/null @@ -1,119 +0,0 @@ -Building your own FRRouting RPM -====================================== -(Tested on CentOS 6, CentOS 7 and Fedora 24.) - -1. On CentOS 6 (which doesn't provide a bison/automake/autoconf of a recent enough version): - - Check out ../doc/developer/building-frr-for-centos6.rst for details on installing - a bison/automake/autoconf to support frr building. - - Newer automake/autoconf/bison is only needed to build the rpm and is - **not** needed to install the binary rpm package - -2. Install the build packages as documented in doc/developer/building-frr-for-xxxxx.rst and the following additional packages: - - yum install rpm-build net-snmp-devel pam-devel libcap-devel - - Additionally, on systems with systemd (CentOS 7, Fedora) - - yum install systemd-devel - - (use `dnf install` on new Fedora instead of `yum install`) - -3. Checkout FRR under a **unpriviledged** user account - - git clone https://github.com/frrouting/frr.git frr - -4. Run Bootstrap and make distribution tar.gz - - cd frr - ./bootstrap.sh - ./configure --with-pkg-extra-version=-MyRPMVersion \ - SPHINXBUILD=sphinx-build2.7 - make dist - - Note: configure parameters are not important for the RPM building - except the `with-pkg-extra-version` if you want to give the RPM a specific name to - mark your own unoffical build - -5. Create RPM directory structure and populate with sources - - mkdir rpmbuild - mkdir rpmbuild/SOURCES - mkdir rpmbuild/SPECS - cp redhat/*.spec rpmbuild/SPECS/ - cp frr*.tar.gz rpmbuild/SOURCES/ - -6. Edit rpm/SPECS/frr.spec with configuration as needed - Look at the beginning of the file and adjust the following parameters to enable or disable features as required: - - ############### FRRouting (FRR) configure options ################# - # with-feature options - %{!?with_pam: %global with_pam 0 } - %{!?with_ospfclient: %global with_ospfclient 1 } - %{!?with_ospfapi: %global with_ospfapi 1 } - %{!?with_irdp: %global with_irdp 1 } - %{!?with_rtadv: %global with_rtadv 1 } - %{!?with_ldpd: %global with_ldpd 1 } - %{!?with_nhrpd: %global with_nhrpd 1 } - %{!?with_eigrp: %global with_eigrpd 1 } - %{!?with_shared: %global with_shared 1 } - %{!?with_multipath: %global with_multipath 256 } - %{!?frr_user: %global frr_user frr } - %{!?vty_group: %global vty_group frrvty } - %{!?with_fpm: %global with_fpm 0 } - %{!?with_watchfrr: %global with_watchfrr 1 } - %{!?with_bgp_vnc: %global with_bgp_vnc 0 } - %{!?with_pimd: %global with_pimd 1 } - %{!?with_rpki: %global with_rpki 0 } - -7. Build the RPM - - rpmbuild --define "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/frr.spec - - If building with RPKI, then download and install the additional RPKI - packages from - https://ci1.netdef.org/browse/RPKI-RTRLIB/latestSuccessful/artifact - -DONE. - -If all works correctly, then you should end up with the RPMs under -`rpmbuild/RPMS` and the Source RPM under `rpmbuild/SRPMS` - - -Enabling daemons after installation of the package: ---------------------------------------------------- - -### init.d based systems (ie CentOS 6): - -1. Edit /etc/frr/daemons and enable required routing daemons (Zebra is probably needed for most deployments, so make sure to enable it.) - -2. Enable the daemons as needed to run after boot (Zebra is mandatory) - - chkconfig frr on - -3. Check your firewall / IPtables to make sure the routing protocols are -allowed. - -5. Start the FRR daemons (or reboot) - - service frr start - -Configuration is stored in `/etc/frr/*.conf` files and daemon selection is stored in `/etc/frr/daemons`. - - -### systemd based systems (ie CentOS 7, Fedora 24) - -1. Edit /etc/frr/daemons and enable required routing daemons (Zebra is probably needed for most deployments, so make sure to enable it.) - -2. Enable the frr daemons to run after boot. - - systemctl enable frr - -2. Check your firewall / IPtables to make sure the routing protocols are -allowed. - -3. Start the daemons (or reboot) - - systemctl start frr - -Configuration is stored in `/etc/frr/*.conf` files and daemon selection is stored in `/etc/frr/daemons`. - -- 2.39.2