-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathquagga.spec
308 lines (264 loc) · 9.47 KB
/
quagga.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
%define with_pimd 0
%define with_fpm 1
%define quagga_uid 92
%define quagga_gid 92
%define vty_group quaggavt
%define vty_gid 85
%global _hardened_build 1
Name: quagga
Version: 1.0.20160315
Release: 1%{?dist}
Summary: Routing daemon
License: GPLv2+
Group: System Environment/Daemons
URL: http://www.quagga.net
Source0: http://download.savannah.gnu.org/releases/quagga/%{name}-%{version}.tar.xz
Source1: quagga-filter-perl-requires.sh
Source2: quagga-tmpfs.conf
BuildRequires: autoconf
BuildRequires: gawk
BuildRequires: gcc
BuildRequires: libcap-devel
BuildRequires: make
BuildRequires: ncurses
BuildRequires: ncurses-devel
BuildRequires: net-snmp-devel
BuildRequires: readline
BuildRequires: readline-devel
BuildRequires: systemd
BuildRequires: texi2html
BuildRequires: texinfo
BuildRequires: texlive-tetex
Requires: net-snmp
Requires: ncurses
Requires(post): systemd /sbin/install-info
Requires(preun): systemd /sbin/install-info
Requires(postun): systemd
Provides: routingdaemon = %{version}-%{release}
Obsoletes: quagga-sysvinit
Patch0: 0001-systemd-change-the-WantedBy-target.patch
Patch1: 0002-zebra-raise-the-privileges-before-calling-socket.patch
%if %with_pimd
Patch2: 0003-quagga-pimd-service-and-init.patch
%endif
%define __perl_requires %{SOURCE1}
%description
Quagga is free software that operates TCP/IP-based routing protocols. It takes
a multi-server and multi-threaded approach to resolving the current complexity
of the Internet.
Quagga supports Babel, BGP4, BGP4+, BGP4-, IS-IS (experimental), OSPFv2,
OSPFv3, PIM, RIPv1, RIPv2, and RIPng.
Quagga is intended to be used as a Route Server and a Route Reflector. It is
not a toolkit; it provides full routing power under a new architecture.
Quagga by design has a process for each protocol.
Quagga is a fork of GNU Zebra.
%package contrib
Summary: Contrib tools for quagga
Group: System Environment/Daemons
%description contrib
Contributed/3rd party tools which may be of use with quagga.
%package devel
Summary: Header and object files for quagga development
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
%description devel
The quagga-devel package contains the header and object files necessary for
developing OSPF-API and quagga applications.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%if %with_pimd
%patch2 -p1
%endif
%build
%configure \
--sysconfdir=%{_sysconfdir}/quagga \
--libdir=%{_libdir}/quagga \
--libexecdir=%{_libexecdir}/quagga \
--localstatedir=%{_localstatedir}/run/quagga \
--enable-ipv6=yes \
--enable-isisd=yes \
%if %with_pimd
--enable-pimd=yes \
%endif
--enable-snmp=agentx \
--enable-multipath=64 \
--enable-opaque-lsa \
--enable-ospf-te \
--enable-vtysh=yes \
--enable-ospfclient=no \
--enable-ospfapi=no \
--enable-user=quagga \
--enable-group=quagga \
--enable-vty-group=%vty_group \
--enable-rtadv \
--disable-exampledir \
--enable-netlink \
%if %with_fpm
--enable-tcp-zebra \
--enable-fpm \
%endif
--enable-gcc-rdynamic \
--with-pkg-extra-version=-CloudRouter-Edition
make %{?_smp_mflags} MAKEINFO="makeinfo --no-split" CFLAGS="%{optflags} -fno-strict-aliasing"
pushd doc
texi2html quagga.texi
popd
%install
mkdir -p %{buildroot}/etc/{quagga,rc.d/init.d,sysconfig,logrotate.d} \
%{buildroot}/var/log/quagga %{buildroot}%{_infodir} \
%{buildroot}%{_unitdir}
make DESTDIR=%{buildroot} INSTALL="install -p" CP="cp -p" install
# Remove this file, as it is uninstalled and causes errors when building on RH9
rm -rf %{buildroot}/usr/share/info/dir
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/zebra.service %{buildroot}%{_unitdir}/zebra.service
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/isisd.service %{buildroot}%{_unitdir}/isisd.service
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/ripd.service %{buildroot}%{_unitdir}/ripd.service
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/ospfd.service %{buildroot}%{_unitdir}/ospfd.service
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/bgpd.service %{buildroot}%{_unitdir}/bgpd.service
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/babeld.service %{buildroot}%{_unitdir}/babeld.service
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/ospf6d.service %{buildroot}%{_unitdir}/ospf6d.service
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/ripngd.service %{buildroot}%{_unitdir}/ripngd.service
%if %with_pimd
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/pimd.service %{buildroot}%{_unitdir}/pimd.service
%endif
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/quagga.sysconfig %{buildroot}/etc/sysconfig/quagga
install -p -m 644 %{_builddir}/%{name}-%{version}/redhat/quagga.logrotate %{buildroot}/etc/logrotate.d/quagga
install -d -m 770 %{buildroot}/var/run/quagga
install -d -m 755 %{buildroot}/%{_tmpfilesdir}
install -p -m 644 %{SOURCE2} %{buildroot}/%{_tmpfilesdir}/quagga.conf
rm %{buildroot}%{_libdir}/quagga/*.a
rm %{buildroot}%{_libdir}/quagga/*.la
%pre
getent group %vty_group >/dev/null 2>&1 || groupadd -r -g %vty_gid %vty_group >/dev/null 2>&1 || :
getent group quagga >/dev/null 2>&1 || groupadd -g %quagga_gid quagga >/dev/null 2>&1 || :
getent passwd quagga >/dev/null 2>&1 || useradd -u %quagga_uid -g %quagga_gid -M -r -s /sbin/nologin \
-c "Quagga routing suite" -d %{_localstatedir}/run/quagga quagga >/dev/null 2>&1 || :
%post
%systemd_post zebra.service
%systemd_post isisd.service
%systemd_post ripd.service
%systemd_post ospfd.service
%systemd_post bgpd.service
%systemd_post babeld.service
%systemd_post ospf6d.service
%systemd_post ripngd.service
%if %with_pimd
%systemd_post pimd.service
%endif
if [ -f %{_infodir}/%{name}.inf* ]; then
install-info %{_infodir}/quagga.info %{_infodir}/dir || :
fi
# Create dummy files if they don't exist so basic functions can be used.
if [ ! -e %{_sysconfdir}/quagga/zebra.conf ]; then
echo "hostname `hostname`" > %{_sysconfdir}/quagga/zebra.conf
chown quagga:quagga %{_sysconfdir}/quagga/zebra.conf
chmod 640 %{_sysconfdir}/quagga/zebra.conf
fi
if [ ! -e %{_sysconfdir}/quagga/vtysh.conf ]; then
touch %{_sysconfdir}/quagga/vtysh.conf
chmod 640 %{_sysconfdir}/quagga/vtysh.conf
chown quagga:%{vty_group} %{_sysconfdir}/quagga/vtysh.conf
fi
conf_files=(bgpd.conf ospfd.conf ospf6d.conf \
isisd.conf ripd.conf ripngd.conf
)
for conf in "${conf_files[@]}"
do
if [ ! -e %{_sysconfdir}/quagga/${conf} ]; then
touch %{_sysconfdir}/quagga/${conf}
chmod 640 %{_sysconfdir}/quagga/${conf}
chown quagga:quagga %{_sysconfdir}/quagga/${conf}
fi
done
%if %with_pimd
if [ ! -e %{_sysconfdir}/quagga/pimd.conf ]; then
touch %{_sysconfdir}/quagga/pimd.conf
chmod 640 %{_sysconfdir}/quagga/pimd.conf
chown quagga:quagga %{_sysconfdir}/quagga/pimd.conf
fi
%endif
semanage boolean --modify --on zebra_write_config
%postun
%systemd_postun_with_restart zebra.service
%systemd_postun_with_restart isisd.service
%systemd_postun_with_restart ripd.service
%systemd_postun_with_restart ospfd.service
%systemd_postun_with_restart bgpd.service
%systemd_postun_with_restart babeld.service
%systemd_postun_with_restart ospf6d.service
%systemd_postun_with_restart ripngd.service
%if %with_pimd
%systemd_postun_with_restart pimd.service
%endif
if [ -f %{_infodir}/%{name}.inf* ]; then
install-info --delete %{_infodir}/quagga.info %{_infodir}/dir || :
fi
%preun
%systemd_preun zebra.service
%systemd_preun isisd.service
%systemd_preun ripd.service
%systemd_preun ospfd.service
%systemd_preun bgpd.service
%systemd_preun babeld.service
%systemd_preun ospf6d.service
%systemd_preun ripngd.service
%if %with_pimd
%systemd_preun pimd.service
%endif
%files
%defattr(-,root,root)
%doc AUTHORS COPYING
%doc zebra/zebra.conf.sample
%doc isisd/isisd.conf.sample
%doc ripd/ripd.conf.sample
%doc bgpd/bgpd.conf.sample*
%doc ospfd/ospfd.conf.sample
%doc ospf6d/ospf6d.conf.sample
%doc ripngd/ripngd.conf.sample
%doc doc/quagga.html
%doc doc/mpls
%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
%dir %attr(750,quagga,quagga) %{_sysconfdir}/quagga
%dir %attr(750,quagga,quagga) /var/log/quagga
%dir %attr(750,quagga,quagga) /var/run/quagga
%{_infodir}/*info*
%{_mandir}/man*/*
%exclude %{_mandir}/man*/watchquagga.*
%{_sbindir}/*
%exclude %{_sbindir}/watchquagga
%{_bindir}/*
%dir %{_libdir}/quagga
%{_libdir}/quagga/*.so.*
%config(noreplace) %attr(640,root,root) /etc/logrotate.d/quagga
%config(noreplace) /etc/sysconfig/quagga
%{_tmpfilesdir}/quagga.conf
%{_unitdir}/*.service
%files contrib
%defattr(-,root,root)
%doc AUTHORS COPYING %attr(0644,root,root) tools
%files devel
%defattr(-,root,root)
%doc AUTHORS COPYING
%dir %{_libdir}/quagga/
%{_libdir}/quagga/*.so
%dir %{_includedir}/quagga
%{_includedir}/quagga/*.h
%dir %{_includedir}/quagga/ospfd
%{_includedir}/quagga/ospfd/*.h
%changelog
* Mon Oct 17 2016 John Siegrist <[email protected] - 1.0.20160315-1
- Update version to 1.0.20160315
* Tue Dec 29 2015 John Siegrist <[email protected] - 9.99.24.1-5
- Updated the BuildRequires dependencies in the spec file.
* Thu Jun 11 2015 Martin Winter <[email protected]> 0.99.24.1-4
- Added conditional PIMd (disabled by default as it's experimental) to SPEC
- Added conditional FPM interface (enabled by default) to SPEC
- Removed Babel (Was removed just after 0.99.24.1 from Quagga Distribution
for licensing issues)
- Marked Quagga Version as CloudRouter edition
- forced enable-gcc-rdynamic to make sure to improve chances for
tracebacks in crashes
* Mon May 4 2015 Jay Turner <[email protected]> - 0.99.24.1
- Initial build