0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00

RPM: Sync bird.spec from Fedora dist-git

It seems all Fedora packages are built from epel7 branch.
This commit is contained in:
Jakub Ružička 2023-08-22 14:13:55 +02:00 committed by Ondrej Zajicek
parent 31ef5645e9
commit d2dbe85463
2 changed files with 25 additions and 14 deletions

View File

@ -1,16 +1,19 @@
%global _hardened_build 1 %global _hardened_build 1
%global _without_doc 1 %global _without_doc 1
%{!?_rundir:%global _rundir %%{_localstatedir}/run}
Name: bird Name: bird
Version: {{ version }} Version: {{ version }}
Release: cznic.{{ release }}%{?dist} Release: cznic.{{ release }}%{?dist}
Summary: BIRD Internet Routing Daemon Summary: BIRD Internet Routing Daemon
Group: System Environment/Daemons
License: GPL-2.0-or-later License: GPL-2.0-or-later
URL: https://bird.network.cz/ URL: https://bird.network.cz/
Source0: https://bird.network.cz/download/bird-%{version}.tar.gz Source0: https://bird.network.cz/download/bird-%{version}.tar.gz
Source1: bird.service Source1: bird.service
Source2: bird.tmpfilesd Source2: bird.tmpfilesd
Source3: bird.sysusersd
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: flex BuildRequires: flex
@ -21,14 +24,13 @@ BuildRequires: sed
BuildRequires: gcc BuildRequires: gcc
BuildRequires: make BuildRequires: make
BuildRequires: libssh-devel BuildRequires: libssh-devel
%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} > 7) %if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: systemd-rpm-macros # http://trubka.network.cz/pipermail/bird-users/2019-August/013631.html
%else BuildRequires: devtoolset-8-toolchain
BuildRequires: systemd
%endif %endif
BuildRequires: systemd-rpm-macros
Obsoletes: bird6 < 2.0.2-1 %{?systemd_requires}
Provides: bird6 = %{version}-%{release} %{?sysusers_requires_compat}
%description %description
BIRD is a dynamic IP routing daemon supporting both, IPv4 and IPv6, Border BIRD is a dynamic IP routing daemon supporting both, IPv4 and IPv6, Border
@ -42,6 +44,7 @@ powerful language for route filtering.
%if 0%{!?_without_doc:1} %if 0%{!?_without_doc:1}
%package doc %package doc
Summary: Documentation for BIRD Internet Routing Daemon Summary: Documentation for BIRD Internet Routing Daemon
Group: Documentation
BuildRequires: linuxdoc-tools sgml-common perl(FindBin) BuildRequires: linuxdoc-tools sgml-common perl(FindBin)
BuildArch: noarch BuildArch: noarch
@ -58,9 +61,13 @@ powerful language for route filtering.
%endif %endif
%prep %prep
%setup -q %setup -q -n bird-%{version}
%build %build
%if 0%{?rhel} && 0%{?rhel} < 8
. /opt/rh/devtoolset-8/enable
%endif
%configure --runstatedir=%{_rundir}/bird %configure --runstatedir=%{_rundir}/bird
%make_build all %{!?_without_doc:docs} %make_build all %{!?_without_doc:docs}
@ -71,17 +78,18 @@ powerful language for route filtering.
install -d %{buildroot}{%{_localstatedir}/lib/bird,%{_rundir}/bird} install -d %{buildroot}{%{_localstatedir}/lib/bird,%{_rundir}/bird}
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/bird.service install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/bird.service
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/bird.conf install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/bird.conf
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/bird.conf
{% endraw %} {% endraw %}
%check %check
%if 0%{?rhel} && 0%{?rhel} < 8
. /opt/rh/devtoolset-8/enable
%endif
make test make test
%pre %pre
getent group bird >/dev/null || groupadd -r bird %sysusers_create_compat %{SOURCE3}
getent passwd bird >/dev/null || \
useradd -r -g bird -d %{_localstatedir}/lib/bird -s /sbin/nologin \
-c "BIRD daemon user" bird
exit 0
%post %post
%systemd_post bird.service %systemd_post bird.service
@ -96,12 +104,13 @@ exit 0
%doc NEWS README %doc NEWS README
%attr(0640,root,bird) %config(noreplace) %{_sysconfdir}/bird.conf %attr(0640,root,bird) %config(noreplace) %{_sysconfdir}/bird.conf
%{_unitdir}/bird.service %{_unitdir}/bird.service
%{_sysusersdir}/bird.conf
%{_tmpfilesdir}/bird.conf %{_tmpfilesdir}/bird.conf
%{_sbindir}/bird %{_sbindir}/bird
%{_sbindir}/birdc %{_sbindir}/birdc
%{_sbindir}/birdcl %{_sbindir}/birdcl
%dir %attr(0750,bird,bird) %{_localstatedir}/lib/bird %dir %attr(0750,bird,bird) %{_localstatedir}/lib/bird
%dir %attr(0750,bird,bird) %ghost %{_rundir}/bird %dir %attr(0750,bird,bird) %{_rundir}/bird
%if 0%{!?_without_doc:1} %if 0%{!?_without_doc:1}
%files doc %files doc

View File

@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u bird - "BIRD daemon user" /var/lib/bird -