summaryrefslogtreecommitdiff
path: root/redhat/quagga.spec.in
diff options
context:
space:
mode:
authorpaul <paul>2003-12-30 11:16:21 +0000
committerpaul <paul>2003-12-30 11:16:21 +0000
commit15d74e93405f0f9bb9e399163b8e53bb589699d6 (patch)
treee8a191b889d087eac50c6d33d72b182299a807a2 /redhat/quagga.spec.in
parent41ad87809198dfb2cfc769d77592afaf41a2f8f0 (diff)
2003-12-30 Paul Jakma <paul@dishone.st>
* redhat/isisd.init: new file, init script for isisd. redhat/quagga.sysconfig: new file, sysconfig file for quagga initscripts. redhat/quagga.spec.in: various cleanups, including sysconfig patch from RH, fixed UID/GID as per RH EL, shell changed to /sbin/nologin, daemon vty's listen to 127.1 only per default and isisd packaged. redhat/*.init: sysconfig support and runlevels specified.
Diffstat (limited to 'redhat/quagga.spec.in')
-rw-r--r--redhat/quagga.spec.in99
1 files changed, 53 insertions, 46 deletions
diff --git a/redhat/quagga.spec.in b/redhat/quagga.spec.in
index 5308cc4e..2512d313 100644
--- a/redhat/quagga.spec.in
+++ b/redhat/quagga.spec.in
@@ -22,10 +22,19 @@
# defines for configure
%define _libexecdir %{_exec_prefix}/libexec/quagga
-%define _includedir %{_prefix}/include/quagga
%define _libdir %{_exec_prefix}/%{_lib}/quagga
+%define _includedir %{_prefix}/include
%define _localstatedir /var/run/quagga
+# misc internal defines
+%define quagga_uid 92
+%define quagga_gid 92
+%if %with_ipv6
+%define daemon_list zebra ripd isisd ospfd ripngd ospf6d bgpd
+%else
+%define daemon_list zebra ripd isisd ospfd bgpd
+%endif
+
Summary: Routing daemon
Name: quagga
Version: @VERSION@
@@ -35,14 +44,14 @@ Group: System Environment/Daemons
Source0: http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz
URL: http://www.quagga.net
%if %with_snmp
-#BuildRequires: ucd-snmp-devel
+BuildRequires: ucd-snmp-devel
Prereq: ucd-snmp
%endif
%if %with_vtysh
BuildRequires: readline readline-devel ncurses ncurses-devel
Prereq: readline ncurses
%endif
-BuildRequires: texinfo tetex autoconf pam-devel patch
+BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel
# Initscripts > 5.60 is required for IPv6 support
Prereq: initscripts >= 5.60
Prereq: ncurses readline pam
@@ -148,16 +157,17 @@ make install \
# Remove this file, as it is uninstalled and causes errors when building on RH9
rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
-install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
-install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
-%if %with_ipv6
-install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
-install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
-%endif
-install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
-install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
-install -m644 %{zeb_rh_src}/quagga.pam $RPM_BUILD_ROOT/etc/pam.d/quagga
-install -m644 %{zeb_rh_src}/quagga.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/quagga
+# install etc sources
+for daemon in %daemon_list ; do
+ install %{zeb_rh_src}/${daemon}.init \
+ $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon}
+done
+install -m644 %{zeb_rh_src}/quagga.pam \
+ $RPM_BUILD_ROOT/etc/pam.d/quagga
+install -m644 %{zeb_rh_src}/quagga.logrotate \
+ $RPM_BUILD_ROOT/etc/logrotate.d/quagga
+install -m644 %{zeb_rh_src}/quagga.sysconfig \
+ $RPM_BUILD_ROOT/etc/sysconfig/quagga
install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
%pre
@@ -167,7 +177,9 @@ groupadd -r %vty_group 2> /dev/null || :
%endif
# add quagga user and group
%if %quagga_user
-/usr/sbin/useradd -M -r -s /bin/false -c "Quagga routing suite" \
+/usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || :
+/usr/sbin/useradd -u %quagga_uid -g %quagga_gid \
+ -M -r -s /sbin/nologin -c "Quagga routing suite" \
-d %_localstatedir %quagga_user 2> /dev/null || :
%endif
@@ -199,14 +211,9 @@ zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
%endif
zebra_spec_add_service isisd 2608/tcp "ISISd vty"
-/sbin/chkconfig --add zebra
-/sbin/chkconfig --add ripd
-%if %with_ipv6
-/sbin/chkconfig --add ripngd
-/sbin/chkconfig --add ospf6d
-%endif
-/sbin/chkconfig --add ospfd
-/sbin/chkconfig --add bgpd
+for daemon in %daemon_list ; do
+ /sbin/chkconfig --add ${daemon}
+done
/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
@@ -222,31 +229,18 @@ fi
%postun
if [ "$1" -ge "1" ]; then
- /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
- /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
-%if %with_ipv6
- /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
-%endif
- /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
-%if %with_ipv6
- /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
-%endif
- /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
+ for daemon in %daemon_list ; do
+ /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1
+ done
fi
-/sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
%preun
if [ "$1" = "0" ]; then
- /sbin/chkconfig --del zebra
- /sbin/chkconfig --del ripd
-%if %with_ipv6
- /sbin/chkconfig --del ripngd
-%endif
- /sbin/chkconfig --del ospfd
-%if %with_ipv6
- /sbin/chkconfig --del ospf6d
-%endif
- /sbin/chkconfig --del bgpd
+ for daemon in %daemon_list ; do
+ /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1
+ /sbin/chkconfig --del ${daemon}
+ done
+ /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
fi
%clean
@@ -279,6 +273,7 @@ fi
%endif
%config /etc/quagga/[!v]*
%config /etc/rc.d/init.d/*
+%config(noreplace) /etc/sysconfig/quagga
%config(noreplace) /etc/pam.d/quagga
%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
@@ -289,13 +284,25 @@ fi
%files devel
%defattr(-,root,root)
%dir %{_libdir}/*
-%dir %{_includedir}/*.h
-%dir %{_includedir}/ospfd/*
+%dir %{_includedir}/%name/*.h
+%dir %{_includedir}/%name/ospfd/*.h
%if %with_ospfapi
-%dir %{_includedir}/ospfapi/*
+%dir %{_includedir}/%name/ospfapi/*.h
%endif
%changelog
+%changelog
+* Tue Dec 30 2003 Paul Jakma <paul@dishone.st>
+- sync to CVS
+- integrate RH sysconfig patch to specify daemon options (RH)
+- default to have vty listen only to 127.1 (RH)
+- add user with fixed UID/GID (RH)
+- create user with shell /sbin/nologin rather than /bin/false (RH)
+- stop daemons on uninstall (RH)
+- delete info file on %preun, not %postun to avoid deletion on upgrade. (RH)
+- isisd added
+- cleanup tasks carried out for every daemon
+
* Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
- Fix -devel package to include all files
- Sync to 0.96.4