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 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564
|
###############################################################################
###############################################################################
##
## Copyright (C) 2012-2019 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
## of the GNU General Public License v.2 or higher
##
###############################################################################
###############################################################################
# keep around ready for later user
%global alphatag @alphatag@
%global numcomm @numcomm@
%global dirty @dirty@
# set defaults from ./configure invokation
%@sctp@ sctp
%@nss@ nss
%@openssl@ openssl
%@zlib@ zlib
%@lz4@ lz4
%@lzo2@ lzo2
%@lzma@ lzma
%@bzip2@ bzip2
%@kronosnetd@ kronosnetd
%@libnozzle@ libnozzle
%@runautogen@ runautogen
%@rpmdebuginfo@ rpmdebuginfo
%@overriderpmdebuginfo@ overriderpmdebuginfo
%@buildman@ buildman
%@installtests@ installtests
%if %{with overriderpmdebuginfo}
%undefine _enable_debug_packages
%endif
%if %{with sctp}
%global buildsctp 1
%endif
%if %{with nss}
%global buildcryptonss 1
%endif
%if %{with openssl}
%global buildcryptoopenssl 1
%endif
%if %{with zlib}
%global buildcompresszlib 1
%endif
%if %{with lz4}
%global buildcompresslz4 1
%endif
%if %{with lzo2}
%global buildcompresslzo2 1
%endif
%if %{with lzma}
%global buildcompresslzma 1
%endif
%if %{with bzip2}
%global buildcompressbzip2 1
%endif
%if %{with libnozzle}
%global buildlibnozzle 1
%endif
%if %{with kronosnetd}
%global buildlibnozzle 1
%global buildkronosnetd 1
%endif
%if %{with runautogen}
%global buildautogen 1
%endif
%if %{with buildman}
%global buildmanpages 1
%endif
%if %{with installtests}
%global installtestsuite 1
%endif
# main (empty) package
# http://www.rpm.org/max-rpm/s1-rpm-subpack-spec-file-changes.html
Name: kronosnet
Summary: Multipoint-to-Multipoint VPN daemon
Version: @version@
Release: 1%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: GPLv2+ and LGPLv2+
Group: System Environment/Base
URL: https://github.com/kronosnet/kronosnet/
Source0: https://github.com/kronosnet/kronosnet/archive/%{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.gz
## Setup/build bits
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
# Build dependencies
BuildRequires: gcc
# required to build man pages
%if %{defined buildmanpages}
BuildRequires: libqb-devel libxml2-devel doxygen
%endif
%if %{defined buildsctp}
BuildRequires: lksctp-tools-devel
%endif
%if %{defined buildcryptonss}
BuildRequires: /usr/include/nss3/nss.h /usr/include/nspr4/nspr.h
%endif
%if %{defined buildcryptoopenssl}
BuildRequires: /usr/include/openssl/conf.h
%endif
%if %{defined buildcompresszlib}
BuildRequires: zlib-devel
%endif
%if %{defined buildcompresslz4}
BuildRequires: /usr/include/lz4hc.h
%endif
%if %{defined buildcompresslzo2}
BuildRequires: lzo-devel
%endif
%if %{defined buildcompresslzma}
BuildRequires: xz-devel
%endif
%if %{defined buildcompressbzip2}
BuildRequires: /usr/include/bzlib.h
%endif
%if %{defined buildkronosnetd}
BuildRequires: pam-devel
%endif
%if %{defined buildlibnozzle}
BuildRequires: libnl3-devel
%endif
%if %{defined buildautogen}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
%endif
%prep
%setup -q -n %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
%build
%if %{with runautogen}
./autogen.sh
%endif
%{configure} \
%if %{defined installtestsuite}
--enable-install-tests \
%else
--disable-install-tests \
%endif
%if %{defined buildmanpages}
--enable-man \
%else
--disable-man \
%endif
%if %{defined buildsctp}
--enable-libknet-sctp \
%else
--disable-libknet-sctp \
%endif
%if %{defined buildcryptonss}
--enable-crypto-nss \
%else
--disable-crypto-nss \
%endif
%if %{defined buildcryptoopenssl}
--enable-crypto-openssl \
%else
--disable-crypto-openssl \
%endif
%if %{defined buildcompresszlib}
--enable-compress-zlib \
%else
--disable-compress-zlib \
%endif
%if %{defined buildcompresslz4}
--enable-compress-lz4 \
%else
--disable-compress-lz4 \
%endif
%if %{defined buildcompresslzo2}
--enable-compress-lzo2 \
%else
--disable-compress-lzo2 \
%endif
%if %{defined buildcompresslzma}
--enable-compress-lzma \
%else
--disable-compress-lzma \
%endif
%if %{defined buildcompressbzip2}
--enable-compress-bzip2 \
%else
--disable-compress-bzip2 \
%endif
%if %{defined buildkronosnetd}
--enable-kronosnetd \
%endif
%if %{defined buildlibnozzle}
--enable-libnozzle \
%endif
--with-initdefaultdir=%{_sysconfdir}/sysconfig/ \
%if %{defined _unitdir}
--with-systemddir=%{_unitdir}
%else
--with-initddir=%{_sysconfdir}/rc.d/init.d/
%endif
make %{_smp_mflags}
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
# tree cleanup
# remove static libraries
find %{buildroot} -name "*.a" -exec rm {} \;
# remove libtools leftovers
find %{buildroot} -name "*.la" -exec rm {} \;
# handle systemd vs init script
%if %{defined _unitdir}
# remove init scripts
rm -rf %{buildroot}/etc/init.d
%else
# remove systemd specific bits
find %{buildroot} -name "*.service" -exec rm {} \;
%endif
# remove docs
rm -rf %{buildroot}/usr/share/doc/kronosnet
%clean
rm -rf %{buildroot}
# main empty package
%description
kronosnet source
%if %{defined buildkronosnetd}
## Runtime and subpackages section
%package -n kronosnetd
Group: System Environment/Base
Summary: Multipoint-to-Multipoint VPN daemon
%if %{defined _unitdir}
# Needed for systemd unit
Requires(post): systemd-sysv
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
%else
Requires(post): chkconfig
Requires(preun): chkconfig, initscripts
%endif
Requires(post): shadow-utils
Requires(preun): shadow-utils
Requires: pam, /etc/pam.d/passwd
%description -n kronosnetd
The kronosnet daemon is a bridge between kronosnet switching engine
and kernel network tap devices, to create and administer a
distributed LAN over multipoint-to-multipoint VPNs.
The daemon does a poor attempt to provide a configure UI similar
to other known network devices/tools (Cisco, quagga).
Beside looking horrific, it allows runtime changes and
reconfiguration of the kronosnet(s) without daemon reload
or service disruption.
%post -n kronosnetd
%if %{defined _unitdir}
%if 0%{?systemd_post:1}
%systemd_post kronosnetd.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
%else
/sbin/chkconfig --add kronosnetd
%endif
/usr/sbin/groupadd --force --system @defaultadmgroup@
%preun -n kronosnetd
%if %{defined _unitdir}
%if 0%{?systemd_preun:1}
%systemd_preun kronosnetd.service
%else
if [ "$1" -eq 0 ]; then
/bin/systemctl --no-reload disable kronosnetd.service
/bin/systemctl stop kronosnetd.service >/dev/null 2>&1
fi
%endif
%else
if [ "$1" = 0 ]; then
/sbin/service kronosnetd stop >/dev/null 2>&1
/sbin/chkconfig --del kronosnetd
fi
%endif
%files -n kronosnetd
%defattr(-,root,root,-)
%doc COPYING.* COPYRIGHT
%dir %{_sysconfdir}/kronosnet
%dir %{_sysconfdir}/kronosnet/*
%config(noreplace) %{_sysconfdir}/sysconfig/kronosnetd
%config(noreplace) %{_sysconfdir}/pam.d/kronosnetd
%config(noreplace) %{_sysconfdir}/logrotate.d/kronosnetd
%if %{defined _unitdir}
%{_unitdir}/kronosnetd.service
%else
%config(noreplace) %{_sysconfdir}/rc.d/init.d/kronosnetd
%endif
%{_sbindir}/*
%{_mandir}/man8/*
%endif
%if %{defined buildlibnozzle}
%package -n libnozzle1
Group: System Environment/Libraries
Summary: Simple userland wrapper around kernel tap devices
%description -n libnozzle1
This is an over-engineered commodity library to manage a pool
of tap devices and provides the basic
pre-up.d/up.d/down.d/post-down.d infrastructure.
%files -n libnozzle1
%defattr(-,root,root,-)
%doc COPYING.* COPYRIGHT
%{_libdir}/libnozzle.so.*
%post -n libnozzle1 -p /sbin/ldconfig
%postun -n libnozzle1 -p /sbin/ldconfig
%package -n libnozzle1-devel
Group: Development/Libraries
Summary: Simple userland wrapper around kernel tap devices (developer files)
Requires: libnozzle1 = %{version}-%{release}
Requires: pkgconfig
%description -n libnozzle1-devel
This is an over-engineered commodity library to manage a pool
of tap devices and provides the basic
pre-up.d/up.d/down.d/post-down.d infrastructure.
%files -n libnozzle1-devel
%defattr(-,root,root,-)
%doc COPYING.* COPYRIGHT
%{_libdir}/libnozzle.so
%{_includedir}/libnozzle.h
%{_libdir}/pkgconfig/libnozzle.pc
%{_mandir}/man3/nozzle*.3.gz
%endif
%package -n libknet1
Group: System Environment/Libraries
Summary: Kronosnet core switching implementation
%description -n libknet1
The whole kronosnet core is implemented in this library.
Please refer to the not-yet-existing documentation for further
information.
%files -n libknet1
%defattr(-,root,root,-)
%doc COPYING.* COPYRIGHT
%{_libdir}/libknet.so.*
%dir %{_libdir}/kronosnet
%post -n libknet1 -p /sbin/ldconfig
%postun -n libknet1 -p /sbin/ldconfig
%package -n libknet1-devel
Group: Development/Libraries
Summary: Kronosnet core switching implementation (developer files)
Requires: libknet1 = %{version}-%{release}
Requires: pkgconfig
%description -n libknet1-devel
The whole kronosnet core is implemented in this library.
Please refer to the not-yet-existing documentation for further
information.
%files -n libknet1-devel
%defattr(-,root,root,-)
%doc COPYING.* COPYRIGHT
%{_libdir}/libknet.so
%{_includedir}/libknet.h
%{_libdir}/pkgconfig/libknet.pc
%if %{defined buildmanpages}
%{_mandir}/man3/knet*.3.gz
%endif
%if %{defined buildcryptonss}
%package -n libknet1-crypto-nss-plugin
Group: System Environment/Libraries
Summary: libknet1 nss support
Requires: libknet1 = %{version}-%{release}
%description -n libknet1-crypto-nss-plugin
NSS crypto support for libknet1.
%files -n libknet1-crypto-nss-plugin
%defattr(-,root,root,-)
%{_libdir}/kronosnet/crypto_nss.so
%endif
%if %{defined buildcryptoopenssl}
%package -n libknet1-crypto-openssl-plugin
Group: System Environment/Libraries
Summary: libknet1 openssl support
Requires: libknet1 = %{version}-%{release}
%description -n libknet1-crypto-openssl-plugin
OpenSSL crypto support for libknet1.
%files -n libknet1-crypto-openssl-plugin
%defattr(-,root,root,-)
%{_libdir}/kronosnet/crypto_openssl.so
%endif
%if %{defined buildcompresszlib}
%package -n libknet1-compress-zlib-plugin
Group: System Environment/Libraries
Summary: libknet1 zlib support
Requires: libknet1 = %{version}-%{release}
%description -n libknet1-compress-zlib-plugin
zlib compression support for libknet1.
%files -n libknet1-compress-zlib-plugin
%defattr(-,root,root,-)
%{_libdir}/kronosnet/compress_zlib.so
%endif
%if %{defined buildcompresslz4}
%package -n libknet1-compress-lz4-plugin
Group: System Environment/Libraries
Summary: libknet1 lz4 and lz4hc support
Requires: libknet1 = %{version}-%{release}
%description -n libknet1-compress-lz4-plugin
lz4 and lz4hc compression support for libknet1.
%files -n libknet1-compress-lz4-plugin
%defattr(-,root,root,-)
%{_libdir}/kronosnet/compress_lz4.so
%{_libdir}/kronosnet/compress_lz4hc.so
%endif
%if %{defined buildcompresslzo2}
%package -n libknet1-compress-lzo2-plugin
Group: System Environment/Libraries
Summary: libknet1 lzo2 support
Requires: libknet1 = %{version}-%{release}
%description -n libknet1-compress-lzo2-plugin
lzo2 compression support for libknet1.
%files -n libknet1-compress-lzo2-plugin
%defattr(-,root,root,-)
%{_libdir}/kronosnet/compress_lzo2.so
%endif
%if %{defined buildcompresslzma}
%package -n libknet1-compress-lzma-plugin
Group: System Environment/Libraries
Summary: libknet1 lzma support
Requires: libknet1 = %{version}-%{release}
%description -n libknet1-compress-lzma-plugin
lzma compression support for libknet1.
%files -n libknet1-compress-lzma-plugin
%defattr(-,root,root,-)
%{_libdir}/kronosnet/compress_lzma.so
%endif
%if %{defined buildcompressbzip2}
%package -n libknet1-compress-bzip2-plugin
Group: System Environment/Libraries
Summary: libknet1 bzip2 support
Requires: libknet1 = %{version}-%{release}
%description -n libknet1-compress-bzip2-plugin
bzip2 compression support for libknet1.
%files -n libknet1-compress-bzip2-plugin
%defattr(-,root,root,-)
%{_libdir}/kronosnet/compress_bzip2.so
%endif
%package -n libknet1-crypto-plugins-all
Group: System Environment/Libraries
Summary: libknet1 crypto plugins meta package
%if %{defined buildcryptonss}
Requires: libknet1-crypto-nss-plugin
%endif
%if %{defined buildcryptoopenssl}
Requires: libknet1-crypto-openssl-plugin
%endif
%description -n libknet1-crypto-plugins-all
meta package to install all of libknet1 crypto plugins
%files -n libknet1-crypto-plugins-all
%package -n libknet1-compress-plugins-all
Group: System Environment/Libraries
Summary: libknet1 compress plugins meta package
%if %{defined buildcompresszlib}
Requires: libknet1-compress-zlib-plugin
%endif
%if %{defined buildcompresslz4}
Requires: libknet1-compress-lz4-plugin
%endif
%if %{defined buildcompresslzo2}
Requires: libknet1-compress-lzo2-plugin
%endif
%if %{defined buildcompresslzma}
Requires: libknet1-compress-lzma-plugin
%endif
%if %{defined buildcompressbzip2}
Requires: libknet1-compress-bzip2-plugin
%endif
%description -n libknet1-compress-plugins-all
meta package to install all of libknet1 compress plugins
%files -n libknet1-compress-plugins-all
%package -n libknet1-plugins-all
Group: System Environment/Libraries
Summary: libknet1 plugins meta package
Requires: libknet1-compress-plugins-all
Requires: libknet1-crypto-plugins-all
%description -n libknet1-plugins-all
meta package to install all of libknet1 plugins
%files -n libknet1-plugins-all
%if %{with installtests}
%package -n kronosnet-tests
Group: System Environment/Libraries
Summary: kronosnet test suite
Requires: libknet1 = %{version}-%{release}
%description -n kronosnet-tests
this package contains all the libknet and libnozzle test suite
%files -n kronosnet-tests
%defattr(-,root,root,-)
%{_libdir}/kronosnet/tests/*
%endif
%if %{with rpmdebuginfo}
%debug_package
%endif
%changelog
* @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
- These aren't the droids you're looking for.
|