1 ###############################################################################
2 ###############################################################################
4 ## Copyright (C) 2012-2018 Red Hat, Inc. All rights reserved.
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
10 ###############################################################################
11 ###############################################################################
13 # keep around ready for later user
14 %global alphatag @alphatag@
15 %global numcomm @numcomm@
18 # set defaults from ./configure invokation
27 %@kronosnetd@ kronosnetd
28 %@libnozzle@ libnozzle
29 %@runautogen@ runautogen
30 %@rpmdebuginfo@ rpmdebuginfo
31 %@overriderpmdebuginfo@ overriderpmdebuginfo
34 %if %{with overriderpmdebuginfo}
35 %undefine _enable_debug_packages
42 %global buildcryptonss
1
45 %global buildcryptoopenssl
1
48 %global buildcompresszlib
1
51 %global buildcompresslz4
1
54 %global buildcompresslzo2
1
57 %global buildcompresslzma
1
60 %global buildcompressbzip2
1
63 %global buildlibnozzle
1
65 %if %{with kronosnetd}
66 %global buildlibnozzle
1
67 %global buildkronosnetd
1
69 %if %{with runautogen}
70 %global buildautogen
1
73 %global buildmanpages
1
76 # main (empty) package
77 # http://www.rpm.org/max-rpm/s1-rpm-subpack-spec-file-changes.html
80 Summary: Multipoint
-to
-Multipoint VPN daemon
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
90 BuildRoot: %
(mktemp
-ud
%{_tmppath}/%{name}-%{version}-%{release}-XXXXXX
)
94 # required to build man pages
95 %if %{defined buildmanpages}
96 BuildRequires
: libqb
-devel libxml2
-devel doxygen
98 %if %{defined buildsctp}
99 BuildRequires
: lksctp
-tools
-devel
101 %if %{defined buildcryptonss}
102 BuildRequires
: /usr
/include
/nss3
/nss.h
/usr
/include
/nspr4
/nspr.h
104 %if %{defined buildcryptoopenssl}
105 BuildRequires
: /usr
/include
/openssl
/conf.h
107 %if %{defined buildcompresszlib}
108 BuildRequires
: zlib
-devel
110 %if %{defined buildcompresslz4}
111 BuildRequires
: /usr
/include
/lz4hc.h
113 %if %{defined buildcompresslzo2}
114 BuildRequires
: lzo
-devel
116 %if %{defined buildcompresslzma}
117 BuildRequires
: xz
-devel
119 %if %{defined buildcompressbzip2}
120 BuildRequires
: /usr
/include
/bzlib.h
122 %if %{defined buildkronosnetd}
123 BuildRequires
: pam
-devel
125 %if %{defined buildlibnozzle}
126 BuildRequires
: libnl3
-devel
128 %if %{defined buildautogen}
129 BuildRequires
: autoconf
130 BuildRequires
: automake
131 BuildRequires
: libtool
135 %setup -q
-n
%{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
138 %if %{with runautogen}
143 %if %{defined buildmanpages}
148 %if %{defined buildsctp}
149 --enable-libknet
-sctp \
151 --disable
-libknet
-sctp \
153 %if %{defined buildcryptonss}
154 --enable-crypto
-nss \
156 --disable
-crypto
-nss \
158 %if %{defined buildcryptoopenssl}
159 --enable-crypto
-openssl \
161 --disable
-crypto
-openssl \
163 %if %{defined buildcompresszlib}
164 --enable-compress
-zlib \
166 --disable
-compress
-zlib \
168 %if %{defined buildcompresslz4}
169 --enable-compress
-lz4 \
171 --disable
-compress
-lz4 \
173 %if %{defined buildcompresslzo2}
174 --enable-compress
-lzo2 \
176 --disable
-compress
-lzo2 \
178 %if %{defined buildcompresslzma}
179 --enable-compress
-lzma \
181 --disable
-compress
-lzma \
183 %if %{defined buildcompressbzip2}
184 --enable-compress
-bzip2 \
186 --disable
-compress
-bzip2 \
188 %if %{defined buildkronosnetd}
189 --enable-kronosnetd \
191 %if %{defined buildlibnozzle}
194 --with
-initdefaultdir
=%{_sysconfdir}/sysconfig
/ \
195 %if %{defined _unitdir}
196 --with
-systemddir
=%{_unitdir}
198 --with
-initddir
=%{_sysconfdir}/rc.d
/init.d
/
205 make install DESTDIR
=%{buildroot}
208 # remove static libraries
209 find
%{buildroot} -name "*.a" -exec rm {} \
;
210 # remove libtools leftovers
211 find
%{buildroot} -name "*.la" -exec rm {} \
;
213 # handle systemd vs init script
214 %if %{defined _unitdir}
215 # remove init scripts
216 rm -rf
%{buildroot}/etc
/init.d
218 # remove systemd specific bits
219 find
%{buildroot} -name "*.service" -exec rm {} \
;
223 rm -rf
%{buildroot}/usr
/share
/doc
/kronosnet
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
244 Requires(post
): chkconfig
245 Requires(preun
): chkconfig
, initscripts
247 Requires(post
): shadow
-utils
248 Requires(preun
): shadow
-utils
249 Requires: pam
, /etc
/pam.d
/passwd
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.
262 %if %{defined _unitdir}
263 %if 0%{?systemd_post:1}
264 %systemd_post kronosnetd.service
266 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
269 /sbin
/chkconfig
--add kronosnetd
271 /usr
/sbin
/groupadd
--force
--system @defaultadmgroup@
274 %if %{defined _unitdir}
275 %if 0%{?systemd_preun:1}
276 %systemd_preun kronosnetd.service
278 if [ "$
1"
-eq
0 ]; then
279 /bin
/systemctl
--no
-reload disable kronosnetd.service
280 /bin
/systemctl stop kronosnetd.service
>/dev
/null
2>&1
284 if [ "$
1"
= 0 ]; then
285 /sbin
/service kronosnetd stop
>/dev
/null
2>&1
286 /sbin
/chkconfig
--del 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
301 %config(noreplace
) %{_sysconfdir}/rc.d
/init.d
/kronosnetd
307 %if %{defined buildlibnozzle}
308 %package -n libnozzle1
309 Group: System Environment
/Libraries
310 Summary: Simple userland wrapper around kernel tap devices
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.
318 %defattr(-,root
,root
,-)
319 %doc COPYING.
* COPYRIGHT
320 %{_libdir}/libnozzle.so.
*
322 %post -n libnozzle1
-p
/sbin
/ldconfig
324 %postun -n libnozzle1
-p
/sbin
/ldconfig
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}
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.
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
347 Group: System Environment
/Libraries
348 Summary: Kronosnet core switching implementation
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
356 %defattr(-,root
,root
,-)
357 %doc COPYING.
* COPYRIGHT
358 %{_libdir}/libknet.so.
*
359 %dir %{_libdir}/kronosnet
361 %post -n libknet1
-p
/sbin
/ldconfig
363 %postun -n libknet1
-p
/sbin
/ldconfig
365 %package -n libknet1
-devel
366 Group: Development
/Libraries
367 Summary: Kronosnet core switching implementation
(developer files
)
368 Requires: libknet1
= %{version}-%{release}
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
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
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}
392 %description -n libknet1
-crypto
-nss
-plugin
393 NSS crypto support
for libknet1.
395 %files -n libknet1
-crypto
-nss
-plugin
396 %defattr(-,root
,root
,-)
397 %{_libdir}/kronosnet
/crypto_nss.so
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}
406 %description -n libknet1
-crypto
-openssl
-plugin
407 OpenSSL crypto support
for libknet1.
409 %files -n libknet1
-crypto
-openssl
-plugin
410 %defattr(-,root
,root
,-)
411 %{_libdir}/kronosnet
/crypto_openssl.so
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}
420 %description -n libknet1
-compress
-zlib
-plugin
421 zlib compression support
for libknet1.
423 %files -n libknet1
-compress
-zlib
-plugin
424 %defattr(-,root
,root
,-)
425 %{_libdir}/kronosnet
/compress_zlib.so
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}
433 %description -n libknet1
-compress
-lz4
-plugin
434 lz4 and lz4hc compression support
for libknet1.
436 %files -n libknet1
-compress
-lz4
-plugin
437 %defattr(-,root
,root
,-)
438 %{_libdir}/kronosnet
/compress_lz4.so
439 %{_libdir}/kronosnet
/compress_lz4hc.so
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}
448 %description -n libknet1
-compress
-lzo2
-plugin
449 lzo2 compression support
for libknet1.
451 %files -n libknet1
-compress
-lzo2
-plugin
452 %defattr(-,root
,root
,-)
453 %{_libdir}/kronosnet
/compress_lzo2.so
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}
462 %description -n libknet1
-compress
-lzma
-plugin
463 lzma compression support
for libknet1.
465 %files -n libknet1
-compress
-lzma
-plugin
466 %defattr(-,root
,root
,-)
467 %{_libdir}/kronosnet
/compress_lzma.so
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}
476 %description -n libknet1
-compress
-bzip2
-plugin
477 bzip2 compression support
for libknet1.
479 %files -n libknet1
-compress
-bzip2
-plugin
480 %defattr(-,root
,root
,-)
481 %{_libdir}/kronosnet
/compress_bzip2.so
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
490 %if %{defined buildcryptoopenssl}
491 Requires: libknet1
-crypto
-openssl
-plugin
494 %description -n libknet1
-crypto
-plugins
-all
495 meta package to
install all of libknet1 crypto plugins
497 %files -n libknet1
-crypto
-plugins
-all
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
505 %if %{defined buildcompresslz4}
506 Requires: libknet1
-compress
-lz4
-plugin
508 %if %{defined buildcompresslzo2}
509 Requires: libknet1
-compress
-lzo2
-plugin
511 %if %{defined buildcompresslzma}
512 Requires: libknet1
-compress
-lzma
-plugin
514 %if %{defined buildcompressbzip2}
515 Requires: libknet1
-compress
-bzip2
-plugin
518 %description -n libknet1
-compress
-plugins
-all
519 meta package to
install all of libknet1 compress plugins
521 %files -n libknet1
-compress
-plugins
-all
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
529 %description -n libknet1
-plugins
-all
530 meta package to
install all of libknet1 plugins
532 %files -n libknet1
-plugins
-all
534 %if %{with rpmdebuginfo}
539 * @date@ Autotools generated version
<nobody@nowhere.org
> - @version@
-1-@numcomm@.@alphatag@.@dirty@
540 - These aren't the droids you're looking
for.