]> git.proxmox.com Git - mirror_kronosnet.git/blob - kronosnet.spec.in
[rpm] ship libnozzle man pages
[mirror_kronosnet.git] / kronosnet.spec.in
1 ###############################################################################
2 ###############################################################################
3 ##
4 ## Copyright (C) 2012-2018 Red Hat, Inc. All rights reserved.
5 ##
6 ## This copyrighted material is made available to anyone wishing to use,
7 ## modify, copy, or redistribute it subject to the terms and conditions
8 ## of the GNU General Public License v.2 or higher
9 ##
10 ###############################################################################
11 ###############################################################################
12
13 # keep around ready for later user
14 %global alphatag @alphatag@
15 %global numcomm @numcomm@
16 %global dirty @dirty@
17
18 # set defaults from ./configure invokation
19 %@sctp@ sctp
20 %@nss@ nss
21 %@openssl@ openssl
22 %@zlib@ zlib
23 %@lz4@ lz4
24 %@lzo2@ lzo2
25 %@lzma@ lzma
26 %@bzip2@ bzip2
27 %@kronosnetd@ kronosnetd
28 %@libnozzle@ libnozzle
29 %@runautogen@ runautogen
30 %@rpmdebuginfo@ rpmdebuginfo
31 %@overriderpmdebuginfo@ overriderpmdebuginfo
32 %@buildman@ buildman
33
34 %if %{with overriderpmdebuginfo}
35 %undefine _enable_debug_packages
36 %endif
37
38 %if %{with sctp}
39 %global buildsctp 1
40 %endif
41 %if %{with nss}
42 %global buildcryptonss 1
43 %endif
44 %if %{with openssl}
45 %global buildcryptoopenssl 1
46 %endif
47 %if %{with zlib}
48 %global buildcompresszlib 1
49 %endif
50 %if %{with lz4}
51 %global buildcompresslz4 1
52 %endif
53 %if %{with lzo2}
54 %global buildcompresslzo2 1
55 %endif
56 %if %{with lzma}
57 %global buildcompresslzma 1
58 %endif
59 %if %{with bzip2}
60 %global buildcompressbzip2 1
61 %endif
62 %if %{with libnozzle}
63 %global buildlibnozzle 1
64 %endif
65 %if %{with kronosnetd}
66 %global buildlibnozzle 1
67 %global buildkronosnetd 1
68 %endif
69 %if %{with runautogen}
70 %global buildautogen 1
71 %endif
72 %if %{with buildman}
73 %global buildmanpages 1
74 %endif
75
76 # main (empty) package
77 # http://www.rpm.org/max-rpm/s1-rpm-subpack-spec-file-changes.html
78
79 Name: kronosnet
80 Summary: Multipoint-to-Multipoint VPN daemon
81 Version: @version@
82 Release: 1%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
83 License: GPLv2+ and LGPLv2+
84 Group: System Environment/Base
85 URL: https://github.com/kronosnet/kronosnet/
86 Source0: https://github.com/kronosnet/kronosnet/archive/%{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.gz
87
88 ## Setup/build bits
89
90 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
91
92 # Build dependencies
93 BuildRequires: gcc
94 # required to build man pages
95 %if %{defined buildmanpages}
96 BuildRequires: libqb-devel libxml2-devel doxygen
97 %endif
98 %if %{defined buildsctp}
99 BuildRequires: lksctp-tools-devel
100 %endif
101 %if %{defined buildcryptonss}
102 BuildRequires: /usr/include/nss3/nss.h /usr/include/nspr4/nspr.h
103 %endif
104 %if %{defined buildcryptoopenssl}
105 BuildRequires: /usr/include/openssl/conf.h
106 %endif
107 %if %{defined buildcompresszlib}
108 BuildRequires: zlib-devel
109 %endif
110 %if %{defined buildcompresslz4}
111 BuildRequires: /usr/include/lz4hc.h
112 %endif
113 %if %{defined buildcompresslzo2}
114 BuildRequires: lzo-devel
115 %endif
116 %if %{defined buildcompresslzma}
117 BuildRequires: xz-devel
118 %endif
119 %if %{defined buildcompressbzip2}
120 BuildRequires: /usr/include/bzlib.h
121 %endif
122 %if %{defined buildkronosnetd}
123 BuildRequires: pam-devel
124 %endif
125 %if %{defined buildlibnozzle}
126 BuildRequires: libnl3-devel
127 %endif
128 %if %{defined buildautogen}
129 BuildRequires: autoconf
130 BuildRequires: automake
131 BuildRequires: libtool
132 %endif
133
134 %prep
135 %setup -q -n %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
136
137 %build
138 %if %{with runautogen}
139 ./autogen.sh
140 %endif
141
142 %{configure} \
143 %if %{defined buildmanpages}
144 --enable-man \
145 %else
146 --disable-man \
147 %endif
148 %if %{defined buildsctp}
149 --enable-libknet-sctp \
150 %else
151 --disable-libknet-sctp \
152 %endif
153 %if %{defined buildcryptonss}
154 --enable-crypto-nss \
155 %else
156 --disable-crypto-nss \
157 %endif
158 %if %{defined buildcryptoopenssl}
159 --enable-crypto-openssl \
160 %else
161 --disable-crypto-openssl \
162 %endif
163 %if %{defined buildcompresszlib}
164 --enable-compress-zlib \
165 %else
166 --disable-compress-zlib \
167 %endif
168 %if %{defined buildcompresslz4}
169 --enable-compress-lz4 \
170 %else
171 --disable-compress-lz4 \
172 %endif
173 %if %{defined buildcompresslzo2}
174 --enable-compress-lzo2 \
175 %else
176 --disable-compress-lzo2 \
177 %endif
178 %if %{defined buildcompresslzma}
179 --enable-compress-lzma \
180 %else
181 --disable-compress-lzma \
182 %endif
183 %if %{defined buildcompressbzip2}
184 --enable-compress-bzip2 \
185 %else
186 --disable-compress-bzip2 \
187 %endif
188 %if %{defined buildkronosnetd}
189 --enable-kronosnetd \
190 %endif
191 %if %{defined buildlibnozzle}
192 --enable-libnozzle \
193 %endif
194 --with-initdefaultdir=%{_sysconfdir}/sysconfig/ \
195 %if %{defined _unitdir}
196 --with-systemddir=%{_unitdir}
197 %else
198 --with-initddir=%{_sysconfdir}/rc.d/init.d/
199 %endif
200
201 make %{_smp_mflags}
202
203 %install
204 rm -rf %{buildroot}
205 make install DESTDIR=%{buildroot}
206
207 # tree cleanup
208 # remove static libraries
209 find %{buildroot} -name "*.a" -exec rm {} \;
210 # remove libtools leftovers
211 find %{buildroot} -name "*.la" -exec rm {} \;
212
213 # handle systemd vs init script
214 %if %{defined _unitdir}
215 # remove init scripts
216 rm -rf %{buildroot}/etc/init.d
217 %else
218 # remove systemd specific bits
219 find %{buildroot} -name "*.service" -exec rm {} \;
220 %endif
221
222 # remove docs
223 rm -rf %{buildroot}/usr/share/doc/kronosnet
224
225 %clean
226 rm -rf %{buildroot}
227
228 # main empty package
229 %description
230 kronosnet source
231
232 %if %{defined buildkronosnetd}
233 ## Runtime and subpackages section
234 %package -n kronosnetd
235 Group: System Environment/Base
236 Summary: Multipoint-to-Multipoint VPN daemon
237 %if %{defined _unitdir}
238 # Needed for systemd unit
239 Requires(post): systemd-sysv
240 Requires(post): systemd-units
241 Requires(preun): systemd-units
242 Requires(postun): systemd-units
243 %else
244 Requires(post): chkconfig
245 Requires(preun): chkconfig, initscripts
246 %endif
247 Requires(post): shadow-utils
248 Requires(preun): shadow-utils
249 Requires: pam, /etc/pam.d/passwd
250
251 %description -n kronosnetd
252 The kronosnet daemon is a bridge between kronosnet switching engine
253 and kernel network tap devices, to create and administer a
254 distributed LAN over multipoint-to-multipoint VPNs.
255 The daemon does a poor attempt to provide a configure UI similar
256 to other known network devices/tools (Cisco, quagga).
257 Beside looking horrific, it allows runtime changes and
258 reconfiguration of the kronosnet(s) without daemon reload
259 or service disruption.
260
261 %post -n kronosnetd
262 %if %{defined _unitdir}
263 %if 0%{?systemd_post:1}
264 %systemd_post kronosnetd.service
265 %else
266 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
267 %endif
268 %else
269 /sbin/chkconfig --add kronosnetd
270 %endif
271 /usr/sbin/groupadd --force --system @defaultadmgroup@
272
273 %preun -n kronosnetd
274 %if %{defined _unitdir}
275 %if 0%{?systemd_preun:1}
276 %systemd_preun kronosnetd.service
277 %else
278 if [ "$1" -eq 0 ]; then
279 /bin/systemctl --no-reload disable kronosnetd.service
280 /bin/systemctl stop kronosnetd.service >/dev/null 2>&1
281 fi
282 %endif
283 %else
284 if [ "$1" = 0 ]; then
285 /sbin/service kronosnetd stop >/dev/null 2>&1
286 /sbin/chkconfig --del kronosnetd
287 fi
288 %endif
289
290 %files -n kronosnetd
291 %defattr(-,root,root,-)
292 %doc COPYING.* COPYRIGHT
293 %dir %{_sysconfdir}/kronosnet
294 %dir %{_sysconfdir}/kronosnet/*
295 %config(noreplace) %{_sysconfdir}/sysconfig/kronosnetd
296 %config(noreplace) %{_sysconfdir}/pam.d/kronosnetd
297 %config(noreplace) %{_sysconfdir}/logrotate.d/kronosnetd
298 %if %{defined _unitdir}
299 %{_unitdir}/kronosnetd.service
300 %else
301 %config(noreplace) %{_sysconfdir}/rc.d/init.d/kronosnetd
302 %endif
303 %{_sbindir}/*
304 %{_mandir}/man8/*
305 %endif
306
307 %if %{defined buildlibnozzle}
308 %package -n libnozzle1
309 Group: System Environment/Libraries
310 Summary: Simple userland wrapper around kernel tap devices
311
312 %description -n libnozzle1
313 This is an over-engineered commodity library to manage a pool
314 of tap devices and provides the basic
315 pre-up.d/up.d/down.d/post-down.d infrastructure.
316
317 %files -n libnozzle1
318 %defattr(-,root,root,-)
319 %doc COPYING.* COPYRIGHT
320 %{_libdir}/libnozzle.so.*
321
322 %post -n libnozzle1 -p /sbin/ldconfig
323
324 %postun -n libnozzle1 -p /sbin/ldconfig
325
326 %package -n libnozzle1-devel
327 Group: Development/Libraries
328 Summary: Simple userland wrapper around kernel tap devices (developer files)
329 Requires: libnozzle1 = %{version}-%{release}
330 Requires: pkgconfig
331
332 %description -n libnozzle1-devel
333 This is an over-engineered commodity library to manage a pool
334 of tap devices and provides the basic
335 pre-up.d/up.d/down.d/post-down.d infrastructure.
336
337 %files -n libnozzle1-devel
338 %defattr(-,root,root,-)
339 %doc COPYING.* COPYRIGHT
340 %{_libdir}/libnozzle.so
341 %{_includedir}/libnozzle.h
342 %{_libdir}/pkgconfig/libnozzle.pc
343 %{_mandir}/man3/nozzle*.3.gz
344 %endif
345
346 %package -n libknet1
347 Group: System Environment/Libraries
348 Summary: Kronosnet core switching implementation
349
350 %description -n libknet1
351 The whole kronosnet core is implemented in this library.
352 Please refer to the not-yet-existing documentation for further
353 information.
354
355 %files -n libknet1
356 %defattr(-,root,root,-)
357 %doc COPYING.* COPYRIGHT
358 %{_libdir}/libknet.so.*
359 %dir %{_libdir}/kronosnet
360
361 %post -n libknet1 -p /sbin/ldconfig
362
363 %postun -n libknet1 -p /sbin/ldconfig
364
365 %package -n libknet1-devel
366 Group: Development/Libraries
367 Summary: Kronosnet core switching implementation (developer files)
368 Requires: libknet1 = %{version}-%{release}
369 Requires: pkgconfig
370
371 %description -n libknet1-devel
372 The whole kronosnet core is implemented in this library.
373 Please refer to the not-yet-existing documentation for further
374 information.
375
376 %files -n libknet1-devel
377 %defattr(-,root,root,-)
378 %doc COPYING.* COPYRIGHT
379 %{_libdir}/libknet.so
380 %{_includedir}/libknet.h
381 %{_libdir}/pkgconfig/libknet.pc
382 %if %{defined buildmanpages}
383 %{_mandir}/man3/knet*.3.gz
384 %endif
385
386 %if %{defined buildcryptonss}
387 %package -n libknet1-crypto-nss-plugin
388 Group: System Environment/Libraries
389 Summary: libknet1 nss support
390 Requires: libknet1 = %{version}-%{release}
391
392 %description -n libknet1-crypto-nss-plugin
393 NSS crypto support for libknet1.
394
395 %files -n libknet1-crypto-nss-plugin
396 %defattr(-,root,root,-)
397 %{_libdir}/kronosnet/crypto_nss.so
398 %endif
399
400 %if %{defined buildcryptoopenssl}
401 %package -n libknet1-crypto-openssl-plugin
402 Group: System Environment/Libraries
403 Summary: libknet1 openssl support
404 Requires: libknet1 = %{version}-%{release}
405
406 %description -n libknet1-crypto-openssl-plugin
407 OpenSSL crypto support for libknet1.
408
409 %files -n libknet1-crypto-openssl-plugin
410 %defattr(-,root,root,-)
411 %{_libdir}/kronosnet/crypto_openssl.so
412 %endif
413
414 %if %{defined buildcompresszlib}
415 %package -n libknet1-compress-zlib-plugin
416 Group: System Environment/Libraries
417 Summary: libknet1 zlib support
418 Requires: libknet1 = %{version}-%{release}
419
420 %description -n libknet1-compress-zlib-plugin
421 zlib compression support for libknet1.
422
423 %files -n libknet1-compress-zlib-plugin
424 %defattr(-,root,root,-)
425 %{_libdir}/kronosnet/compress_zlib.so
426 %endif
427 %if %{defined buildcompresslz4}
428 %package -n libknet1-compress-lz4-plugin
429 Group: System Environment/Libraries
430 Summary: libknet1 lz4 and lz4hc support
431 Requires: libknet1 = %{version}-%{release}
432
433 %description -n libknet1-compress-lz4-plugin
434 lz4 and lz4hc compression support for libknet1.
435
436 %files -n libknet1-compress-lz4-plugin
437 %defattr(-,root,root,-)
438 %{_libdir}/kronosnet/compress_lz4.so
439 %{_libdir}/kronosnet/compress_lz4hc.so
440 %endif
441
442 %if %{defined buildcompresslzo2}
443 %package -n libknet1-compress-lzo2-plugin
444 Group: System Environment/Libraries
445 Summary: libknet1 lzo2 support
446 Requires: libknet1 = %{version}-%{release}
447
448 %description -n libknet1-compress-lzo2-plugin
449 lzo2 compression support for libknet1.
450
451 %files -n libknet1-compress-lzo2-plugin
452 %defattr(-,root,root,-)
453 %{_libdir}/kronosnet/compress_lzo2.so
454 %endif
455
456 %if %{defined buildcompresslzma}
457 %package -n libknet1-compress-lzma-plugin
458 Group: System Environment/Libraries
459 Summary: libknet1 lzma support
460 Requires: libknet1 = %{version}-%{release}
461
462 %description -n libknet1-compress-lzma-plugin
463 lzma compression support for libknet1.
464
465 %files -n libknet1-compress-lzma-plugin
466 %defattr(-,root,root,-)
467 %{_libdir}/kronosnet/compress_lzma.so
468 %endif
469
470 %if %{defined buildcompressbzip2}
471 %package -n libknet1-compress-bzip2-plugin
472 Group: System Environment/Libraries
473 Summary: libknet1 bzip2 support
474 Requires: libknet1 = %{version}-%{release}
475
476 %description -n libknet1-compress-bzip2-plugin
477 bzip2 compression support for libknet1.
478
479 %files -n libknet1-compress-bzip2-plugin
480 %defattr(-,root,root,-)
481 %{_libdir}/kronosnet/compress_bzip2.so
482 %endif
483
484 %package -n libknet1-crypto-plugins-all
485 Group: System Environment/Libraries
486 Summary: libknet1 crypto plugins meta package
487 %if %{defined buildcryptonss}
488 Requires: libknet1-crypto-nss-plugin
489 %endif
490 %if %{defined buildcryptoopenssl}
491 Requires: libknet1-crypto-openssl-plugin
492 %endif
493
494 %description -n libknet1-crypto-plugins-all
495 meta package to install all of libknet1 crypto plugins
496
497 %files -n libknet1-crypto-plugins-all
498
499 %package -n libknet1-compress-plugins-all
500 Group: System Environment/Libraries
501 Summary: libknet1 compress plugins meta package
502 %if %{defined buildcompresszlib}
503 Requires: libknet1-compress-zlib-plugin
504 %endif
505 %if %{defined buildcompresslz4}
506 Requires: libknet1-compress-lz4-plugin
507 %endif
508 %if %{defined buildcompresslzo2}
509 Requires: libknet1-compress-lzo2-plugin
510 %endif
511 %if %{defined buildcompresslzma}
512 Requires: libknet1-compress-lzma-plugin
513 %endif
514 %if %{defined buildcompressbzip2}
515 Requires: libknet1-compress-bzip2-plugin
516 %endif
517
518 %description -n libknet1-compress-plugins-all
519 meta package to install all of libknet1 compress plugins
520
521 %files -n libknet1-compress-plugins-all
522
523 %package -n libknet1-plugins-all
524 Group: System Environment/Libraries
525 Summary: libknet1 plugins meta package
526 Requires: libknet1-compress-plugins-all
527 Requires: libknet1-crypto-plugins-all
528
529 %description -n libknet1-plugins-all
530 meta package to install all of libknet1 plugins
531
532 %files -n libknet1-plugins-all
533
534 %if %{with rpmdebuginfo}
535 %debug_package
536 %endif
537
538 %changelog
539 * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
540 - These aren't the droids you're looking for.
541