]> git.pld-linux.org Git - packages/bird.git/blob - bird.spec
- switch to https
[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.6.8
13 Release:        1
14 License:        GPL v2+
15 Group:          Networking/Daemons
16 Source0:        https://bird.network.cz/download/%{name}-%{version}.tar.gz
17 # Source0-md5:  abe29a927e21a3d7f8092641f06093c2
18 Source1:        %{name}-ipv4.init
19 Source2:        %{name}-ipv4.sysconfig
20 Source3:        %{name}-ipv6.init
21 Source4:        %{name}-ipv6.sysconfig
22 Source5:        https://bird.network.cz/download/%{name}-doc-%{version}.tar.gz
23 # Source5-md5:  d5b69caeee629479e0261aba18d35758
24 Source6:        %{name}-ipv4.service
25 Source7:        %{name}-ipv6.service
26 Patch0:         %{name}-allowalien.patch
27 Patch1:         gcc.patch
28 URL:            https://bird.network.cz/
29 BuildRequires:  autoconf
30 BuildRequires:  automake
31 BuildRequires:  bison
32 BuildRequires:  flex
33 BuildRequires:  readline-devel >= 4.2
34 BuildRequires:  rpmbuild(macros) >= 1.268
35 Requires(post,preun):   /sbin/chkconfig
36 Requires:       bird-daemon
37 Requires:       rc-scripts
38 Requires(postun):       /usr/sbin/userdel
39 Requires(pre):  /usr/sbin/useradd
40 Obsoletes:      gated
41 Obsoletes:      mrt
42 Obsoletes:      zebra
43 Obsoletes:      zebra-guile
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
52 %description -l pl.UTF-8
53 Projekt BIRD ma na celu utworzenie daemona dynamicznego routingu
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.
57
58 %package ipv4
59 Summary:        Routing daemon for IPv4
60 Summary(pl.UTF-8):      Demon dynamicznego routingu IPv4
61 Group:          Networking/Daemons
62 Requires(post,preun):   /sbin/chkconfig
63 Requires:       %{name} = %{version}-%{release}
64 Requires:       rc-scripts
65 Provides:       bird-daemon
66 Provides:       routingdaemon
67 Obsoletes:      gated
68 Obsoletes:      mrt
69 Obsoletes:      zebra
70 Obsoletes:      zebra-guile
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
78 %description ipv4 -l pl.UTF-8
79 Projekt BIRD ma na celu utworzenie daemona dynamicznego routingu
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.
83
84 %package ipv6
85 Summary:        Routing daemon for IPv6
86 Summary(pl.UTF-8):      Demon dynamicznego routingu IPv6
87 Group:          Networking/Daemons
88 Requires(post,preun):   /sbin/chkconfig
89 Requires:       %{name} = %{version}-%{release}
90 Requires:       rc-scripts
91 Provides:       bird-daemon
92 Provides:       routingdaemon
93 Obsoletes:      gated
94 Obsoletes:      mrt
95 Obsoletes:      zebra
96 Obsoletes:      zebra-guile
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
104 %description ipv6 -l pl.UTF-8
105 Projekt BIRD ma na celu utworzenie daemona dynamicznego routingu
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.
109
110 %prep
111 %setup -q -a 5
112 %{?with_alien:%patch0 -p1}
113 %patch1 -p1
114
115 %build
116 cp -f /usr/share/automake/config.* tools
117 %{__autoconf}
118
119 export CFLAGS="%{rpmcflags} -I%{_includedir}/ncursesw -fno-strict-aliasing -fno-strict-overflow"
120
121 %if %{with ipv6}
122 %configure \
123         --disable-memcheck \
124         --enable-client \
125         --enable-ipv6
126 %{__make} -j1
127
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
138 %{__make} -j1
139 %endif
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/sysconfig,%{_sbindir}} \
144         $RPM_BUILD_ROOT%{systemdunitdir}
145
146 install birdc $RPM_BUILD_ROOT%{_sbindir}
147
148 %if %{with ipv4}
149 install bird $RPM_BUILD_ROOT%{_sbindir}
150 install doc/bird.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
151 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-ipv4
152 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-ipv4
153 install %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-ipv4.service
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
160 exec %{_sbindir}/birdc -s /var/run/bird6.ctl
161 EOF
162 :> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}6.conf
163 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-ipv6
164 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-ipv6
165 install %{SOURCE7} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-ipv6.service
166 %endif
167
168 %clean
169 rm -rf $RPM_BUILD_ROOT
170
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
181 %post ipv4
182 /sbin/chkconfig --add %{name}-ipv4
183 %service %{name}-ipv4 restart "routing daemon"
184 %systemd_post %{name}-ipv4.service
185
186 %preun ipv4
187 if [ "$1" = "0" ]; then
188         %service %{name}-ipv4 stop
189         /sbin/chkconfig --del %{name}-ipv4
190 fi
191 %systemd_preun %{name}-ipv4.service
192
193 %postun ipv4
194 %systemd_reload
195
196 %post ipv6
197 /sbin/chkconfig --add %{name}-ipv6
198 %service %{name}-ipv6 restart "routing daemon"
199 %systemd_post %{name}-ipv6.service
200
201 %preun ipv6
202 if [ "$1" = "0" ]; then
203         %service %{name}-ipv6 stop
204         /sbin/chkconfig --del %{name}-ipv6
205 fi
206 %systemd_preun %{name}-ipv6.service
207
208 %postun ipv6
209 %systemd_reload
210
211 %triggerpostun ipv4 -- %{name}-ipv4 < 1.3.4-3
212 chmod 0640 /etc/bird.conf
213 chgrp bird /etc/bird.conf
214
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
221 %files
222 %defattr(644,root,root,755)
223 %doc doc/*.html doc/reply_codes %{name}-doc-%{version}/doc/*.pdf ChangeLog NEWS README 
224 %attr(755,root,root) %{_sbindir}/birdc
225
226 %if %{with ipv4}
227 %files ipv4
228 %defattr(644,root,root,755)
229 %attr(755,root,root) %{_sbindir}/bird
230 %attr(754,root,root) /etc/rc.d/init.d/bird-ipv4
231 %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bird-ipv4
232 %attr(640,root,bird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bird.conf
233 %{systemdunitdir}/%{name}-ipv4.service
234 %endif
235
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
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
243 %attr(640,root,bird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bird6.conf
244 %{systemdunitdir}/%{name}-ipv6.service
245 %endif
This page took 0.15104 seconds and 3 git commands to generate.