paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 1 | # configure options |
paul | b64d92a | 2005-04-25 15:13:42 +0000 | [diff] [blame] | 2 | # |
| 3 | # Some can be overriden on rpmbuild commandline with: |
| 4 | # rpmbuild --define 'variable value' |
| 5 | # |
| 6 | |
| 7 | %{!?with_snmp: %define with_snmp 1 } |
| 8 | %{!?with_vtysh: %define with_vtysh 1 } |
| 9 | %{!?with_ospf_te: %define with_ospf_te 1 } |
| 10 | %{!?with_nssa: %define with_nssa 1 } |
| 11 | %{!?with_opaque_lsa: %define with_opaque_lsa 1 } |
| 12 | %{!?with_tcp_zebra: %define with_tcp_zebra 0 } |
| 13 | %{!?with_vtysh: %define with_vtysh 1 } |
| 14 | %{!?with_pam: %define with_pam 1 } |
| 15 | %{!?with_ipv6: %define with_ipv6 1 } |
| 16 | %{!?with_ospfclient: %define with_ospfclient 1 } |
| 17 | %{!?with_ospfapi: %define with_ospfapi 1 } |
| 18 | %{!?with_irdp: %define with_irdp 1 } |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 19 | %{!?with_rtadv: %define with_rtadv 1 } |
paul | 9edbc8f | 2005-04-26 02:23:44 +0000 | [diff] [blame] | 20 | %{!?with_isisd: %define with_isisd 1 } |
paul | b64d92a | 2005-04-25 15:13:42 +0000 | [diff] [blame] | 21 | %{!?with_shared: %define with_shared 1 } |
| 22 | %{!?with_multipath: %define with_multipath 64 } |
| 23 | %{!?quagga_user: %define quagga_user quagga } |
| 24 | %{!?vty_group: %define vty_group quaggavty } |
paul | 30b9d89 | 2003-01-18 22:57:15 +0000 | [diff] [blame] | 25 | |
| 26 | # path defines |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 27 | %define _sysconfdir /etc/quagga |
paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 28 | %define zeb_src %{_builddir}/%{name}-%{version} |
| 29 | %define zeb_rh_src %{zeb_src}/redhat |
| 30 | %define zeb_docs %{zeb_src}/doc |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 31 | |
paul | e062685 | 2003-03-18 14:11:36 +0000 | [diff] [blame] | 32 | # defines for configure |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 33 | %define _libexecdir %{_exec_prefix}/libexec/quagga |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 34 | %define _libdir %{_exec_prefix}/%{_lib}/quagga |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 35 | %define _includedir %{_prefix}/include |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 36 | %define _localstatedir /var/run/quagga |
paul | e062685 | 2003-03-18 14:11:36 +0000 | [diff] [blame] | 37 | |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 38 | # misc internal defines |
paul | b64d92a | 2005-04-25 15:13:42 +0000 | [diff] [blame] | 39 | %{!?quagga_uid: %define quagga_uid 92 } |
| 40 | %{!?quagga_gid: %define quagga_gid 92 } |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 41 | %define daemon_list zebra ripd ospfd bgpd |
paul | 0df63b5 | 2004-11-07 22:12:23 +0000 | [diff] [blame] | 42 | |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 43 | %if %{with_ipv6} |
ajs | f393175 | 2004-12-23 00:00:58 +0000 | [diff] [blame] | 44 | %define daemonv6_list ripngd ospf6d |
paul | 0df63b5 | 2004-11-07 22:12:23 +0000 | [diff] [blame] | 45 | %else |
| 46 | %define daemonv6_list "" |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 47 | %endif |
paul | 0df63b5 | 2004-11-07 22:12:23 +0000 | [diff] [blame] | 48 | |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 49 | %if %{with_isisd} |
paul | 69f5d26 | 2004-10-07 16:23:36 +0000 | [diff] [blame] | 50 | %define daemon_other isisd |
| 51 | %else |
| 52 | %define daemon_other "" |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 53 | %endif |
| 54 | |
ajs | b3324e2 | 2004-12-22 17:52:29 +0000 | [diff] [blame] | 55 | %define all_daemons %{daemon_list} %{daemonv6_list} %{daemon_other} watchquagga |
| 56 | |
paul | b5f310c | 2004-09-13 13:15:25 +0000 | [diff] [blame] | 57 | # allow build dir to be kept |
paul | b64d92a | 2005-04-25 15:13:42 +0000 | [diff] [blame] | 58 | %{!?keep_build: %define keep_build 0 } |
paul | b5f310c | 2004-09-13 13:15:25 +0000 | [diff] [blame] | 59 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 60 | Summary: Routing daemon |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 61 | Name: quagga |
paul | 6382b6f | 2003-05-20 00:17:45 +0000 | [diff] [blame] | 62 | Version: @VERSION@ |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 63 | Release: @CONFDATE@01 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 64 | License: GPL |
| 65 | Group: System Environment/Daemons |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 66 | Source0: http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz |
| 67 | URL: http://www.quagga.net |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 68 | %if %{with_snmp} |
paul | b63cef7 | 2004-08-19 03:36:13 +0000 | [diff] [blame] | 69 | BuildRequires: net-snmp-devel |
| 70 | Prereq: net-snmp |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 71 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 72 | %if %{with_vtysh} |
paul | 30b9d89 | 2003-01-18 22:57:15 +0000 | [diff] [blame] | 73 | BuildRequires: readline readline-devel ncurses ncurses-devel |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 74 | Prereq: ncurses |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 75 | %endif |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 76 | BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel texi2html |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 77 | # Initscripts > 5.60 is required for IPv6 support |
paul | 30b9d89 | 2003-01-18 22:57:15 +0000 | [diff] [blame] | 78 | Prereq: initscripts >= 5.60 |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 79 | Prereq: ncurses pam |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 80 | Prereq: /sbin/install-info |
| 81 | Provides: routingdaemon |
| 82 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 83 | Obsoletes: bird gated mrt zebra |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 84 | |
| 85 | %description |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 86 | Quagga is a free software that manages TCP/IP based routing |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 87 | protocol. It takes multi-server and multi-thread approach to resolve |
| 88 | the current complexity of the Internet. |
| 89 | |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 90 | Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng. |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 91 | |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 92 | Quagga is intended to be used as a Route Server and a Route Reflector. It is |
| 93 | not a toolkit, it provides full routing power under a new architecture. |
| 94 | Quagga by design has a process for each protocol. |
| 95 | |
| 96 | Quagga is a fork of GNU Zebra. |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 97 | |
paul | 448ed4a | 2003-03-01 15:43:28 +0000 | [diff] [blame] | 98 | %package contrib |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 99 | Summary: contrib tools for quagga |
paul | 448ed4a | 2003-03-01 15:43:28 +0000 | [diff] [blame] | 100 | Group: System Environment/Daemons |
| 101 | |
| 102 | %description contrib |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 103 | Contributed/3rd party tools which may be of use with quagga. |
paul | 448ed4a | 2003-03-01 15:43:28 +0000 | [diff] [blame] | 104 | |
paul | e062685 | 2003-03-18 14:11:36 +0000 | [diff] [blame] | 105 | %package devel |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 106 | Summary: Header and object files for quagga development |
paul | e062685 | 2003-03-18 14:11:36 +0000 | [diff] [blame] | 107 | Group: System Environment/Daemons |
| 108 | |
| 109 | %description devel |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 110 | The quagga-devel package contains the header and object files neccessary for |
| 111 | developing OSPF-API and quagga applications. |
paul | e062685 | 2003-03-18 14:11:36 +0000 | [diff] [blame] | 112 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 113 | %prep |
| 114 | %setup -q |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 115 | |
| 116 | %build |
ajs | 7966b97 | 2004-11-10 22:02:05 +0000 | [diff] [blame] | 117 | |
| 118 | # For standard gcc verbosity, uncomment these lines: |
| 119 | #CFLAGS="%{optflags} -Wall -Wsign-compare -Wpointer-arith" |
| 120 | #CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings" |
| 121 | |
| 122 | # For ultra gcc verbosity, uncomment these lines also: |
| 123 | #CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes" |
| 124 | #CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn" |
| 125 | #CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code" |
| 126 | #CFLAGS="${CFLAGS} -Wpacked -Wpadded" |
| 127 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 128 | %configure \ |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 129 | %if !%{with_shared} |
| 130 | --disable-shared \ |
| 131 | %endif |
| 132 | %if %{with_ipv6} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 133 | --enable-ipv6 \ |
| 134 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 135 | %if %{with_snmp} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 136 | --enable-snmp \ |
| 137 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 138 | %if %{with_multipath} |
| 139 | --enable-multipath=%{with_multipath} \ |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 140 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 141 | %if %{with_tcp_zebra} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 142 | --enable-tcp-zebra \ |
| 143 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 144 | %if %{with_nssa} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 145 | --enable-nssa \ |
| 146 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 147 | %if %{with_opaque_lsa} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 148 | --enable-opaque-lsa \ |
| 149 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 150 | %if %{with_ospf_te} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 151 | --enable-ospf-te \ |
| 152 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 153 | %if %{with_vtysh} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 154 | --enable-vtysh \ |
| 155 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 156 | %if %{with_ospfclient} |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 157 | --enable-ospfclient=yes \ |
| 158 | %else |
| 159 | --enable-ospfclient=no\ |
| 160 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 161 | %if %{with_ospfapi} |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 162 | --enable-ospfapi=yes \ |
| 163 | %else |
| 164 | --enable-ospfapi=no \ |
| 165 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 166 | %if %{with_irdp} |
paul | 5b81926 | 2004-07-28 14:11:55 +0000 | [diff] [blame] | 167 | --enable-irdp=yes \ |
| 168 | %else |
| 169 | --enable-irdp=no \ |
| 170 | %endif |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 171 | %if %{with_rtadv} |
| 172 | --enable-rtadv=yes \ |
| 173 | %else |
| 174 | --enable-rtadv=no \ |
| 175 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 176 | %if %{with_isisd} |
| 177 | --enable-isisd \ |
| 178 | %else |
paul | 69f5d26 | 2004-10-07 16:23:36 +0000 | [diff] [blame] | 179 | --disable-isisd \ |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 180 | %endif |
| 181 | %if %{with_pam} |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 182 | --with-libpam \ |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 183 | %endif |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 184 | %if %quagga_user |
| 185 | --enable-user=%quagga_user \ |
| 186 | --enable-group=%quagga_user \ |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 187 | %endif |
| 188 | %if %vty_group |
| 189 | --enable-vty-group=%vty_group \ |
| 190 | %endif |
ajs | fc43ecc | 2005-01-12 16:41:33 +0000 | [diff] [blame] | 191 | --enable-netlink --enable-gcc-rdynamic |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 192 | |
| 193 | make %{?_smp_mflags} MAKEINFO="makeinfo --no-split" |
| 194 | |
| 195 | pushd doc |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 196 | texi2html -glossary -number quagga.texi |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 197 | popd |
| 198 | |
| 199 | %install |
| 200 | rm -rf $RPM_BUILD_ROOT |
| 201 | |
| 202 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \ |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 203 | $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 204 | |
| 205 | make install \ |
| 206 | DESTDIR=$RPM_BUILD_ROOT |
| 207 | |
paul | 9a344b7 | 2003-08-05 23:24:58 +0000 | [diff] [blame] | 208 | # Remove this file, as it is uninstalled and causes errors when building on RH9 |
| 209 | rm -rf $RPM_BUILD_ROOT/usr/share/info/dir |
| 210 | |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 211 | # install etc sources |
ajs | b3324e2 | 2004-12-22 17:52:29 +0000 | [diff] [blame] | 212 | for daemon in %{all_daemons} ; do |
paul | da29c6b | 2004-10-08 00:49:09 +0000 | [diff] [blame] | 213 | if [ x"${daemon}" != x"" ] ; then |
| 214 | install %{zeb_rh_src}/${daemon}.init \ |
| 215 | $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon} |
| 216 | fi |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 217 | done |
| 218 | install -m644 %{zeb_rh_src}/quagga.pam \ |
| 219 | $RPM_BUILD_ROOT/etc/pam.d/quagga |
| 220 | install -m644 %{zeb_rh_src}/quagga.logrotate \ |
| 221 | $RPM_BUILD_ROOT/etc/logrotate.d/quagga |
| 222 | install -m644 %{zeb_rh_src}/quagga.sysconfig \ |
| 223 | $RPM_BUILD_ROOT/etc/sysconfig/quagga |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 224 | install -d -m750 $RPM_BUILD_ROOT/var/run/quagga |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 225 | |
| 226 | %pre |
| 227 | # add vty_group |
| 228 | %if %vty_group |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 229 | if getent group %vty_group > /dev/null ; then : ; else \ |
| 230 | /usr/sbin/groupadd -r %vty_group > /dev/null || : ; fi |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 231 | %endif |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 232 | |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 233 | # add quagga user and group |
| 234 | %if %quagga_user |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 235 | # Ensure that quagga_gid gets correctly allocated |
| 236 | if getent group %quagga_user >/dev/null; then : ; else \ |
| 237 | /usr/sbin/groupadd -g %quagga_gid %quagga_user > /dev/null || : ; \ |
| 238 | fi |
| 239 | if getent passwd %quagga_user >/dev/null ; then : ; else \ |
| 240 | /usr/sbin/useradd -u %quagga_uid -g %quagga_gid \ |
| 241 | -M -r -s /sbin/nologin -c "Quagga routing suite" \ |
| 242 | -d %_localstatedir %quagga_user 2> /dev/null || : ; \ |
| 243 | fi |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 244 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 245 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 246 | %post |
paul | 30b9d89 | 2003-01-18 22:57:15 +0000 | [diff] [blame] | 247 | # zebra_spec_add_service <service name> <port/proto> <comment> |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 248 | # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service" |
| 249 | |
| 250 | zebra_spec_add_service () |
| 251 | { |
| 252 | # Add port /etc/services entry if it isn't already there |
paul | 6b637e9 | 2004-10-23 00:48:51 +0000 | [diff] [blame] | 253 | if [ -f /etc/services ] && \ |
| 254 | ! %__sed -e 's/#.*$//' /etc/services | %__grep -wq $1 ; then |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 255 | echo "$1 $2 # $3" >> /etc/services |
| 256 | fi |
| 257 | } |
| 258 | |
| 259 | zebra_spec_add_service zebrasrv 2600/tcp "zebra service" |
| 260 | zebra_spec_add_service zebra 2601/tcp "zebra vty" |
| 261 | zebra_spec_add_service ripd 2602/tcp "RIPd vty" |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 262 | %if %{with_ipv6} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 263 | zebra_spec_add_service ripngd 2603/tcp "RIPngd vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 264 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 265 | zebra_spec_add_service ospfd 2604/tcp "OSPFd vty" |
| 266 | zebra_spec_add_service bgpd 2605/tcp "BGPd vty" |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 267 | %if %{with_ipv6} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 268 | zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 269 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 270 | %if %{with_ospfapi} |
paul | 7021c42 | 2003-07-15 12:52:22 +0000 | [diff] [blame] | 271 | zebra_spec_add_service ospfapi 2607/tcp "OSPF-API" |
| 272 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 273 | %if %{with_isisd} |
jardin | 5a514b1 | 2003-12-23 10:50:21 +0000 | [diff] [blame] | 274 | zebra_spec_add_service isisd 2608/tcp "ISISd vty" |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 275 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 276 | |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 277 | for daemon in %daemon_list ; do |
| 278 | /sbin/chkconfig --add ${daemon} |
| 279 | done |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 280 | |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 281 | /sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 282 | |
| 283 | # Create dummy files if they don't exist so basic functions can be used. |
| 284 | if [ ! -e %{_sysconfdir}/zebra.conf ]; then |
| 285 | echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 286 | %if %{quagga_user} |
| 287 | chown %quagga_user:%quagga_user %{_sysconfdir}/zebra.conf |
| 288 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 289 | chmod 640 %{_sysconfdir}/zebra.conf |
| 290 | fi |
| 291 | if [ ! -e %{_sysconfdir}/vtysh.conf ]; then |
| 292 | touch %{_sysconfdir}/vtysh.conf |
| 293 | chmod 640 %{_sysconfdir}/vtysh.conf |
| 294 | fi |
| 295 | |
| 296 | %postun |
ajs | fc43ecc | 2005-01-12 16:41:33 +0000 | [diff] [blame] | 297 | if [ "$1" -ge 1 ]; then |
| 298 | # Find out which daemons need to be restarted. |
ajs | b3324e2 | 2004-12-22 17:52:29 +0000 | [diff] [blame] | 299 | for daemon in %all_daemons ; do |
ajs | fc43ecc | 2005-01-12 16:41:33 +0000 | [diff] [blame] | 300 | if [ -f /var/lock/subsys/$daemon ]; then |
| 301 | eval restart_$daemon=yes |
| 302 | else |
| 303 | eval restart_$daemon=no |
| 304 | fi |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 305 | done |
ajs | fc43ecc | 2005-01-12 16:41:33 +0000 | [diff] [blame] | 306 | # Rename restart flags for daemons handled specially. |
| 307 | running_zebra="$restart_zebra" |
| 308 | restart_zebra=no |
| 309 | running_watchquagga="$restart_watchquagga" |
| 310 | restart_watchquagga=no |
| 311 | # Stop watchquagga first. |
| 312 | [ "$running_watchquagga" = yes ] && \ |
| 313 | /etc/rc.d/init.d/watchquagga stop >/dev/null 2>&1 |
| 314 | # Stop all daemons other than zebra and watchquagga. |
| 315 | for daemon in %all_daemons ; do |
| 316 | eval restart=\$restart_${daemon} |
| 317 | [ "$restart" = yes ] && \ |
| 318 | /etc/rc.d/init.d/$daemon stop >/dev/null 2>&1 |
| 319 | done |
| 320 | # Restart zebra. |
| 321 | [ "$running_zebra" = yes ] && \ |
| 322 | /etc/rc.d/init.d/zebra restart >/dev/null 2>&1 |
| 323 | # Start all daemons other than zebra and watchquagga. |
| 324 | for daemon in %all_daemons ; do |
| 325 | eval restart=\$restart_${daemon} |
| 326 | [ "$restart" = yes ] && \ |
| 327 | /etc/rc.d/init.d/$daemon start >/dev/null 2>&1 |
| 328 | done |
| 329 | # Start watchquagga last. |
ajs | b854038 | 2005-01-15 17:26:48 +0000 | [diff] [blame] | 330 | # Avoid postun scriptlet error if watchquagga is not running. |
ajs | fc43ecc | 2005-01-12 16:41:33 +0000 | [diff] [blame] | 331 | [ "$running_watchquagga" = yes ] && \ |
ajs | b854038 | 2005-01-15 17:26:48 +0000 | [diff] [blame] | 332 | /etc/rc.d/init.d/watchquagga start >/dev/null 2>&1 || : |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 333 | fi |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 334 | /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 335 | |
| 336 | %preun |
| 337 | if [ "$1" = "0" ]; then |
ajs | b3324e2 | 2004-12-22 17:52:29 +0000 | [diff] [blame] | 338 | for daemon in %all_daemons ; do |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 339 | /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1 |
| 340 | /sbin/chkconfig --del ${daemon} |
| 341 | done |
| 342 | /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 343 | fi |
| 344 | |
| 345 | %clean |
paul | b5f310c | 2004-09-13 13:15:25 +0000 | [diff] [blame] | 346 | %if !%{keep_build} |
| 347 | rm -rf $RPM_BUILD_ROOT |
| 348 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 349 | |
| 350 | %files |
| 351 | %defattr(-,root,root) |
paul | 448ed4a | 2003-03-01 15:43:28 +0000 | [diff] [blame] | 352 | %doc */*.sample* AUTHORS COPYING |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 353 | %doc doc/quagga.html |
paul | 30b9d89 | 2003-01-18 22:57:15 +0000 | [diff] [blame] | 354 | %doc doc/mpls |
paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 355 | %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 356 | %if %{quagga_user} |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 357 | %dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir} |
| 358 | %dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga |
| 359 | %dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 360 | %else |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 361 | %dir %attr(750,root,root) %{_sysconfdir} |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 362 | %dir %attr(750,root,root) /var/log/quagga |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 363 | %dir %attr(755,root,root) /usr/share/info |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 364 | %dir %attr(750,root,root) /var/run/quagga |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 365 | %endif |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 366 | %if %{vty_group} |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 367 | %attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 368 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 369 | %{_infodir}/*info* |
| 370 | %{_mandir}/man*/* |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 371 | %{_sbindir}/zebra |
| 372 | %{_sbindir}/ospfd |
| 373 | %{_sbindir}/ripd |
| 374 | %{_sbindir}/bgpd |
ajs | b3324e2 | 2004-12-22 17:52:29 +0000 | [diff] [blame] | 375 | %{_sbindir}/watchquagga |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 376 | %if %{with_ipv6} |
| 377 | %{_sbindir}/ripngd |
| 378 | %{_sbindir}/ospf6d |
| 379 | %endif |
| 380 | %if %{with_isisd} |
| 381 | %{_sbindir}/isisd |
| 382 | %endif |
paul | cfc1842 | 2004-10-23 00:05:41 +0000 | [diff] [blame] | 383 | %dir %attr(755,root,root) %{_libdir} |
paul | 28f7972 | 2004-10-29 05:35:43 +0000 | [diff] [blame] | 384 | %if %{with_shared} |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 385 | %dir %{_libdir} |
paul | 2ff9e82 | 2004-07-20 11:19:47 +0000 | [diff] [blame] | 386 | %{_libdir}/lib*.so |
| 387 | %{_libdir}/lib*.so.* |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 388 | %endif |
| 389 | %if %{with_vtysh} |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 390 | %{_bindir}/* |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 391 | %endif |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 392 | %config /etc/quagga/[!v]* |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 393 | %config /etc/rc.d/init.d/* |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 394 | %config(noreplace) /etc/sysconfig/quagga |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 395 | %config(noreplace) /etc/pam.d/quagga |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 396 | %config(noreplace) %attr(640,root,root) /etc/logrotate.d/* |
| 397 | |
paul | 448ed4a | 2003-03-01 15:43:28 +0000 | [diff] [blame] | 398 | %files contrib |
| 399 | %defattr(-,root,root) |
| 400 | %doc tools |
| 401 | |
paul | e062685 | 2003-03-18 14:11:36 +0000 | [diff] [blame] | 402 | %files devel |
| 403 | %defattr(-,root,root) |
paul | da29c6b | 2004-10-08 00:49:09 +0000 | [diff] [blame] | 404 | %if %{with_ospfclient} |
| 405 | %{_sbindir}/ospfclient |
| 406 | %endif |
paul | 28f7972 | 2004-10-29 05:35:43 +0000 | [diff] [blame] | 407 | %{_libdir}/*.a |
| 408 | %{_libdir}/*.la |
paul | cfc1842 | 2004-10-23 00:05:41 +0000 | [diff] [blame] | 409 | %dir %attr(755,root,root) %{_includedir}/%{name} |
paul | 28f7972 | 2004-10-29 05:35:43 +0000 | [diff] [blame] | 410 | %{_includedir}/%name/*.h |
paul | cfc1842 | 2004-10-23 00:05:41 +0000 | [diff] [blame] | 411 | %dir %attr(755,root,root) %{_includedir}/%{name}/ospfd |
paul | 28f7972 | 2004-10-29 05:35:43 +0000 | [diff] [blame] | 412 | %{_includedir}/%name/ospfd/*.h |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 413 | %if %{with_ospfapi} |
paul | cfc1842 | 2004-10-23 00:05:41 +0000 | [diff] [blame] | 414 | %dir %attr(755,root,root) %{_includedir}/%{name}/ospfapi |
paul | 28f7972 | 2004-10-29 05:35:43 +0000 | [diff] [blame] | 415 | %{_includedir}/%name/ospfapi/*.h |
paul | 6898008 | 2003-03-25 05:07:42 +0000 | [diff] [blame] | 416 | %endif |
paul | e062685 | 2003-03-18 14:11:36 +0000 | [diff] [blame] | 417 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 418 | %changelog |
paul | e7cd37b | 2005-09-08 15:18:39 +0000 | [diff] [blame] | 419 | * Thu Sep 12 2005 Paul Jakma <paul@dishone.st> |
| 420 | - Steal some changes from Fedora spec file: |
| 421 | - Add with_rtadv variable |
| 422 | - Test for groups/users with getent before group/user adding |
| 423 | - Readline need not be an explicit prerequisite |
| 424 | - install-info delete should be postun, not preun |
| 425 | |
ajs | fc43ecc | 2005-01-12 16:41:33 +0000 | [diff] [blame] | 426 | * Wed Jan 12 2005 Andrew J. Schorr <ajschorr@alumni.princeton.edu> |
| 427 | - on package upgrade, implement careful, phased restart logic |
| 428 | - use gcc -rdynamic flag when linking for better backtraces |
| 429 | |
ajs | b3324e2 | 2004-12-22 17:52:29 +0000 | [diff] [blame] | 430 | * Wed Dec 22 2004 Andrew J. Schorr <ajschorr@alumni.princeton.edu> |
ajs | f393175 | 2004-12-23 00:00:58 +0000 | [diff] [blame] | 431 | - daemonv6_list should contain only IPv6 daemons |
| 432 | |
| 433 | * Wed Dec 22 2004 Andrew J. Schorr <ajschorr@alumni.princeton.edu> |
ajs | b3324e2 | 2004-12-22 17:52:29 +0000 | [diff] [blame] | 434 | - watchquagga added |
| 435 | - on upgrade, all daemons should be condrestart'ed |
| 436 | - on removal, all daemons should be stopped |
| 437 | |
paul | 36002ae | 2004-11-08 17:36:29 +0000 | [diff] [blame] | 438 | * Mon Nov 08 2004 Paul Jakma <paul@dishone.st> |
| 439 | - Use makeinfo --html to generate quagga.html |
| 440 | |
paul | 0df63b5 | 2004-11-07 22:12:23 +0000 | [diff] [blame] | 441 | * Sun Nov 07 2004 Paul Jakma <paul@dishone.st> |
| 442 | - Fix with_ipv6 set to 0 build |
| 443 | |
paul | cfc1842 | 2004-10-23 00:05:41 +0000 | [diff] [blame] | 444 | * Sat Oct 23 2004 Paul Jakma <paul@dishone.st> |
| 445 | - Update to 0.97.2 |
| 446 | |
| 447 | * Sat Oct 23 2004 Andrew J. Schorr <aschorr@telemetry-investments.com> |
| 448 | - Make directories be owned by the packages concerned |
| 449 | - Update logrotate scripts to use correct path to killall and use pid files |
| 450 | |
paul | da29c6b | 2004-10-08 00:49:09 +0000 | [diff] [blame] | 451 | * Fri Oct 08 2004 Paul Jakma <paul@dishone.st> |
| 452 | - Update to 0.97.0 |
| 453 | |
paul | 54b25dc | 2004-09-30 04:56:26 +0000 | [diff] [blame] | 454 | * Wed Sep 15 2004 Paul Jakma <paul@dishone.st> |
| 455 | - build snmp support by default |
| 456 | - build irdp support |
| 457 | - build with shared libs |
| 458 | - devel subpackage for archives and headers |
| 459 | |
paul | 00bc560 | 2004-01-09 16:30:52 +0000 | [diff] [blame] | 460 | * Thu Jan 08 2004 Paul Jakma <paul@dishone.st> |
| 461 | - updated sysconfig files to specify local dir |
| 462 | - added ospf_dump.c crash quick fix patch |
| 463 | - added ospfd persistent interface configuration patch |
| 464 | |
paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 465 | * Tue Dec 30 2003 Paul Jakma <paul@dishone.st> |
| 466 | - sync to CVS |
| 467 | - integrate RH sysconfig patch to specify daemon options (RH) |
| 468 | - default to have vty listen only to 127.1 (RH) |
| 469 | - add user with fixed UID/GID (RH) |
| 470 | - create user with shell /sbin/nologin rather than /bin/false (RH) |
| 471 | - stop daemons on uninstall (RH) |
| 472 | - delete info file on %preun, not %postun to avoid deletion on upgrade. (RH) |
| 473 | - isisd added |
| 474 | - cleanup tasks carried out for every daemon |
| 475 | |
paul | 406f700 | 2003-11-02 07:30:52 +0000 | [diff] [blame] | 476 | * Sun Nov 2 2003 Paul Jakma <paul@dishone.st> |
| 477 | - Fix -devel package to include all files |
| 478 | - Sync to 0.96.4 |
| 479 | |
paul | 6bd8fd3 | 2003-08-12 12:54:13 +0000 | [diff] [blame] | 480 | * Tue Aug 12 2003 Paul Jakma <paul@dishone.st> |
| 481 | - Renamed to Quagga |
| 482 | - Sync to Quagga release 0.96 |
| 483 | |
paul | edd7c24 | 2003-06-04 13:59:38 +0000 | [diff] [blame] | 484 | * Tue Mar 20 2003 Paul Jakma <paul@dishone.st> |
| 485 | - zebra privileges support |
| 486 | |
paul | e062685 | 2003-03-18 14:11:36 +0000 | [diff] [blame] | 487 | * Mon Mar 18 2003 Paul Jakma <paul@dishone.st> |
| 488 | - Fix mem leak in 'show thread cpu' |
| 489 | - Ralph Keller's OSPF-API |
| 490 | - Amir: Fix configure.ac for net-snmp |
| 491 | |
paul | 448ed4a | 2003-03-01 15:43:28 +0000 | [diff] [blame] | 492 | * Sat Mar 1 2003 Paul Jakma <paul@dishone.st> |
| 493 | - ospfd IOS prefix to interface matching for 'network' statement |
| 494 | - temporary fix for PtP and IPv6 |
| 495 | - sync to zebra.org CVS |
| 496 | |
paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 497 | * Mon Jan 20 2003 Paul Jakma <paul@dishone.st> |
| 498 | - update to latest cvs |
| 499 | - Yon's "show thread cpu" patch - 17217 |
| 500 | - walk up tree - 17218 |
| 501 | - ospfd NSSA fixes - 16681 |
| 502 | - ospfd nsm fixes - 16824 |
| 503 | - ospfd OLSA fixes and new feature - 16823 |
| 504 | - KAME and ifindex fixes - 16525 |
| 505 | - spec file changes to allow redhat files to be in tree |
| 506 | |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 507 | * Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com> |
| 508 | - Added conditionals for building with(out) IPv6, vtysh, RIP, BGP |
| 509 | - Fixed up some build requirements (patch) |
| 510 | - Added conditional build requirements for vtysh / snmp |
| 511 | - Added conditional to %files for %_bindir depending on vtysh |
| 512 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 513 | * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie> |
| 514 | - update to latest CVS |
| 515 | - add Greg Troxel's md5 buffer copy/dup fix |
| 516 | - add RIPv1 fix |
| 517 | - add Frank's multicast flag fix |
| 518 | |
| 519 | * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie> |
| 520 | - update to latest CVS |
| 521 | - timestamped crypt_seqnum patch |
| 522 | - oi->on_write_q fix |
| 523 | |
| 524 | * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie> |
| 525 | - update to latest CVS |
| 526 | - add vtysh 'write-config (integrated|daemon)' patch |
| 527 | - always 'make rebuild' in vtysh/ to catch new commands |
| 528 | |
| 529 | * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie> |
| 530 | - update to 0.93b |
| 531 | |
| 532 | * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie> |
| 533 | - update to latest CVS |
| 534 | - add "/sbin/ip route flush proto zebra" to zebra RH init on startup |
| 535 | |
| 536 | * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie> |
| 537 | - update to current CVS |
| 538 | - add OSPF point to multipoint patch |
| 539 | - add OSPF bugfixes |
| 540 | - add BGP hash optimisation patch |
| 541 | |
| 542 | * Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie> |
| 543 | - update to 0.93-pre1 / CVS |
| 544 | - add link state detection support |
| 545 | - add generic PtP and RFC3021 support |
| 546 | - various bug fixes |
| 547 | |
| 548 | * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6 |
| 549 | - Fix bug #51336 |
| 550 | |
| 551 | * Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5 |
| 552 | - Use generic initscript strings instead of initscript specific |
| 553 | ( "Starting foo: " -> "Starting $prog:" ) |
| 554 | |
| 555 | * Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4 |
| 556 | - Bump the release when rebuilding into the dist. |
| 557 | |
| 558 | * Tue Feb 6 2001 Tim Powers <timp@redhat.com> |
| 559 | - built for Powertools |
| 560 | |
| 561 | * Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi> |
| 562 | - Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org. |
| 563 | - Update to 0.91a |
| 564 | - Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc. |
| 565 | - Should be quite Red Hat'isque now. |