build: update packaging & docs for dir changes

`--sysconfdir` and `--localstatedir` now align with general autoconf
practices.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2024-01-25 16:35:29 +01:00
parent ff62df2e44
commit 444bc5e237
25 changed files with 65 additions and 66 deletions

View File

@ -28,9 +28,7 @@ source="$pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver
_sbindir=/usr/lib/frr
_sysconfdir=/etc/frr
_libdir=/usr/lib
_localstatedir=/var/run/frr
_user=frr
build() {
@ -38,10 +36,10 @@ build() {
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=$_sbindir \
--sysconfdir=$_sysconfdir \
--libdir=$_libdir \
--localstatedir=$_localstatedir \
--enable-rpki \
--enable-vtysh \
--enable-multipath=64 \

View File

@ -5,7 +5,7 @@
# builds some git commit of FRR in some different configurations
# usage: buildtest.sh [commit [configurations...]]
basecfg="--prefix=/usr --enable-user=frr --enable-group=frr --enable-vty-group=frr --enable-configfile-mask=0660 --enable-logfile-mask=0640 --enable-vtysh --sysconfdir=/etc/frr --localstatedir=/var/run/frr --libdir=/usr/lib64/frr --enable-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd --enable-werror"
basecfg="--prefix=/usr --enable-user=frr --enable-group=frr --enable-vty-group=frr --enable-configfile-mask=0660 --enable-logfile-mask=0640 --enable-vtysh --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib64/frr --enable-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd --enable-werror"
configs_base="gcc|$basecfg"

2
debian/rules vendored
View File

@ -41,9 +41,7 @@ export PYTHON=python3
override_dh_auto_configure:
$(shell dpkg-buildflags --export=sh); \
dh_auto_configure -- \
--localstatedir=/var/run/frr \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--with-vtysh-pager=/usr/bin/pager \
--libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr \
--with-moduledir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr/modules \

View File

@ -161,10 +161,8 @@ an example.)
./configure \
--bindir=/usr/bin \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--libdir=/usr/lib/frr \
--libexecdir=/usr/lib/frr \
--localstatedir=/var/run/frr \
--with-moduledir=/usr/lib/frr/modules \
--disable-pimd \
--enable-snmp=agentx \

View File

@ -58,10 +58,8 @@ an example.)
./configure \
--bindir=/usr/bin \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--libdir=/usr/lib/frr \
--libexecdir=/usr/lib/frr \
--localstatedir=/var/run/frr \
--with-moduledir=/usr/lib/frr/modules \
--enable-snmp=agentx \
--enable-multipath=64 \

View File

@ -52,10 +52,8 @@ an example.)
./configure \
--bindir=/usr/bin \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--libdir=/usr/lib/frr \
--libexecdir=/usr/lib/frr \
--localstatedir=/var/run/frr \
--with-moduledir=/usr/lib/frr/modules \
--enable-snmp=agentx \
--enable-multipath=64 \

View File

@ -47,9 +47,9 @@ an example.)
cd frr
./bootstrap.sh
./configure \
--localstatedir=/var/opt/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--enable-multipath=64 \
--enable-user=frr \
--enable-group=frr \

View File

@ -57,9 +57,9 @@ an example.)
cd frr
./bootstrap.sh
./configure \
--localstatedir=/var/run/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--enable-multipath=64 \
--enable-user=frr \
--enable-group=frr \
@ -118,9 +118,9 @@ Troubleshooting
The local state directory must exist and have the correct permissions
applied for the frrouting daemons to start. In the above ./configure
example the local state directory is set to /var/run/frr
(--localstatedir=/var/run/frr) Debian considers /var/run/frr to be
temporary and this is removed after a reboot.
example the local state directory is set to ``/var`` such that ``/var/run/frr``
is used. Debian considers ``/var/run/frr`` to be temporary and this is removed
after a reboot.
When using a different local state directory you need to create the new
directory and change the ownership to the frr user, for example:

View File

@ -47,9 +47,9 @@ an example.)
cd frr
./bootstrap.sh
./configure \
--localstatedir=/var/opt/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--enable-multipath=64 \
--enable-user=frr \
--enable-group=frr \

View File

@ -60,9 +60,9 @@ an example)
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include"
./configure \
--sysconfdir=/usr/local/etc/frr \
--sysconfdir=/usr/local/etc \
--localstatedir=/var \
--enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
--localstatedir=/var/run/frr \
--prefix=/usr/local \
--enable-multipath=64 \
--enable-user=frr \

View File

