Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 67a8cfef3524b970be77f592e506d973 > files > 4

bird-1.3.10-1.fc18.src.rpm

#unitdir is not defined in current rpm
%define         _unitdir /lib/systemd/system

Name:           bird
Version:        1.3.10
Release:       	1%{?dist}
Summary:        BIRD Internet Routing Daemon

Group:          System Environment/Daemons
License:        GPLv2+
URL:            http://bird.network.cz
Source0:        ftp://bird.network.cz/pub/bird/bird-%{version}.tar.gz
Source1:        bird.init
Source2:        bird.service
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  flex bison ncurses-devel readline-devel sed
Requires(post): systemd-units
Requires(preun):systemd-units
Requires(postun):   systemd-units

%description
BIRD is dynamic routing daemon supporting IPv4 and IPv6 versions of routing
protocols BGP, RIP and OSPF.

This package contains IPv4 version.


%package -n bird6
Summary:        BIRD Internet Routing Daemon
Group:          System Environment/Daemons
Requires(post): systemd-units
Requires(preun):systemd-units
Requires(postun):   systemd-units

%description -n bird6
BIRD is dynamic routing daemon supporting IPv4 and IPv6 versions of routing
protocols BGP, RIP and OSPF.

This package contains IPv6 version.


%package doc
Summary:        BIRD Internet Routing Daemon
Group:          System Environment/Daemons
%description doc
BIRD is dynamic routing daemon supporting IPv4 and IPv6 versions of routing
protocols BGP, RIP and OSPF.

This package contains documentation.

%package sysvinit
Summary: BIRD Internet Routing Daemon
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
Requires(preun): /sbin/service

%description sysvinit
The bird-sysvinit contains SysV initscripts for bird and bird6 packages.

%package -n bird6-sysvinit
Summary: BIRD Internet Routing Daemon
Group: System Environment/Daemons
Requires: %{name}6 = %{version}-%{release}
Requires(preun): /sbin/service

%description -n bird6-sysvinit
The bird-sysvinit contains SysV initscripts for bird and bird6 packages.

%prep
%setup -q

#Don't strip executables
sed -i 's/\$(INSTALL_PROGRAM) -s/\$(INSTALL_PROGRAM)/' tools/Makefile.in

%build
mkdir ipv6
tar c --exclude ipv6 . | tar x -C ipv6

cd ipv6
%configure --prefix=%{_prefix} \
           --sysconfdir=%{_sysconfdir} \
           --localstatedir=%{_localstatedir} \
           --enable-ipv6
make %{?_smp_mflags}
cd ..

%configure --prefix=%{_prefix} \
           --sysconfdir=%{_sysconfdir} \
           --localstatedir=%{_localstatedir}
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT

cd ipv6
make install DESTDIR=$RPM_BUILD_ROOT
cd ..

install -d $RPM_BUILD_ROOT%{_initddir}
sed 's/BIRD_PROGNAME/bird/' %SOURCE1 > $RPM_BUILD_ROOT%{_initddir}/bird
sed 's/BIRD_PROGNAME/bird6/' %SOURCE1 > $RPM_BUILD_ROOT%{_initddir}/bird6

install -d $RPM_BUILD_ROOT%{_unitdir}
sed 's/BIRD_PROGNAME/bird/' %SOURCE2 > $RPM_BUILD_ROOT%{_unitdir}/bird.service
sed 's/BIRD_PROGNAME/bird6/' %SOURCE2 > $RPM_BUILD_ROOT%{_unitdir}/bird6.service


%clean
rm -rf $RPM_BUILD_ROOT


%post
if [ $1 -eq 1 ]; then
  /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi


%preun
if [ $1 -eq 0 ] ; then
  /bin/systemctl --no-reload disable bird.service > /dev/null 2>&1 || :
  /bin/systemctl stop bird.service > /dev/null 2>&1 || :
fi


%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
  /bin/systemctl reload-or-try-restart bird.service >/dev/null 2>&1 || :
fi

%triggerun -- bird < 1.2.5-2
if /sbin/chkconfig --level 3 bird ; then
        /bin/systemctl enable bird.service >/dev/null 2>&1 || :
fi


%post -n bird6
if [ $1 -eq 1 ]; then
  /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi


%preun -n bird6
if [ $1 -eq 0 ] ; then
  /bin/systemctl --no-reload disable bird6.service > /dev/null 2>&1 || :
  /bin/systemctl stop bird6.service > /dev/null 2>&1 || :
fi


%postun -n bird6
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
  /bin/systemctl reload-or-try-restart bird6.service >/dev/null 2>&1 || :
fi

%triggerun -n bird6 -- bird6 < 1.2.5-2
if /sbin/chkconfig --level 3 bird6 ; then
        /bin/systemctl enable bird6.service >/dev/null 2>&1 || :
fi

%files
%defattr(-,root,root,-)
%doc NEWS README TODO
%config(noreplace) %{_sysconfdir}/bird.conf
%{_unitdir}/bird.service
%{_sbindir}/bird
%{_sbindir}/birdc
%{_sbindir}/birdcl

%files -n bird6
%defattr(-,root,root,-)
%doc NEWS README TODO
%config(noreplace) %{_sysconfdir}/bird6.conf
%{_unitdir}/bird6.service
%{_sbindir}/bird6
%{_sbindir}/birdc6
%{_sbindir}/birdcl6

%files doc
%defattr(-,root,root,-)
%doc NEWS README TODO
%doc doc/bird*.html

%files sysvinit
%attr(755,root,root) %{_initddir}/bird

%files -n bird6-sysvinit
%attr(755,root,root) %{_initddir}/bird6

%changelog
* Wed Jul 03 2013 Stanislav Kozina <stanislav.kozina@gmail.com> 1.3.10-1
- updated to latest upstream 1.3.10

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Wed Apr 04 2012 Stanislav Kozina <skozina@redhat.com> 1.3.7-1
- updated to latest upstream 1.3.7

* Wed Jan 11 2012 Jiri Skala <jskala@redhat.com> 1.3.5-1
- updated to latest upstream 1.3.5

* Wed Nov 23 2011 Jiri Skala <jskala@redhat.com> 1.3.4-2
- initscripts moved to subpackage

* Mon Oct 10 2011 Jiri Skala <jskala@redhat.com> 1.3.4-1
- updated to latest upstream 1.3.4

* Mon Sep 12 2011 Jiri Skala <jskala@redhat.com> 1.3.3-1
- updated to latest upstream 1.3.3

* Mon Jul 11 2011 Jiri Skala <jskala@redhat.com> 1.3.2-1
- updated to latest upstream 1.3.2

* Wed May 11 2011 Bill Nottingham <notting@redhat.com>  1.3.1-2
- fix systemd scriptlets for upgrade (#703234)

* Wed May 04 2011 Jan Görig <jgorig@redhat.com> 1.3.1-1
- New upstream bugfix release

* Thu Mar 31 2011 Jan Görig <jgorig@redhat.com> 1.3.0-1
- New upstream release - iBGP improved, IPv6 RA added, many changes and bufixes
- Updated systemd unit files configuration

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Nov 11 2010 Jan Görig <jgorig@redhat.com> 1.2.5-2
- Move from SysVInit to systemd

* Mon Oct 11 2010 Jan Görig <jgorig@redhat.com> 1.2.5-1
- New upstream release

* Tue Oct 5 2010 Jan Görig <jgorig@redhat.com> 1.2.4-1
- Initial release