Skip to content

Commit

Permalink
build: update packaging & docs for dir changes
Browse files Browse the repository at this point in the history
`--sysconfdir` and `--localstatedir` now align with general autoconf
practices.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
  • Loading branch information
eqvinox committed Jan 27, 2024
1 parent ff62df2 commit 444bc5e
Show file tree
Hide file tree
Showing 25 changed files with 65 additions and 66 deletions.
6 changes: 2 additions & 4 deletions alpine/APKBUILD.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ 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() {
cd "$builddir"

./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--sbindir=$_sbindir \
--sysconfdir=$_sysconfdir \
--libdir=$_libdir \
--localstatedir=$_localstatedir \
--enable-rpki \
--enable-vtysh \
--enable-multipath=64 \
Expand Down
2 changes: 1 addition & 1 deletion buildtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 0 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 0 additions & 2 deletions doc/developer/building-frr-for-centos6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 0 additions & 2 deletions doc/developer/building-frr-for-centos7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 0 additions & 2 deletions doc/developer/building-frr-for-centos8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-debian12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
10 changes: 5 additions & 5 deletions doc/developer/building-frr-for-debian8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-debian9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-freebsd10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-freebsd11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-freebsd13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-freebsd14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-freebsd9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-netbsd6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-netbsd7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/building-frr-for-openbsd6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/cross-compiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions doc/developer/include-compile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
9 changes: 5 additions & 4 deletions doc/developer/topotests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
19 changes: 13 additions & 6 deletions doc/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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 \
...
Expand Down
4 changes: 2 additions & 2 deletions docker/ubuntu-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
17 changes: 9 additions & 8 deletions redhat/frr.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

############################################################################

Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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}
Expand Down Expand Up @@ -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*/*
Expand Down
4 changes: 2 additions & 2 deletions snapcraft/snapcraft.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/docker/inner/compile_frr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 444bc5e

Please sign in to comment.