@ -65,9 +65,9 @@ an example)
setenv CPPFLAGS -I/usr/local/include
ln -s /usr/local/bin/sphinx-build-3.6 /usr/local/bin/sphinx-build
./configure \
--sysconfdir=/usr/local/etc/frr \
--sysconfdir=/usr/local/etc \
--localstatedir=/var \
--enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
--localstatedir=/var/run/frr \
--prefix=/usr/local \
--enable-multipath=64 \
--enable-user=frr \

View File

@ -52,9 +52,9 @@ an example)
./bootstrap.sh
export MAKE=gmake LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include
./configure \
--sysconfdir=/usr/local/etc/frr \
--sysconfdir=/usr/local/etc \
--localstatedir=/var \
--enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
--localstatedir=/var/run/frr \
--prefix=/usr/local \
--enable-multipath=64 \
--enable-user=frr \

View File

@ -52,9 +52,9 @@ an example)
./bootstrap.sh
export MAKE=gmake LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include
./configure \
--sysconfdir=/usr/local/etc/frr \
--sysconfdir=/usr/local/etc \
--localstatedir=/var \
--enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
--localstatedir=/var/run/frr \
--prefix=/usr/local \
--enable-multipath=64 \
--enable-user=frr \

View File

@ -70,9 +70,9 @@ an example)
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include"
./configure \
--sysconfdir=/usr/local/etc/frr \
--sysconfdir=/usr/local/etc \
--localstatedir=/var \
--enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
--localstatedir=/var/run/frr \
--prefix=/usr/local \
--enable-multipath=64 \
--enable-user=frr \

View File

@ -64,9 +64,9 @@ an example)
export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib"
export CPPFLAGS="-I/usr/pkg/include"
./configure \
--sysconfdir=/usr/pkg/etc/frr \
--sysconfdir=/usr/pkg/etc \
--localstatedir=/var \
--enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
--localstatedir=/var/run/frr \
--enable-multipath=64 \
--enable-user=frr \
--enable-group=frr \

View File

@ -55,9 +55,9 @@ an example)
export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib"
export CPPFLAGS="-I/usr/pkg/include"
./configure \
--sysconfdir=/usr/pkg/etc/frr \
--sysconfdir=/usr/pkg/etc \
--localstatedir=/var \
--enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
--localstatedir=/var/run/frr \
--enable-multipath=64 \
--enable-user=frr \
--enable-group=frr \

View File

@ -71,8 +71,8 @@ an example)
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include"
./configure \
--sysconfdir=/etc/frr \
--localstatedir=/var/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-multipath=64 \
--enable-user=_frr \
--enable-group=_frr \

View File

@ -239,9 +239,9 @@ the last thing to actually build is FRR itself:
--host=${HOST_ARCH} \
--with-sysroot=/usr/${HOST_ARCH} \
--with-clippy=./build-clippy/lib/clippy \
--sysconfdir=/etc/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir="\${prefix}/lib/frr" \
--localstatedir=/var/run/frr \
--prefix=/usr \
--enable-user=frr \
--enable-group=frr \

View File

@ -14,8 +14,8 @@ obtained by running ``./configure -h``. The options shown below are examples.
--sbindir=\${prefix}/lib/frr \
--libdir=\${prefix}/lib/frr \
--libexecdir=\${prefix}/lib/frr \
--localstatedir=/var/run/frr \
--sysconfdir=/etc/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--with-moduledir=\${prefix}/lib/frr/modules \
--enable-configfile-mask=0640 \
--enable-logfile-mask=0640 \

View File

@ -113,9 +113,9 @@ If you prefer to manually build FRR, then use the following suggested config:
./configure \
--prefix=/usr \
--localstatedir=/var/run/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--enable-vtysh \
--enable-pimd \
--enable-pim6d \
@ -383,8 +383,9 @@ for ``master`` branch:
./bootstrap.sh
./configure \
--enable-address-sanitizer \
--prefix=/usr/lib/frr --sysconfdir=/etc/frr \
--localstatedir=/var/run/frr \
--prefix=/usr/lib/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/lib/frr --bindir=/usr/lib/frr \
--with-moduledir=/usr/lib/frr/modules \
--enable-multipath=0 --enable-rtadv \

View File

