[quagga] spec: cleanup a little bit
Michal Sekletar
msekleta at fedoraproject.org
Tue May 14 12:50:16 UTC 2013
commit 06add1b05435e42a6147bd62fb3e21c82543356a
Author: Michal Sekletar <msekleta at redhat.com>
Date: Fri Apr 19 16:54:31 2013 +0200
spec: cleanup a little bit
quagga.spec | 230 +++++++++++++++++++++++++++++------------------------------
1 files changed, 112 insertions(+), 118 deletions(-)
---
diff --git a/quagga.spec b/quagga.spec
index 5c096d4..89ddc5d 100644
--- a/quagga.spec
+++ b/quagga.spec
@@ -1,33 +1,33 @@
# configure options
-%define with_snmp 1
-%define with_vtysh 1
-%define with_ospf_te 1
-%define with_opaque_lsa 1
-%define with_tcp_zebra 0
-%define with_pam 0
-%define with_ipv6 1
-%define with_isisd 1
-%define with_ospfclient 1
-%define with_ospfapi 1
-%define with_rtadv 1
-%define with_multipath 64
-%define quagga_uid 92
-%define quagga_gid 92
-%define quagga_user quagga
-%define vty_group quaggavt
-%define vty_gid 85
+%define with_snmp 1
+%define with_vtysh 1
+%define with_ospf_te 1
+%define with_opaque_lsa 1
+%define with_tcp_zebra 0
+%define with_pam 0
+%define with_ipv6 1
+%define with_isisd 1
+%define with_ospfclient 1
+%define with_ospfapi 1
+%define with_rtadv 1
+%define with_multipath 64
+%define quagga_uid 92
+%define quagga_gid 92
+%define quagga_user quagga
+%define vty_group quaggavt
+%define vty_gid 85
# path defines
-%define _sysconfdir /etc/quagga
-%define zeb_src %{_builddir}/%{name}-%{version}
-%define zeb_rh_src %{zeb_src}/redhat
-%define zeb_docs %{zeb_src}/doc
+%define _sysconfdir /etc/quagga
+%define zeb_src %{_builddir}/%{name}-%{version}
+%define zeb_rh_src %{zeb_src}/redhat
+%define zeb_docs %{zeb_src}/doc
# defines for configure
-%define _libexecdir %{_exec_prefix}/libexec/quagga
-%define _includedir %{_prefix}/include
-%define _libdir %{_exec_prefix}/%{_lib}/quagga
-%define _localstatedir /var/run/quagga
+%define _libexecdir %{_exec_prefix}/libexec/quagga
+%define _includedir %{_prefix}/include
+%define _libdir %{_exec_prefix}/%{_lib}/quagga
+%define _localstatedir /var/run/quagga
Summary: Routing daemon
Name: quagga
@@ -39,16 +39,16 @@ Source0: http://www.quagga.net/download/%{name}-%{version}.tar.xz
Source1: quagga-filter-perl-requires.sh
Source2: quagga-tmpfs.conf
-URL: http://www.quagga.net
+URL: http://www.quagga.net
%if %with_snmp
-BuildRequires: net-snmp-devel
-Requires: net-snmp
+BuildRequires: net-snmp-devel
+Requires: net-snmp
%endif
%if %with_vtysh
-BuildRequires: readline readline-devel ncurses ncurses-devel
-Requires: ncurses
+BuildRequires: readline readline-devel ncurses ncurses-devel
+Requires: ncurses
%endif
-BuildRequires: texinfo tetex libcap-devel texi2html
+BuildRequires: texinfo tetex libcap-devel texi2html
%if %with_pam
BuildRequires: pam-devel
@@ -58,8 +58,8 @@ Requires: pam
%define __perl_requires %{SOURCE1}
# Initscripts > 5.60 is required for IPv6 support
-Requires: initscripts >= 5.60
-Requires: ncurses
+Requires: initscripts >= 5.60
+Requires: ncurses
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(post): /sbin/install-info
@@ -67,10 +67,9 @@ Requires(postun): /sbin/install-info
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
-Provides: routingdaemon = %{version}-%{release}
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Provides: routingdaemon = %{version}-%{release}
-Patch0: 0001-Fix-typo-in-doc-ipv6.texi.patch
+Patch0: 0001-Fix-typo-in-doc-ipv6.texi.patch
%description
Quagga is free software that operates TCP/IP-based routing protocols. It takes
@@ -124,53 +123,53 @@ export CXXFLAGS="$RPM_OPT_FLAGS $CPPFLAGS -fno-strict-aliasing"
%configure \
%if %with_ipv6
- --enable-ipv6=yes \
+ --enable-ipv6=yes \
%else
- --enable-ipv6=no \
+ --enable-ipv6=no \
%endif
%if %with_isisd
- --enable-isisd=yes \
+ --enable-isisd=yes \
%endif
%if %with_snmp
- --enable-snmp=agentx \
+ --enable-snmp=agentx \
%endif
%if %with_multipath
- --enable-multipath=%with_multipath \
+ --enable-multipath=%with_multipath \
%endif
%if %with_tcp_zebra
- --enable-tcp-zebra \
+ --enable-tcp-zebra \
%endif
%if %with_opaque_lsa
- --enable-opaque-lsa \
+ --enable-opaque-lsa \
%endif
%if %with_ospf_te
- --enable-ospf-te \
+ --enable-ospf-te \
%endif
%if %with_vtysh
- --enable-vtysh=yes \
+ --enable-vtysh=yes \
%endif
-%if %with_ospfclient
- --enable-ospfclient=yes \
+%if %with_ospfclient
+ --enable-ospfclient=yes \
%else
- --enable-ospfclient=no\
+ --enable-ospfclient=no\
%endif
%if %with_ospfapi
- --enable-ospfapi=yes \
+ --enable-ospfapi=yes \
%else
- --enable-ospfapi=no \
+ --enable-ospfapi=no \
%endif
%if %with_pam
- --with-libpam \
+ --with-libpam \
%endif
%if %quagga_user
- --enable-user=%quagga_user \
- --enable-group=%quagga_user \
+ --enable-user=%quagga_user \
+ --enable-group=%quagga_user \
%endif
%if %vty_group
- --enable-vty-group=%vty_group \
+ --enable-vty-group=%vty_group \
%endif
%if %with_rtadv
- --enable-rtadv \
+ --enable-rtadv \
%endif
--disable-exampledir \
--enable-netlink
@@ -182,10 +181,8 @@ texi2html quagga.texi
popd
%install
-rm -rf $RPM_BUILD_ROOT
-
install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d} \
- $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
+ $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
mkdir -p $RPM_BUILD_ROOT/lib/systemd/system
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}
@@ -194,7 +191,7 @@ install -d $RPM_BUILD_ROOT/etc/pam.d
%endif
make install \
- DESTDIR=$RPM_BUILD_ROOT
+ DESTDIR=$RPM_BUILD_ROOT
# Remove this file, as it is uninstalled and causes errors when building on RH9
rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
@@ -259,25 +256,25 @@ if getent passwd %quagga_user >/dev/null 2>&1 ; then : ; else \
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ -f %{_infodir}/%{name}.inf* ]; then
- /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
+ /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
fi
# Create dummy files if they don't exist so basic functions can be used.
if [ ! -e %{_sysconfdir}/zebra.conf ]; then
- echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
+ echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
%if %quagga_user
- chown %quagga_user:%quagga_user %{_sysconfdir}/zebra.conf
+ chown %quagga_user:%quagga_user %{_sysconfdir}/zebra.conf
%endif
- chmod 640 %{_sysconfdir}/zebra.conf
+ chmod 640 %{_sysconfdir}/zebra.conf
fi
if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
- touch %{_sysconfdir}/vtysh.conf
- chmod 640 %{_sysconfdir}/vtysh.conf
+ touch %{_sysconfdir}/vtysh.conf
+ chmod 640 %{_sysconfdir}/vtysh.conf
%if %quagga_user
%if %vty_group
- chown %{quagga_user}:%{vty_group} %{_sysconfdir}/vtysh.conf
+ chown %{quagga_user}:%{vty_group} %{_sysconfdir}/vtysh.conf
%else
- chown %{quagga_user}:%{quagga_user} %{_sysconfdir}/vtysh.conf
+ chown %{quagga_user}:%{quagga_user} %{_sysconfdir}/vtysh.conf
%endif
%endif
fi
@@ -285,84 +282,81 @@ fi
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ -f %{_infodir}/%{name}.inf* ]; then
- /sbin/install-info --delete %{_infodir}/quagga.info %{_infodir}/dir || :
+ /sbin/install-info --delete %{_infodir}/quagga.info %{_infodir}/dir || :
fi
%preun
if [ "$1" = "0" ]; then
- /bin/systemctl disable ripd.service > /dev/null 2>&1 || :
- /bin/systemctl stop ripd.service > /dev/null 2>&1 || :
- /bin/systemctl disable bgpd.service > /dev/null 2>&1 || :
- /bin/systemctl stop bgpd.service > /dev/null 2>&1 || :
- /bin/systemctl disable zebra.service > /dev/null 2>&1 || :
- /bin/systemctl stop zebra.service > /dev/null 2>&1 || :
+ /bin/systemctl disable ripd.service > /dev/null 2>&1 || :
+ /bin/systemctl stop ripd.service > /dev/null 2>&1 || :
+ /bin/systemctl disable bgpd.service > /dev/null 2>&1 || :
+ /bin/systemctl stop bgpd.service > /dev/null 2>&1 || :
+ /bin/systemctl disable zebra.service > /dev/null 2>&1 || :
+ /bin/systemctl stop zebra.service > /dev/null 2>&1 || :
%if %with_isisd
- /bin/systemctl disable isisd.service > /dev/null 2>&1 || :
- /bin/systemctl stop isisd.service > /dev/null 2>&1 || :
+ /bin/systemctl disable isisd.service > /dev/null 2>&1 || :
+ /bin/systemctl stop isisd.service > /dev/null 2>&1 || :
%endif
- /bin/systemctl disable ospfd.service > /dev/null 2>&1 || :
- /bin/systemctl stop ospfd.service > /dev/null 2>&1 || :
- /bin/systemctl disable babeld.service > /dev/null 2>&1 || :
- /bin/systemctl stop babeld.service > /dev/null 2>&1 || :
+ /bin/systemctl disable ospfd.service > /dev/null 2>&1 || :
+ /bin/systemctl stop ospfd.service > /dev/null 2>&1 || :
+ /bin/systemctl disable babeld.service > /dev/null 2>&1 || :
+ /bin/systemctl stop babeld.service > /dev/null 2>&1 || :
%if %with_ipv6
- /bin/systemctl disable ospf6d.service > /dev/null 2>&1 || :
- /bin/systemctl stop ospf6d.service > /dev/null 2>&1 || :
- /bin/systemctl disable ripngd.service > /dev/null 2>&1 || :
- /bin/systemctl stop ripngd.service > /dev/null 2>&1 || :
+ /bin/systemctl disable ospf6d.service > /dev/null 2>&1 || :
+ /bin/systemctl stop ospf6d.service > /dev/null 2>&1 || :
+ /bin/systemctl disable ripngd.service > /dev/null 2>&1 || :
+ /bin/systemctl stop ripngd.service > /dev/null 2>&1 || :
%endif
fi
%triggerun -- %{name} < 0.99.21-1
- /bin/systemctl disable watchquagga.service > /dev/null 2>&1 || :
- /bin/systemctl stop watchquagga.service > /dev/null 2>&1 || :
+ /bin/systemctl disable watchquagga.service > /dev/null 2>&1 || :
+ /bin/systemctl stop watchquagga.service > /dev/null 2>&1 || :
%triggerun -- %{name} < 0.99.18-6
- /sbin/service watchquagga stop >/dev/null 2>&1 || :
- /sbin/chkconfig --del zebra >/dev/null 2>&1 || :
+ /sbin/service watchquagga stop >/dev/null 2>&1 || :
+ /sbin/chkconfig --del zebra >/dev/null 2>&1 || :
%if !%with_isisd
- /sbin/service isisd stop >/dev/null 2>&1 || :
+ /sbin/service isisd stop >/dev/null 2>&1 || :
%endif
- /sbin/chkconfig --del isisd >/dev/null 2>&1 || :
- /sbin/chkconfig --del ripd >/dev/null 2>&1 || :
- /sbin/chkconfig --del bgpd >/dev/null 2>&1 || :
- /sbin/chkconfig --del ospfd >/dev/null 2>&1 || :
- /sbin/chkconfig --del watchquagga >/dev/null 2>&1 || :
+ /sbin/chkconfig --del isisd >/dev/null 2>&1 || :
+ /sbin/chkconfig --del ripd >/dev/null 2>&1 || :
+ /sbin/chkconfig --del bgpd >/dev/null 2>&1 || :
+ /sbin/chkconfig --del ospfd >/dev/null 2>&1 || :
+ /sbin/chkconfig --del watchquagga >/dev/null 2>&1 || :
%if !%with_ipv6
- /sbin/service ospf6d stop >/dev/null 2>&1 || :
- /sbin/service ripngd stop >/dev/null 2>&1 || :
+ /sbin/service ospf6d stop >/dev/null 2>&1 || :
+ /sbin/service ripngd stop >/dev/null 2>&1 || :
%endif
- /sbin/chkconfig --del ospf6d >/dev/null 2>&1 || :
- /sbin/chkconfig --del ripngd >/dev/null 2>&1 || :
- /bin/systemctl try-restart zebra.service >/dev/null 2>&1 || :
+ /sbin/chkconfig --del ospf6d >/dev/null 2>&1 || :
+ /sbin/chkconfig --del ripngd >/dev/null 2>&1 || :
+ /bin/systemctl try-restart zebra.service >/dev/null 2>&1 || :
%if %with_isisd
- /bin/systemctl try-restart isisd.service >/dev/null 2>&1 || :
+ /bin/systemctl try-restart isisd.service >/dev/null 2>&1 || :
%endif
- /bin/systemctl try-restart ripd.service >/dev/null 2>&1 || :
- /bin/systemctl try-restart bgpd.service >/dev/null 2>&1 || :
- /bin/systemctl try-restart ospfd.service >/dev/null 2>&1 || :
+ /bin/systemctl try-restart ripd.service >/dev/null 2>&1 || :
+ /bin/systemctl try-restart bgpd.service >/dev/null 2>&1 || :
+ /bin/systemctl try-restart ospfd.service >/dev/null 2>&1 || :
%if %with_ipv6
- /bin/systemctl try-restart ospf6d.service >/dev/null 2>&1 || :
- /bin/systemctl try-restart ripngd.service >/dev/null 2>&1 || :
+ /bin/systemctl try-restart ospf6d.service >/dev/null 2>&1 || :
+ /bin/systemctl try-restart ripngd.service >/dev/null 2>&1 || :
%endif
%triggerpostun -n %{name}-sysvinit -- %{name} < 0.99.18-6
- /sbin/chkconfig --add zebra >/dev/null 2>&1 || :
+ /sbin/chkconfig --add zebra >/dev/null 2>&1 || :
%if %with_isisd
- /sbin/chkconfig --add isisd >/dev/null 2>&1 || :
+ /sbin/chkconfig --add isisd >/dev/null 2>&1 || :
%endif
- /sbin/chkconfig --add ripd >/dev/null 2>&1 || :
- /sbin/chkconfig --add bgpd >/dev/null 2>&1 || :
- /sbin/chkconfig --add ospfd >/dev/null 2>&1 || :
- /sbin/chkconfig --add watchquagga >/dev/null 2>&1 || :
+ /sbin/chkconfig --add ripd >/dev/null 2>&1 || :
+ /sbin/chkconfig --add bgpd >/dev/null 2>&1 || :
+ /sbin/chkconfig --add ospfd >/dev/null 2>&1 || :
+ /sbin/chkconfig --add watchquagga >/dev/null 2>&1 || :
%if %with_ipv6
- /sbin/chkconfig --add ospf6d >/dev/null 2>&1 || :
- /sbin/chkconfig --add ripngd >/dev/null 2>&1 || :
+ /sbin/chkconfig --add ospf6d >/dev/null 2>&1 || :
+ /sbin/chkconfig --add ripngd >/dev/null 2>&1 || :
%endif
-%clean
-rm -rf $RPM_BUILD_ROOT
-
%files
%defattr(-,root,root)
%doc AUTHORS COPYING
@@ -383,7 +377,7 @@ rm -rf $RPM_BUILD_ROOT
%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
%if %quagga_user
%dir %attr(750,%quagga_user,%quagga_user) %{_sysconfdir}
-%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
+%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
%dir %attr(750,%quagga_user,%quagga_user) /var/run/quagga
%else
%dir %attr(750,root,root) %{_sysconfdir}
@@ -405,7 +399,7 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) /etc/pam.d/quagga
%endif
%config(noreplace) %attr(640,root,root) /etc/logrotate.d/quagga
-%config(noreplace) /etc/sysconfig/quagga
+%config(noreplace) /etc/sysconfig/quagga
%config(noreplace) /etc/tmpfiles.d/quagga.conf
/lib/systemd/system/*.service
More information about the scm-commits
mailing list