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
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
65 %if %{with kronosnetd}
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 buildautogen}
126 BuildRequires
: autoconf
127 BuildRequires
: automake
128 BuildRequires
: libtool
132 %setup -q
-n
%{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
135 %if %{with runautogen}
140 %if %{defined buildmanpages}
145 %if %{defined buildsctp}
146 --enable-libknet
-sctp \
148 --disable
-libknet
-sctp \
150 %if %{defined buildcryptonss}
151 --enable-crypto
-nss \
153 --disable
-crypto
-nss \
155 %if %{defined buildcryptoopenssl}
156 --enable-crypto
-openssl \
158 --disable
-crypto
-openssl \
160 %if %{defined buildcompresszlib}
161 --enable-compress
-zlib \
163 --disable
-compress
-zlib \
165 %if %{defined buildcompresslz4}
166 --enable-compress
-lz4 \
168 --disable
-compress
-lz4 \
170 %if %{defined buildcompresslzo2}
171 --enable-compress
-lzo2 \
173 --disable
-compress
-lzo2 \
175 %if %{defined buildcompresslzma}
176 --enable-compress
-lzma \
178 --disable
-compress
-lzma \
180 %if %{defined buildcompressbzip2}
181 --enable-compress
-bzip2 \
183 --disable
-compress
-bzip2 \
185 %if %{defined buildkronosnetd}
186 --enable-kronosnetd \
188 %if %{defined buildlibtap}
191 --with
-initdefaultdir
=%{_sysconfdir}/sysconfig
/ \
192 %if %{defined _unitdir}
193 --with
-systemddir
=%{_unitdir}
195 --with
-initddir
=%{_sysconfdir}/rc.d
/init.d
/
202 make install DESTDIR
=%{buildroot}
205 # remove static libraries
206 find
%{buildroot} -name "*.a" -exec rm {} \
;
207 # remove libtools leftovers
208 find
%{buildroot} -name "*.la" -exec rm {} \
;
210 # handle systemd vs init script
211 %if %{defined _unitdir}
212 # remove init scripts
213 rm -rf
%{buildroot}/etc
/init.d
215 # remove systemd specific bits
216 find
%{buildroot} -name "*.service" -exec rm {} \
;
220 rm -rf
%{buildroot}/usr
/share
/doc
/kronosnet
229 %if %{defined buildkronosnetd}
230 ## Runtime and subpackages section
231 %package -n kronosnetd
232 Group: System Environment
/Base
233 Summary: Multipoint
-to
-Multipoint VPN daemon
234 %if %{defined _unitdir}
235 # Needed for systemd unit
236 Requires(post
): systemd
-sysv
237 Requires(post
): systemd
-units
238 Requires(preun
): systemd
-units
239 Requires(postun
): systemd
-units
241 Requires(post
): chkconfig
242 Requires(preun
): chkconfig
, initscripts
244 Requires(post
): shadow
-utils
245 Requires(preun
): shadow
-utils
246 Requires: pam
, /etc
/pam.d
/passwd
248 %description -n kronosnetd
249 The kronosnet daemon is a bridge between kronosnet switching engine
250 and kernel network tap devices
, to create and administer a
251 distributed LAN over multipoint
-to
-multipoint VPNs.
252 The daemon does a poor attempt to provide a configure UI similar
253 to other known network devices
/tools
(Cisco
, quagga
).
254 Beside looking horrific
, it allows runtime changes and
255 reconfiguration of the kronosnet
(s
) without daemon reload
256 or service disruption.
259 %if %{defined _unitdir}
260 %if 0%{?systemd_post:1}
261 %systemd_post kronosnetd.service
263 /bin
/systemctl daemon
-reload
>/dev
/null
2>&1 ||
:
266 /sbin
/chkconfig
--add kronosnetd
268 /usr
/sbin
/groupadd
--force
--system @defaultadmgroup@
271 %if %{defined _unitdir}
272 %if 0%{?systemd_preun:1}
273 %systemd_preun kronosnetd.service
275 if [ "$
1"
-eq
0 ]; then
276 /bin
/systemctl
--no
-reload disable kronosnetd.service
277 /bin
/systemctl stop kronosnetd.service
>/dev
/null
2>&1
281 if [ "$
1"
= 0 ]; then
282 /sbin
/service kronosnetd stop
>/dev
/null
2>&1
283 /sbin
/chkconfig
--del kronosnetd
288 %defattr(-,root
,root
,-)
289 %doc COPYING.
* COPYRIGHT
290 %dir %{_sysconfdir}/kronosnet
291 %dir %{_sysconfdir}/kronosnet
/*
292 %config(noreplace
) %{_sysconfdir}/sysconfig
/kronosnetd
293 %config(noreplace
) %{_sysconfdir}/pam.d
/kronosnetd
294 %config(noreplace
) %{_sysconfdir}/logrotate.d
/kronosnetd
295 %if %{defined _unitdir}
296 %{_unitdir}/kronosnetd.service
298 %config(noreplace
) %{_sysconfdir}/rc.d
/init.d
/kronosnetd
304 %if %{defined buildlibtap}
306 Group: System Environment
/Libraries
307 Summary: Simple userland wrapper around kernel tap devices
309 %description -n libtap1
310 This is an over
-engineered commodity library to manage a pool
311 of tap devices and provides the basic
312 pre
-up.d
/up.d
/down.d
/post
-down.d infrastructure.
315 %defattr(-,root
,root
,-)
316 %doc COPYING.
* COPYRIGHT
317 %{_libdir}/libtap.so.
*
319 %post -n libtap1
-p
/sbin
/ldconfig
321 %postun -n libtap1
-p
/sbin
/ldconfig
323 %package -n libtap1
-devel
324 Group: Development
/Libraries
325 Summary: Simple userland wrapper around kernel tap devices
(developer files
)
326 Requires: libtap1
= %{version}-%{release}
329 %description -n libtap1
-devel
330 This is an over
-engineered commodity library to manage a pool
331 of tap devices and provides the basic
332 pre
-up.d
/up.d
/down.d
/post
-down.d infrastructure.
334 %files -n libtap1
-devel
335 %defattr(-,root
,root
,-)
336 %doc COPYING.
* COPYRIGHT
338 %{_includedir}/libtap.h
339 %{_libdir}/pkgconfig
/libtap.pc
343 Group: System Environment
/Libraries
344 Summary: Kronosnet core switching implementation
346 %description -n libknet1
347 The whole kronosnet core is implemented
in this library.
348 Please refer to the not
-yet
-existing documentation
for further
352 %defattr(-,root
,root
,-)
353 %doc COPYING.
* COPYRIGHT
354 %{_libdir}/libknet.so.
*
355 %dir %{_libdir}/kronosnet
357 %post -n libknet1
-p
/sbin
/ldconfig
359 %postun -n libknet1
-p
/sbin
/ldconfig
361 %package -n libknet1
-devel
362 Group: Development
/Libraries
363 Summary: Kronosnet core switching implementation
(developer files
)
364 Requires: libknet1
= %{version}-%{release}
367 %description -n libknet1
-devel
368 The whole kronosnet core is implemented
in this library.
369 Please refer to the not
-yet
-existing documentation
for further
372 %files -n libknet1
-devel
373 %defattr(-,root
,root
,-)
374 %doc COPYING.
* COPYRIGHT
375 %{_libdir}/libknet.so
376 %{_includedir}/libknet.h
377 %{_libdir}/pkgconfig
/libknet.pc
378 %if %{defined buildmanpages}
379 %{_mandir}/man3
/knet
*.3.gz
382 %if %{defined buildcryptonss}
383 %package -n libknet1
-crypto
-nss
-plugin
384 Group: System Environment
/Libraries
385 Summary: libknet1 nss support
386 Requires: libknet1
= %{version}-%{release}
388 %description -n libknet1
-crypto
-nss
-plugin
389 NSS crypto support
for libknet1.
391 %files -n libknet1
-crypto
-nss
-plugin
392 %defattr(-,root
,root
,-)
393 %{_libdir}/kronosnet
/crypto_nss.so
396 %if %{defined buildcryptoopenssl}
397 %package -n libknet1
-crypto
-openssl
-plugin
398 Group: System Environment
/Libraries
399 Summary: libknet1 openssl support
400 Requires: libknet1
= %{version}-%{release}
402 %description -n libknet1
-crypto
-openssl
-plugin
403 OpenSSL crypto support
for libknet1.
405 %files -n libknet1
-crypto
-openssl
-plugin
406 %defattr(-,root
,root
,-)
407 %{_libdir}/kronosnet
/crypto_openssl.so
410 %if %{defined buildcompresszlib}
411 %package -n libknet1
-compress
-zlib
-plugin
412 Group: System Environment
/Libraries
413 Summary: libknet1 zlib support
414 Requires: libknet1
= %{version}-%{release}
416 %description -n libknet1
-compress
-zlib
-plugin
417 zlib compression support
for libknet1.
419 %files -n libknet1
-compress
-zlib
-plugin
420 %defattr(-,root
,root
,-)
421 %{_libdir}/kronosnet
/compress_zlib.so
423 %if %{defined buildcompresslz4}
424 %package -n libknet1
-compress
-lz4
-plugin
425 Group: System Environment
/Libraries
426 Summary: libknet1 lz4 and lz4hc support
427 Requires: libknet1
= %{version}-%{release}
429 %description -n libknet1
-compress
-lz4
-plugin
430 lz4 and lz4hc compression support
for libknet1.
432 %files -n libknet1
-compress
-lz4
-plugin
433 %defattr(-,root
,root
,-)
434 %{_libdir}/kronosnet
/compress_lz4.so
435 %{_libdir}/kronosnet
/compress_lz4hc.so
438 %if %{defined buildcompresslzo2}
439 %package -n libknet1
-compress
-lzo2
-plugin
440 Group: System Environment
/Libraries
441 Summary: libknet1 lzo2 support
442 Requires: libknet1
= %{version}-%{release}
444 %description -n libknet1
-compress
-lzo2
-plugin
445 lzo2 compression support
for libknet1.
447 %files -n libknet1
-compress
-lzo2
-plugin
448 %defattr(-,root
,root
,-)
449 %{_libdir}/kronosnet
/compress_lzo2.so
452 %if %{defined buildcompresslzma}
453 %package -n libknet1
-compress
-lzma
-plugin
454 Group: System Environment
/Libraries
455 Summary: libknet1 lzma support
456 Requires: libknet1
= %{version}-%{release}
458 %description -n libknet1
-compress
-lzma
-plugin
459 lzma compression support
for libknet1.
461 %files -n libknet1
-compress
-lzma
-plugin
462 %defattr(-,root
,root
,-)
463 %{_libdir}/kronosnet
/compress_lzma.so
466 %if %{defined buildcompressbzip2}
467 %package -n libknet1
-compress
-bzip2
-plugin
468 Group: System Environment
/Libraries
469 Summary: libknet1 bzip2 support
470 Requires: libknet1
= %{version}-%{release}
472 %description -n libknet1
-compress
-bzip2
-plugin
473 bzip2 compression support
for libknet1.
475 %files -n libknet1
-compress
-bzip2
-plugin
476 %defattr(-,root
,root
,-)
477 %{_libdir}/kronosnet
/compress_bzip2.so
480 %package -n libknet1
-crypto
-plugins
-all
481 Group: System Environment
/Libraries
482 Summary: libknet1 crypto plugins meta package
483 %if %{defined buildcryptonss}
484 Requires: libknet1
-crypto
-nss
-plugin
486 %if %{defined buildcryptoopenssl}
487 Requires: libknet1
-crypto
-openssl
-plugin
490 %description -n libknet1
-crypto
-plugins
-all
491 meta package to
install all of libknet1 crypto plugins
493 %files -n libknet1
-crypto
-plugins
-all
495 %package -n libknet1
-compress
-plugins
-all
496 Group: System Environment
/Libraries
497 Summary: libknet1 compress plugins meta package
498 %if %{defined buildcompresszlib}
499 Requires: libknet1
-compress
-zlib
-plugin
501 %if %{defined buildcompresslz4}
502 Requires: libknet1
-compress
-lz4
-plugin
504 %if %{defined buildcompresslzo2}
505 Requires: libknet1
-compress
-lzo2
-plugin
507 %if %{defined buildcompresslzma}
508 Requires: libknet1
-compress
-lzma
-plugin
510 %if %{defined buildcompressbzip2}
511 Requires: libknet1
-compress
-bzip2
-plugin
514 %description -n libknet1
-compress
-plugins
-all
515 meta package to
install all of libknet1 compress plugins
517 %files -n libknet1
-compress
-plugins
-all
519 %package -n libknet1
-plugins
-all
520 Group: System Environment
/Libraries
521 Summary: libknet1 plugins meta package
522 Requires: libknet1
-compress
-plugins
-all
523 Requires: libknet1
-crypto
-plugins
-all
525 %description -n libknet1
-plugins
-all
526 meta package to
install all of libknet1 plugins
528 %files -n libknet1
-plugins
-all
530 %if %{with rpmdebuginfo}
535 * @date@ Autotools generated version
<nobody@nowhere.org
> - @version@
-1-@numcomm@.@alphatag@.@dirty@
536 - These aren't the droids you're looking
for.