@ -394,13 +394,20 @@ options to the configuration script.
.. option:: --sysconfdir <dir>
Look for configuration files in `dir` [`prefix`/etc]. Note that sample
configuration files will be installed here.
Look for configuration files in `dir`/frr [`prefix`/etc]. Note that sample
configuration files will be installed here. Should be ``/etc`` unless
your platform splits package configuration locations.
.. option:: --localstatedir <dir>
Configure zebra to use `dir` for local state files, such as pid files and
unix sockets.
Configure base directory for local state. Indirectly controls
``--runstatedir``. Should be ``/var`` in most cases.
.. option:: --runstatedir <dir>
Configure FRR to use `dir`/frr for local state files, such as pid files and
unix sockets. Should be ``/var/run`` (default through ``--localstatedir``)
or ``/run`` in most cases.
.. option:: --with-scriptdir <dir>
@ -579,9 +586,9 @@ the options you chose:
./configure \
--prefix=/usr \
--localstatedir=/var/run/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--enable-pimd \
--enable-watchfrr \
...

View File

@ -110,9 +110,9 @@ RUN cd ~/frr && \
./bootstrap.sh && \
./configure \
--prefix=/usr \
--localstatedir=/var/run/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--enable-sharpd \
--enable-multipath=64 \
--enable-user=frr \

View File

@ -42,8 +42,9 @@
%define zeb_docs %{zeb_src}/doc
%define frr_tools %{zeb_src}/tools
# defines for configure
%define rundir %{_localstatedir}/run/%{name}
%if 0%{!?_runstatedir:1}
%define _runstatedir %{_localstatedir}/run
%endif
############################################################################
@ -317,8 +318,8 @@ routing state through standard SNMP MIBs.
%configure \
--sbindir=%{_sbindir} \
--sysconfdir=%{configdir} \
--localstatedir=%{rundir} \
--sysconfdir=%{_sysconfdir} \
--localstatedir=%{_localstatedir} \
--disable-static \
--disable-werror \
--enable-irdp \
@ -471,7 +472,7 @@ install %{zeb_src}/tools/etc/frr/daemons %{buildroot}%{_sysconfdir}/frr
install %{zeb_src}/tools/etc/frr/frr.conf %{buildroot}%{_sysconfdir}/frr/frr.conf.template
install -m644 %{zeb_rh_src}/frr.pam %{buildroot}%{_sysconfdir}/pam.d/frr
install -m644 %{zeb_src}/tools/etc/logrotate.d/frr %{buildroot}%{_sysconfdir}/logrotate.d/frr
install -d -m750 %{buildroot}%{rundir}
install -d -m750 %{buildroot}%{_runstatedir}/frr
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
# avoid `ERROR: ambiguous python shebang in` errors
@ -495,7 +496,7 @@ rm -f %{buildroot}%{_sbindir}/ospfclient.py
getent passwd %{frr_user} >/dev/null || \
useradd -r -u %{frr_uid} -g %{frr_user} \
-s /sbin/nologin -c "FRRouting suite" \
-d %{rundir} %{frr_user}
-d %{_runstatedir}/frr %{frr_user}
%if 0%{?vty_group:1}
usermod -a -G %{vty_group} %{frr_user}
@ -655,11 +656,11 @@ fi
%if 0%{?frr_user:1}
%dir %attr(751,%{frr_user},%{frr_user}) %{configdir}
%dir %attr(755,%{frr_user},%{frr_user}) %{_localstatedir}/log/frr
%dir %attr(751,%{frr_user},%{frr_user}) %{rundir}
%dir %attr(751,%{frr_user},%{frr_user}) %{_runstatedir}/frr
%else
%dir %attr(750,root,root) %{configdir}
%dir %attr(755,root,root) %{_localstatedir}/log/frr
%dir %attr(750,root,root) %{rundir}
%dir %attr(750,root,root) %{_runstatedir}/frr
%endif
%{_infodir}/frr.info.gz
%{_mandir}/man*/*

View File

@ -381,10 +381,10 @@ parts:
- --enable-vrrpd
- --enable-configfile-mask=0640
- --enable-logfile-mask=0640
- --localstatedir=/var/run
- --sysconfdir=/etc
- --localstatedir=/var
- --sbindir=/sbin
- --bindir=/bin
- --sysconfdir=/etc/frr
- --with-pkg-extra-version=@PACKAGE_EXTRAVERSION@
frr-defaults:
plugin: dump

View File

@ -64,9 +64,9 @@ if [ ! -e Makefile ]; then
--enable-dev-build \
--with-moduledir=/usr/lib/frr/modules \
--prefix=/usr \
--localstatedir=/var/run/frr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=/usr/lib/frr \
--sysconfdir=/etc/frr \
--enable-multipath=0 \
--enable-fpm \
--enable-sharpd \