]> git.pld-linux.org Git - packages/bird.git/blob - bird.spec
c1377684e8ea32177ce4fefefb571c0561537bf4
[packages/bird.git] / bird.spec
1 # TODO:
2 #       - trigger to clean up after old bird package (stop, chkconfig --del)
3 #
4 # Conditional build:
5 %bcond_without  ipv6    # disable IPv6 support (and building bird-ipv6 package)
6 %bcond_without  ipv4    # disable IPv4 support (and building bird-ipv4 package)
7 %bcond_with     alien   # enable possibility to import 'alien' routes import into bird's routing table
8 #
9 Summary:        The BIRD Internet Routing Daemon
10 Summary(pl.UTF-8):      Demon BIRD Internetowego Routingu Dynamicznego
11 Name:           bird
12 Version:        1.4.3
13 Release:        1
14 License:        GPL v2+
15 Group:          Networking/Daemons
16 Source0:        ftp://bird.network.cz/pub/bird/%{name}-%{version}.tar.gz
17 # Source0-md5:  eb7e00b9c1d102ddfcbc19d9cb168511
18 Source1:        %{name}-ipv4.init
19 Source2:        %{name}-ipv4.sysconfig
20 Source3:        %{name}-ipv6.init
21 Source4:        %{name}-ipv6.sysconfig
22 Source5:        ftp://bird.network.cz/pub/bird/%{name}-doc-%{version}.tar.gz
23 # Source5-md5:  184744368fc6e2e4176e45aa1f674aef
24 Patch0:         %{name}-allowalien.patch
25 URL:            http://bird.network.cz/
26 BuildRequires:  autoconf
27 BuildRequires:  automake
28 BuildRequires:  bison
29 BuildRequires:  flex
30 BuildRequires:  readline-devel >= 4.2
31 BuildRequires:  rpmbuild(macros) >= 1.268
32 Requires(post,preun):   /sbin/chkconfig
33 Requires:       bird-daemon
34 Requires:       rc-scripts
35 Requires(postun):       /usr/sbin/userdel
36 Requires(pre):  /usr/sbin/useradd
37 Obsoletes:      gated
38 Obsoletes:      mrt
39 Obsoletes:      zebra
40 Obsoletes:      zebra-guile
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 The BIRD project is an attempt to create a routing daemon running on
45 UNIX-like systems (but not necessarily limited to them) with full
46 support of all modern routing protocols, easy to use configuration
47 interface and powerful route filtering language.
48
49 %description -l pl.UTF-8
50 Projekt BIRD ma na celu utworzenie daemona dynamicznego routingu
51 pracującego na systemach UNIX z pełnym wsparciem dla nowoczesnych
52 protokołów routingu, łatwym interfejsem konfiguracji i językiem
53 filtrów o dużych możliwościach.
54
55 %package ipv4
56 Summary:        Routing daemon for IPv4
57 Summary(pl.UTF-8):      Demon dynamicznego routingu IPv4
58 Group:          Networking/Daemons
59 Requires(post,preun):   /sbin/chkconfig
60 Requires:       %{name} = %{version}-%{release}
61 Requires:       rc-scripts
62 Provides:       bird-daemon
63 Provides:       routingdaemon
64 Obsoletes:      gated
65 Obsoletes:      mrt
66 Obsoletes:      zebra
67 Obsoletes:      zebra-guile
68
69 %description ipv4
70 The BIRD project is an attempt to create a routing daemon running on
71 UNIX-like systems (but not necessarily limited to them) with full
72 support of all modern routing protocols, easy to use configuration
73 interface and powerful route filtering language.
74
75 %description ipv4 -l pl.UTF-8
76 Projekt BIRD ma na celu utworzenie daemona dynamicznego routingu
77 pracującego na systemach UNIX z pełnym wsparciem dla nowoczesnych
78 protokołów routingu, łatwym interfejsem konfiguracji i językiem
79 filtrów o dużych możliwościach.
80
81 %package ipv6
82 Summary:        Routing daemon for IPv6
83 Summary(pl.UTF-8):      Demon dynamicznego routingu IPv6
84 Group:          Networking/Daemons
85 Requires(post,preun):   /sbin/chkconfig
86 Requires:       %{name} = %{version}-%{release}
87 Requires:       rc-scripts
88 Provides:       bird-daemon
89 Provides:       routingdaemon
90 Obsoletes:      gated
91 Obsoletes:      mrt
92 Obsoletes:      zebra
93 Obsoletes:      zebra-guile
94
95 %description ipv6
96 The BIRD project is an attempt to create a routing daemon running on
97 UNIX-like systems (but not necessarily limited to them) with full
98 support of all modern routing protocols, easy to use configuration
99 interface and powerful route filtering language.
100
101 %description ipv6 -l pl.UTF-8
102 Projekt BIRD ma na celu utworzenie daemona dynamicznego routingu
103 pracującego na systemach UNIX z pełnym wsparciem dla nowoczesnych
104 protokołów routingu, łatwym interfejsem konfiguracji i językiem
105 filtrów o dużych możliwościach.
106
107 %prep
108 %setup -q -a 5
109 %{?with_alien:%patch0 -p1}
110
111 %build
112 cp -f /usr/share/automake/config.* tools
113 %{__autoconf}
114
115 export CFLAGS="%{rpmcflags} -I%{_includedir}/ncursesw"
116
117 %if %{with ipv6}
118 %configure \
119         --disable-memcheck \
120         --enable-client \
121         --enable-ipv6
122 %{__make} -j1
123
124 mv bird bird-6
125
126 %{__make} clean
127 %endif
128
129 %if %{with ipv4}
130 %configure \
131         --disable-memcheck \
132         --enable-client \
133         --disable-ipv6
134 %{__make} -j1
135 %endif
136
137 %install
138 rm -rf $RPM_BUILD_ROOT
139 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/sysconfig,%{_sbindir}}
140
141 install birdc $RPM_BUILD_ROOT%{_sbindir}
142
143 %if %{with ipv4}
144 install bird $RPM_BUILD_ROOT%{_sbindir}
145 install doc/bird.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
146 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-ipv4
147 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-ipv4
148 %endif
149
150 %if %{with ipv6}
151 install bird-6 $RPM_BUILD_ROOT%{_sbindir}
152 cat <<EOF > $RPM_BUILD_ROOT%{_sbindir}/birdc-6
153 #!/bin/sh
154 exec %{_sbindir}/birdc -s /var/run/bird6.ctl
155 EOF
156 :> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}6.conf
157 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-ipv6
158 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-ipv6
159 %endif
160
161 %clean
162 rm -rf $RPM_BUILD_ROOT
163
164 %pre
165 %groupadd -g 271 bird
166 %useradd -u 271 -d /usr/share/empty -s /bin/false -c "bird routing daemon" -g bird bird
167
168 %postun
169 if [ "$1" = "0" ]; then
170         %userremove bird
171         %groupremove bird
172 fi
173
174 %post ipv4
175 /sbin/chkconfig --add %{name}-ipv4
176 %service %{name}-ipv4 restart "routing daemon"
177
178 %preun ipv4
179 if [ "$1" = "0" ]; then
180         %service %{name}-ipv4 stop
181         /sbin/chkconfig --del %{name}-ipv4
182 fi
183
184 %post ipv6
185 /sbin/chkconfig --add %{name}-ipv6
186 %service %{name}-ipv6 restart "routing daemon"
187
188 %preun ipv6
189 if [ "$1" = "0" ]; then
190         %service %{name}-ipv6 stop
191         /sbin/chkconfig --del %{name}-ipv6
192 fi
193
194 %triggerpostun ipv4 -- %{name}-ipv4 < 1.3.4-3
195 chmod 0640 /etc/bird.conf
196 chgrp bird /etc/bird.conf
197
198 %files
199 %defattr(644,root,root,755)
200 %doc doc/*.html doc/reply_codes %{name}-doc-%{version}/doc/*.ps ChangeLog NEWS README TODO
201 %attr(755,root,root) %{_sbindir}/birdc
202
203 %if %{with ipv4}
204 %files ipv4
205 %defattr(644,root,root,755)
206 %attr(755,root,root) %{_sbindir}/bird
207 %attr(754,root,root) /etc/rc.d/init.d/bird-ipv4
208 %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bird-ipv4
209 %attr(640,root,bird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bird.conf
210 %endif
211
212 %if %{with ipv6}
213 %files ipv6
214 %defattr(644,root,root,755)
215 %attr(755,root,root) %{_sbindir}/bird-6
216 %attr(755,root,root) %{_sbindir}/birdc-6
217 %attr(754,root,root) /etc/rc.d/init.d/bird-ipv6
218 %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bird-ipv6
219 %attr(640,root,bird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bird6.conf
220 %endif
This page took 0.065385 seconds and 2 git commands to generate.