summaryrefslogtreecommitdiff
path: root/distro/pkg/rpm
diff options
context:
space:
mode:
authorJakub Ružička <jakub.ruzicka@nic.cz>2021-04-06 18:13:16 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-05-19 17:22:11 +0200
commit329d6e3fbc5a09a9bc8800bd8a5d239dec1a3d24 (patch)
tree29bf25fc20a609c0d81469fc2e4e528b99d4f5bb /distro/pkg/rpm
parentc3c691e95cd40d8654b720be8d9a8ae9fb050951 (diff)
add apkg-powered upstream packaging for deb, rpm
Files in a single new distro/ dir allow apkg to build BIRD packages for various distros directly from upstream sources as well as from upstream archives. Please see distro/README.md for more detail as well as apkg docs: https://apkg.rtfd.io I've used these files to build bird-2.0.8 on all currently supported releases of following distros: * Debian * Ubuntu * Fedora * CentOS * openSUSE Please note that latest apkg with accumulated fixes for bird is needed: https://gitlab.nic.cz/packaging/apkg/-/merge_requests/35
Diffstat (limited to 'distro/pkg/rpm')
-rw-r--r--distro/pkg/rpm/bird.service13
-rw-r--r--distro/pkg/rpm/bird.spec121
-rw-r--r--distro/pkg/rpm/bird.tmpfilesd1
3 files changed, 135 insertions, 0 deletions
diff --git a/distro/pkg/rpm/bird.service b/distro/pkg/rpm/bird.service
new file mode 100644
index 00000000..fa203c78
--- /dev/null
+++ b/distro/pkg/rpm/bird.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=BIRD Internet Routing Daemon
+Wants=network.target
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/bird -f -u bird -g bird
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/distro/pkg/rpm/bird.spec b/distro/pkg/rpm/bird.spec
new file mode 100644
index 00000000..1267cf9b
--- /dev/null
+++ b/distro/pkg/rpm/bird.spec
@@ -0,0 +1,121 @@
+%global _hardened_build 1
+
+%if "x%{?suse_version}" == "x"
+# missing linuxdoc-tools and sgml-common on SUSE
+%define _without_doc 1
+%endif
+
+Name: bird
+Version: {{ version }}
+Release: cznic.{{ release }}%{?dist}
+Summary: BIRD Internet Routing Daemon
+
+License: GPLv2+
+URL: https://bird.network.cz/
+Source0: https://bird.network.cz/download/bird-%{version}.tar.gz
+Source1: bird.service
+Source2: bird.tmpfilesd
+
+BuildRequires: flex
+BuildRequires: bison
+BuildRequires: ncurses-devel
+BuildRequires: readline-devel
+BuildRequires: sed
+BuildRequires: gcc
+BuildRequires: make
+BuildRequires: libssh-devel
+%if 0%{?fedora} || (0%{?rhel} && 0%{?rhel} > 7)
+BuildRequires: systemd-rpm-macros
+%else
+BuildRequires: systemd
+%endif
+
+Obsoletes: bird6 < 2.0.2-1
+Provides: bird6 = %{version}-%{release}
+
+%description
+BIRD is a dynamic IP routing daemon supporting both, IPv4 and IPv6, Border
+Gateway Protocol (BGPv4), Routing Information Protocol (RIPv2, RIPng), Open
+Shortest Path First protocol (OSPFv2, OSPFv3), Babel Routing Protocol (Babel),
+Bidirectional Forwarding Detection (BFD), IPv6 router advertisements, static
+routes, inter-table protocol, command-line interface allowing on-line control
+and inspection of the status of the daemon, soft reconfiguration as well as a
+powerful language for route filtering.
+
+%if 0%{!?_without_doc:1}
+%package doc
+Summary: Documentation for BIRD Internet Routing Daemon
+BuildRequires: linuxdoc-tools sgml-common perl(FindBin)
+BuildArch: noarch
+
+%description doc
+Documentation for users and programmers of the BIRD Internet Routing Daemon.
+
+BIRD is a dynamic IP routing daemon supporting both, IPv4 and IPv6, Border
+Gateway Protocol (BGPv4), Routing Information Protocol (RIPv2, RIPng), Open
+Shortest Path First protocol (OSPFv2, OSPFv3), Babel Routing Protocol (Babel),
+Bidirectional Forwarding Detection (BFD), IPv6 router advertisements, static
+routes, inter-table protocol, command-line interface allowing on-line control
+and inspection of the status of the daemon, soft reconfiguration as well as a
+powerful language for route filtering.
+%endif
+
+%prep
+%setup -q
+
+%build
+%configure --runstatedir=%{_rundir}/bird
+%make_build all %{!?_without_doc:docs}
+
+%install
+%make_install
+
+{% raw %}
+install -d %{buildroot}{%{_localstatedir}/lib/bird,%{_rundir}/bird}
+install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/bird.service
+install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/bird.conf
+{% endraw %}
+
+%check
+make test
+
+%pre
+getent group bird >/dev/null || groupadd -r bird
+getent passwd bird >/dev/null || \
+ useradd -r -g bird -d %{_localstatedir}/lib/bird -s /sbin/nologin \
+ -c "BIRD daemon user" bird
+exit 0
+
+%post
+%systemd_post bird.service
+
+%preun
+%systemd_preun bird.service
+
+%postun
+%systemd_postun_with_restart bird.service
+
+%files
+%doc NEWS README
+%attr(0640,root,bird) %config(noreplace) %{_sysconfdir}/bird.conf
+%{_unitdir}/bird.service
+%{_tmpfilesdir}/bird.conf
+%{_sbindir}/bird
+%{_sbindir}/birdc
+%{_sbindir}/birdcl
+%dir %attr(0750,bird,bird) %{_localstatedir}/lib/bird
+%dir %attr(0750,bird,bird) %{_rundir}/bird
+
+%if 0%{!?_without_doc:1}
+%files doc
+%doc NEWS README
+%doc doc/bird.conf.*
+%doc obj/doc/bird*.html
+%doc obj/doc/bird.pdf
+%doc obj/doc/prog*.html
+%doc obj/doc/prog.pdf
+%endif
+
+%changelog
+* Wed Apr 07 2021 Jakub Ružička <jakub.ruzicka@nic.cz> - {{ version }}-cznic.1
+- upstream package
diff --git a/distro/pkg/rpm/bird.tmpfilesd b/distro/pkg/rpm/bird.tmpfilesd
new file mode 100644
index 00000000..a73133ae
--- /dev/null
+++ b/distro/pkg/rpm/bird.tmpfilesd
@@ -0,0 +1 @@
+d /run/bird 750 bird bird