]> git.proxmox.com Git - mirror_frr.git/blob - init/redhat/zebra.spec.in
Initial revision
[mirror_frr.git] / init / redhat / zebra.spec.in
1 %define version @VERSION@
2
3 Summary: Zebra routing engine
4 Name: zebra
5 Version: %{version}
6 Release: 1
7 Source: zebra-%{version}.tar.gz
8 URL: http://www.zebra.org
9 Copyright: GPL
10 Group: System Environment/Daemons
11 BuildRoot: /tmp/zebra-%{version}-root
12
13 %description
14 GNU Zebra is free software (distributed under GNU Generic Public License)
15 that manages TCP/IP based routing protocols. It supports BGP-4 protocol as
16 described in RFC1771 (A Border Gateway Protocol 4) as well as RIPv1, RIPv2
17 and OSPFv2. Unlike traditional, Gated based, monolithic architectures and
18 even the so-called "new modular architectures" that remove the burden of
19 processing routing functions from the cpu and utilize special ASIC chips
20 instead, Zebra software offers true modularity.
21
22 %prep
23 %setup
24
25 %build
26 #./configure --enable-snmp --prefix=/usr --sysconfdir=/etc
27 ./configure --prefix=/usr --sysconfdir=/etc
28 make
29
30 %install
31 rm -rf $RPM_BUILD_ROOT
32 make DESTDIR=$RPM_BUILD_ROOT install
33 rm -f $RPM_BUILD_ROOT/usr/info/dir
34 rm -f $RPM_BUILD_ROOT/usr/man/man8/ospf6*
35 rm -f $RPM_BUILD_ROOT/usr/man/man8/ripng*
36 rm -f $RPM_BUILD_ROOT/usr/sbin/ospf6d
37 rm -f $RPM_BUILD_ROOT/usr/sbin/ripngd
38 strip $RPM_BUILD_ROOT/usr/sbin/*
39
40 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
41 install -m755 init/redhat/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
42 #install -m755 init/redhat/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
43 install -m755 init/redhat/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
44 install -m755 init/redhat/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
45 #install -m755 init/redhat/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
46 install -m755 init/redhat/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
47
48 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
49 install -m644 init/redhat/zebra.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/zebra
50
51
52 %post
53 # zebra_spec_add_service <sercice name> <port/proto> <comment>
54 # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
55
56 zebra_spec_add_service ()
57 {
58 # Add port /etc/services entry if it isn't already there
59 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
60 echo "$1 $2 # $3" >> /etc/services
61 fi
62 }
63
64 zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
65 zebra_spec_add_service zebra 2601/tcp "zebra vty"
66 zebra_spec_add_service ripd 2602/tcp "RIPd vty"
67 zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
68 zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
69 zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
70 zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
71
72 #Install info
73 /sbin/install-info /usr/info/zebra.info /usr/info/dir
74
75 if [ -x /sbin/chkconfig ]; then
76 chkconfig --add bgpd
77 # chkconfig --add ospf6d
78 chkconfig --add ospfd
79 chkconfig --add ripd
80 # chkconfig --add ripngd
81 chkconfig --add zebra
82 fi
83
84
85 %preun
86 if [ "$1" = 0 ] ; then
87 /sbin/install-info --delete /usr/info/zebra.info /usr/info/dir
88
89 if [ -x /sbin/chkconfig ]; then
90 chkconfig --del bgpd
91 # chkconfig --del ospf6d
92 chkconfig --del ospfd
93 chkconfig --del ripd
94 # chkconfig --del ripngd
95 chkconfig --del zebra
96 fi
97 fi
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101 rm -rf $RPM_BUILD_DIR/%{name}-%{version}
102
103 %files
104 %attr(-,root,root) %doc AUTHORS COPYING ChangeLog INSTALL NEWS README SERVICES TODO bgpd/bgpd.conf.sample ospfd/ospfd.conf.sample ripd/ripd.conf.sample zebra/zebra.conf.sample
105 %attr(-,root,root) %config /etc/rc.d/init.d/*
106 %attr(-,root,root) %config /etc/logrotate.d/*
107 %attr(-,root,root) /usr/info/*
108 #%attr(-,root,root) /usr/man/* # Not man1 to exclude vtysh man page as
109 # it is not build by default (for now)
110 %attr(-,root,root) /usr/man/man8/*
111 %attr(-,root,root) /usr/sbin/*
112
113 %changelog
114 * Mon Nov 6 2000 Lennert Buytenhek <buytenh@gnu.org>
115 - Don't include ospf6d and ripngd in package.
116 - Fix logrotate file (add ospf.log).
117 * Mon Oct 2 2000 Horms <horms@valinux.com>
118 - Install and uninstall info in %post and %preun respectively
119 - Moved chkconfig --del operations from %postun to %preun, as
120 chkconfig needs to run while the init files are still present on
121 the system.
122 - Don't install vtysh man page as vtysh is not build by default
123 - Added logrotate script so logs won't grow without bound
124 * Wed Sep 27 2000 Horms <horms@vergenet.net>
125 - Add ports to /etc/services if they aren't there
126 - forcibly remove $RPM_BUILD_ROOT/usr/info/dir and friends so
127 there is no error if it does not exist when rm is run.
128 - Clean up the zebra build dir