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