]>
Commit | Line | Data |
---|---|---|
9251d1f5 QY |
1 | .. _packaging-redhat: |
2 | ||
3 | Packaging Red Hat | |
4 | ================= | |
5 | ||
1fe4beb2 | 6 | Tested on CentOS 6, CentOS 7, CentOS 8 and Fedora 24. |
9251d1f5 QY |
7 | |
8 | 1. On CentOS 6, refer to :ref:`building-centos6` for details on installing | |
9 | sufficiently up-to-date package versions to enable building FRR. | |
10 | ||
11 | Newer automake/autoconf/bison is only needed to build the RPM and is **not** | |
12 | needed to install the binary RPM package. | |
13 | ||
14 | 2. Install the build dependencies for your platform. Refer to the | |
15 | platform-specific build documentation on how to do this. | |
16 | ||
17 | 3. Install the following additional packages:: | |
18 | ||
19 | yum install rpm-build net-snmp-devel pam-devel libcap-devel | |
20 | ||
03d2acc8 MW |
21 | For CentOS 7 and CentOS 8, the package will be built using python3 |
22 | and requires additional python3 packages:: | |
23 | ||
24 | yum install python3-devel python3-sphinx | |
25 | ||
1fe4beb2 DA |
26 | .. note:: |
27 | ||
28 | For CentOS 8 you need to install ``platform-python-devel`` package | |
29 | to provide ``/usr/bin/pathfix.py``:: | |
30 | ||
31 | yum install platform-python-devel | |
32 | ||
1fe4beb2 | 33 | |
9251d1f5 QY |
34 | If ``yum`` is not present on your system, use ``dnf`` instead. |
35 | ||
1fe4beb2 DA |
36 | You should enable ``PowerTools`` repo if using CentOS 8 which |
37 | is disabled by default. | |
38 | ||
ca326047 | 39 | 4. Checkout FRR:: |
9251d1f5 QY |
40 | |
41 | git clone https://github.com/frrouting/frr.git frr | |
42 | ||
ca326047 | 43 | 5. Run Bootstrap and make distribution tar.gz:: |
9251d1f5 QY |
44 | |
45 | cd frr | |
46 | ./bootstrap.sh | |
45da32d7 | 47 | ./configure --with-pkg-extra-version=-MyRPMVersion |
9251d1f5 QY |
48 | make dist |
49 | ||
50 | .. note:: | |
51 | ||
52 | The only ``configure`` option respected when building RPMs is | |
53 | ``--with-pkg-extra-version``. | |
54 | ||
ca326047 | 55 | 6. Create RPM directory structure and populate with sources:: |
9251d1f5 QY |
56 | |
57 | mkdir rpmbuild | |
58 | mkdir rpmbuild/SOURCES | |
59 | mkdir rpmbuild/SPECS | |
60 | cp redhat/*.spec rpmbuild/SPECS/ | |
61 | cp frr*.tar.gz rpmbuild/SOURCES/ | |
62 | ||
ca326047 | 63 | 7. Edit :file:`rpm/SPECS/frr.spec` with configuration as needed. |
9251d1f5 QY |
64 | |
65 | Look at the beginning of the file and adjust the following parameters to | |
66 | enable or disable features as required:: | |
67 | ||
68 | ############### FRRouting (FRR) configure options ################# | |
69 | # with-feature options | |
70 | %{!?with_pam: %global with_pam 0 } | |
71 | %{!?with_ospfclient: %global with_ospfclient 1 } | |
72 | %{!?with_ospfapi: %global with_ospfapi 1 } | |
73 | %{!?with_irdp: %global with_irdp 1 } | |
74 | %{!?with_rtadv: %global with_rtadv 1 } | |
75 | %{!?with_ldpd: %global with_ldpd 1 } | |
76 | %{!?with_nhrpd: %global with_nhrpd 1 } | |
77 | %{!?with_eigrp: %global with_eigrpd 1 } | |
78 | %{!?with_shared: %global with_shared 1 } | |
79 | %{!?with_multipath: %global with_multipath 256 } | |
80 | %{!?frr_user: %global frr_user frr } | |
81 | %{!?vty_group: %global vty_group frrvty } | |
82 | %{!?with_fpm: %global with_fpm 0 } | |
83 | %{!?with_watchfrr: %global with_watchfrr 1 } | |
84 | %{!?with_bgp_vnc: %global with_bgp_vnc 0 } | |
85 | %{!?with_pimd: %global with_pimd 1 } | |
86 | %{!?with_rpki: %global with_rpki 0 } | |
87 | ||
ca326047 | 88 | 8. Build the RPM:: |
9251d1f5 QY |
89 | |
90 | rpmbuild --define "_topdir `pwd`/rpmbuild" -ba rpmbuild/SPECS/frr.spec | |
91 | ||
92 | If building with RPKI, then download and install the additional RPKI | |
93 | packages from | |
94 | https://ci1.netdef.org/browse/RPKI-RTRLIB/latestSuccessful/artifact | |
95 | ||
96 | If all works correctly, then you should end up with the RPMs under | |
97 | :file:`rpmbuild/RPMS` and the source RPM under :file:`rpmbuild/SRPMS`. |