File bird.spec of Package bird

%define realname bird
%define realver  2.15.1
%define srcext   tar.gz

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       wiz%{?extraver:0.}1%{?dist}
License:       GPL-2.0+
Group:         Productivity/Networking/Routing
URL:           http://bird.network.cz/
Summary:       The Internet Routing Daemon

# Install-time parameters
Provides:      bird6 = %{version}-%{release}
Obsoletes:     bird6 < %{version}-%{release}

# Build-time parameters
BuildRequires: bison flex
BuildRequires: libssh-devel
BuildRequires: ncurses-devel readline-devel
Source:        ftp://bird.network.cz/pub/bird/%{realname}-%{realver}%{?extraver}.%{srcext}
Source12:      bird.service

%description
The BIRD project aims to develop a fully functional dynamic IP routing daemon
primarily targeted on (but not limited to) Linux, FreeBSD and other UNIX-like
systems and distributed under the GNU General Public License.

What do we support:
  * Both IPv4 and IPv6
  * Multiple routing tables
  * BGP
  * RIP
  * OSPF
  * BFD
  * Babel
  * Static routes
  * IPv6 Router Advertisements
  * Inter-table protocol
  * Command-line interface (using the `birdc' client; to get some help, just
    press `?')
  * Powerful language for route filtering

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}

%build
%configure \
 --enable-debug \
 CFLAGS="%{optflags} -fno-strict-aliasing %{?gcc_lto}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,now -Wl,-z,relro %{?gcc_lto}"
%{__make} %{?_smp_mflags}

%install
%{__make} install DESTDIR=%{buildroot}
%{__install} -D -m644 %{S:12} %{buildroot}%{_unitdir}/bird.service

%files
%defattr(-,root,root)
%doc NEWS README doc/bird.conf.example*
%config %{_sysconfdir}/bird.conf
%{_unitdir}/bird.service
%{_sbindir}/*

%if 0%{?suse_version}

%pre
%{service_add_pre %{name}.service}

%post
%{service_add_post %{name}.service}

%preun
%{service_del_preun %{name}.service}

%postun
%{service_del_postun %{name}.service}

%endif

%changelog
openSUSE Build Service is sponsored by