]>
Commit | Line | Data |
---|---|---|
587f8625 JK |
1 | # TODO: |
2 | # - trigger to clean up after old bird package (stop, chkconfig --del) | |
0e72880e ER |
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) | |
3c309a5c | 7 | %bcond_with alien # enable possibility to import 'alien' routes import into bird's routing table |
0e72880e | 8 | # |
46b7240d TP |
9 | Summary: The BIRD Internet Routing Daemon |
10 | Summary(pl.UTF-8): Demon BIRD Internetowego Routingu Dynamicznego | |
859a1f4d | 11 | Name: bird |
97a5aa47 AM |
12 | Version: 1.6.8 |
13 | Release: 1 | |
46b7240d | 14 | License: GPL v2+ |
859a1f4d | 15 | Group: Networking/Daemons |
19154b0e | 16 | Source0: https://bird.network.cz/download/%{name}-%{version}.tar.gz |
97a5aa47 | 17 | # Source0-md5: abe29a927e21a3d7f8092641f06093c2 |
587f8625 JK |
18 | Source1: %{name}-ipv4.init |
19 | Source2: %{name}-ipv4.sysconfig | |
20 | Source3: %{name}-ipv6.init | |
21 | Source4: %{name}-ipv6.sysconfig | |
19154b0e | 22 | Source5: https://bird.network.cz/download/%{name}-doc-%{version}.tar.gz |
97a5aa47 | 23 | # Source5-md5: d5b69caeee629479e0261aba18d35758 |
d84ccda5 JK |
24 | Source6: %{name}-ipv4.service |
25 | Source7: %{name}-ipv6.service | |
dcb2fa8e | 26 | Patch0: %{name}-allowalien.patch |
97a5aa47 | 27 | Patch1: gcc.patch |
19154b0e | 28 | URL: https://bird.network.cz/ |
42582df4 | 29 | BuildRequires: autoconf |
bd9359d2 | 30 | BuildRequires: automake |
0e8a59db | 31 | BuildRequires: bison |
32 | BuildRequires: flex | |
1e96d8fe | 33 | BuildRequires: readline-devel >= 4.2 |
f3122825 | 34 | BuildRequires: rpmbuild(macros) >= 1.268 |
90026ef8 | 35 | Requires(post,preun): /sbin/chkconfig |
587f8625 | 36 | Requires: bird-daemon |
f3122825 | 37 | Requires: rc-scripts |
fc243893 AM |
38 | Requires(postun): /usr/sbin/userdel |
39 | Requires(pre): /usr/sbin/useradd | |
bd846c8e | 40 | Obsoletes: gated |
dab997f5 | 41 | Obsoletes: mrt |
bd846c8e | 42 | Obsoletes: zebra |
43 | Obsoletes: zebra-guile | |
f3122825 | 44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
859a1f4d AM |
45 | |
46 | %description | |
47 | The BIRD project is an attempt to create a routing daemon running on | |
48 | UNIX-like systems (but not necessarily limited to them) with full | |
49 | support of all modern routing protocols, easy to use configuration | |
50 | interface and powerful route filtering language. | |
51 | ||
bf003f25 | 52 | %description -l pl.UTF-8 |
859a1f4d | 53 | Projekt BIRD ma na celu utworzenie daemona dynamicznego routingu |
bf003f25 JR |
54 | pracującego na systemach UNIX z pełnym wsparciem dla nowoczesnych |
55 | protokołów routingu, łatwym interfejsem konfiguracji i językiem | |
56 | filtrów o dużych możliwościach. | |
859a1f4d | 57 | |
587f8625 JK |
58 | %package ipv4 |
59 | Summary: Routing daemon for IPv4 | |
6317c737 | 60 | Summary(pl.UTF-8): Demon dynamicznego routingu IPv4 |
587f8625 | 61 | Group: Networking/Daemons |
587f8625 | 62 | Requires(post,preun): /sbin/chkconfig |
f3122825 ER |
63 | Requires: %{name} = %{version}-%{release} |
64 | Requires: rc-scripts | |
587f8625 | 65 | Provides: bird-daemon |
f3122825 | 66 | Provides: routingdaemon |
587f8625 JK |
67 | Obsoletes: gated |
68 | Obsoletes: mrt | |
69 | Obsoletes: zebra | |
70 | Obsoletes: zebra-guile | |
587f8625 JK |
71 | |
72 | %description ipv4 | |
73 | The BIRD project is an attempt to create a routing daemon running on | |
74 | UNIX-like systems (but not necessarily limited to them) with full | |
75 | support of all modern routing protocols, easy to use configuration | |
76 | interface and powerful route filtering language. | |
77 | ||
bf003f25 | 78 | %description ipv4 -l pl.UTF-8 |
587f8625 | 79 | Projekt BIRD ma na celu utworzenie daemona dynamicznego routingu |
bf003f25 JR |
80 | pracującego na systemach UNIX z pełnym wsparciem dla nowoczesnych |
81 | protokołów routingu, łatwym interfejsem konfiguracji i językiem | |
82 | filtrów o dużych możliwościach. | |
587f8625 JK |
83 | |
84 | %package ipv6 | |
85 | Summary: Routing daemon for IPv6 | |
6317c737 | 86 | Summary(pl.UTF-8): Demon dynamicznego routingu IPv6 |
587f8625 | 87 | Group: Networking/Daemons |
587f8625 | 88 | Requires(post,preun): /sbin/chkconfig |
f3122825 ER |
89 | Requires: %{name} = %{version}-%{release} |
90 | Requires: rc-scripts | |
587f8625 | 91 | Provides: bird-daemon |
f3122825 | 92 | Provides: routingdaemon |
587f8625 JK |
93 | Obsoletes: gated |
94 | Obsoletes: mrt | |
95 | Obsoletes: zebra | |
96 | Obsoletes: zebra-guile | |
587f8625 JK |
97 | |
98 | %description ipv6 | |
99 | The BIRD project is an attempt to create a routing daemon running on | |
100 | UNIX-like systems (but not necessarily limited to them) with full | |
101 | support of all modern routing protocols, easy to use configuration | |
102 | interface and powerful route filtering language. | |
103 | ||
bf003f25 | 104 | %description ipv6 -l pl.UTF-8 |
587f8625 | 105 | Projekt BIRD ma na celu utworzenie daemona dynamicznego routingu |
bf003f25 JR |
106 | pracującego na systemach UNIX z pełnym wsparciem dla nowoczesnych |
107 | protokołów routingu, łatwym interfejsem konfiguracji i językiem | |
108 | filtrów o dużych możliwościach. | |
587f8625 | 109 | |
859a1f4d | 110 | %prep |
46b7240d | 111 | %setup -q -a 5 |
dbe442d0 | 112 | %{?with_alien:%patch0 -p1} |
97a5aa47 | 113 | %patch1 -p1 |
859a1f4d AM |
114 | |
115 | %build | |
bd9359d2 | 116 | cp -f /usr/share/automake/config.* tools |
46b7240d TP |
117 | %{__autoconf} |
118 | ||
4a882be4 | 119 | export CFLAGS="%{rpmcflags} -I%{_includedir}/ncursesw -fno-strict-aliasing -fno-strict-overflow" |
587f8625 JK |
120 | |
121 | %if %{with ipv6} | |
587f8625 | 122 | %configure \ |
859a1f4d AM |
123 | --disable-memcheck \ |
124 | --enable-client \ | |
125 | --enable-ipv6 | |
b90dbe4c | 126 | %{__make} -j1 |
859a1f4d | 127 | |
587f8625 JK |
128 | mv bird bird-6 |
129 | ||
130 | %{__make} clean | |
131 | %endif | |
132 | ||
133 | %if %{with ipv4} | |
134 | %configure \ | |
135 | --disable-memcheck \ | |
136 | --enable-client \ | |
137 | --disable-ipv6 | |
b90dbe4c | 138 | %{__make} -j1 |
587f8625 JK |
139 | %endif |
140 | ||
859a1f4d AM |
141 | %install |
142 | rm -rf $RPM_BUILD_ROOT | |
d84ccda5 JK |
143 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/sysconfig,%{_sbindir}} \ |
144 | $RPM_BUILD_ROOT%{systemdunitdir} | |
859a1f4d | 145 | |
bd846c8e | 146 | install birdc $RPM_BUILD_ROOT%{_sbindir} |
147 | ||
2770ad60 | 148 | %if %{with ipv4} |
587f8625 | 149 | install bird $RPM_BUILD_ROOT%{_sbindir} |
bd846c8e | 150 | install doc/bird.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf |
587f8625 JK |
151 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-ipv4 |
152 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-ipv4 | |
d84ccda5 | 153 | install %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-ipv4.service |
587f8625 JK |
154 | %endif |
155 | ||
156 | %if %{with ipv6} | |
157 | install bird-6 $RPM_BUILD_ROOT%{_sbindir} | |
158 | cat <<EOF > $RPM_BUILD_ROOT%{_sbindir}/birdc-6 | |
159 | #!/bin/sh | |
c51371c4 | 160 | exec %{_sbindir}/birdc -s /var/run/bird6.ctl |
587f8625 | 161 | EOF |
d1aeed34 | 162 | :> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}6.conf |
587f8625 JK |
163 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-ipv6 |
164 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-ipv6 | |
d84ccda5 | 165 | install %{SOURCE7} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-ipv6.service |
587f8625 | 166 | %endif |
bd846c8e | 167 | |
e7d0d739 JB |
168 | %clean |
169 | rm -rf $RPM_BUILD_ROOT | |
170 | ||
fc243893 AM |
171 | %pre |
172 | %groupadd -g 271 bird | |
173 | %useradd -u 271 -d /usr/share/empty -s /bin/false -c "bird routing daemon" -g bird bird | |
174 | ||
175 | %postun | |
176 | if [ "$1" = "0" ]; then | |
177 | %userremove bird | |
178 | %groupremove bird | |
179 | fi | |
180 | ||
587f8625 | 181 | %post ipv4 |
f3122825 ER |
182 | /sbin/chkconfig --add %{name}-ipv4 |
183 | %service %{name}-ipv4 restart "routing daemon" | |
d84ccda5 | 184 | %systemd_post %{name}-ipv4.service |
7873eba9 | 185 | |
587f8625 | 186 | %preun ipv4 |
cddbae54 | 187 | if [ "$1" = "0" ]; then |
f3122825 ER |
188 | %service %{name}-ipv4 stop |
189 | /sbin/chkconfig --del %{name}-ipv4 | |
587f8625 | 190 | fi |
d84ccda5 JK |
191 | %systemd_preun %{name}-ipv4.service |
192 | ||
193 | %postun ipv4 | |
194 | %systemd_reload | |
587f8625 JK |
195 | |
196 | %post ipv6 | |
f3122825 ER |
197 | /sbin/chkconfig --add %{name}-ipv6 |
198 | %service %{name}-ipv6 restart "routing daemon" | |
d84ccda5 | 199 | %systemd_post %{name}-ipv6.service |
587f8625 JK |
200 | |
201 | %preun ipv6 | |
202 | if [ "$1" = "0" ]; then | |
f3122825 ER |
203 | %service %{name}-ipv6 stop |
204 | /sbin/chkconfig --del %{name}-ipv6 | |
cddbae54 | 205 | fi |
d84ccda5 JK |
206 | %systemd_preun %{name}-ipv6.service |
207 | ||
208 | %postun ipv6 | |
209 | %systemd_reload | |
859a1f4d | 210 | |
4be85d6d | 211 | %triggerpostun ipv4 -- %{name}-ipv4 < 1.3.4-3 |
2c57648d | 212 | chmod 0640 /etc/bird.conf |
8bee0433 AM |
213 | chgrp bird /etc/bird.conf |
214 | ||
d84ccda5 JK |
215 | %triggerpostun -- %{name}-ipv4 < 1.4.5-2 |
216 | %systemd_trigger %{name}-ipv4.service | |
217 | ||
218 | %triggerpostun -- %{name}-ipv6 < 1.4.5-2 | |
219 | %systemd_trigger %{name}-ipv6.service | |
220 | ||
859a1f4d | 221 | %files |
d889a53b | 222 | %defattr(644,root,root,755) |
94972328 | 223 | %doc doc/*.html doc/reply_codes %{name}-doc-%{version}/doc/*.pdf ChangeLog NEWS README |
587f8625 JK |
224 | %attr(755,root,root) %{_sbindir}/birdc |
225 | ||
226 | %if %{with ipv4} | |
227 | %files ipv4 | |
859a1f4d | 228 | %defattr(644,root,root,755) |
587f8625 JK |
229 | %attr(755,root,root) %{_sbindir}/bird |
230 | %attr(754,root,root) /etc/rc.d/init.d/bird-ipv4 | |
a24fb93f | 231 | %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bird-ipv4 |
bf535bdb | 232 | %attr(640,root,bird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bird.conf |
d84ccda5 | 233 | %{systemdunitdir}/%{name}-ipv4.service |
587f8625 | 234 | %endif |
859a1f4d | 235 | |
587f8625 JK |
236 | %if %{with ipv6} |
237 | %files ipv6 | |
238 | %defattr(644,root,root,755) | |
239 | %attr(755,root,root) %{_sbindir}/bird-6 | |
240 | %attr(755,root,root) %{_sbindir}/birdc-6 | |
a24fb93f TP |
241 | %attr(754,root,root) /etc/rc.d/init.d/bird-ipv6 |
242 | %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bird-ipv6 | |
d1aeed34 | 243 | %attr(640,root,bird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bird6.conf |
d84ccda5 | 244 | %{systemdunitdir}/%{name}-ipv6.service |
587f8625 | 245 | %endif |