diff --git a/kronosnet.spec.in b/kronosnet.spec.in index de316560..b5632ae3 100644 --- a/kronosnet.spec.in +++ b/kronosnet.spec.in @@ -1,609 +1,569 @@ ############################################################################### ############################################################################### ## ## 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 %@zstd@ zstd %@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 zstd} -%global buildcompresszstd 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://kronosnet.org Source0: https://kronosnet.org/releases/%{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} +%if %{with buildman} BuildRequires: libqb-devel libxml2-devel doxygen %endif -%if %{defined buildsctp} +%if %{with sctp} BuildRequires: lksctp-tools-devel %endif -%if %{defined buildcryptonss} +%if %{with nss} %if 0%{?suse_version} BuildRequires: mozilla-nss-devel %else BuildRequires: nss-devel %endif %endif -%if %{defined buildcryptoopenssl} +%if %{with openssl} %if 0%{?suse_version} BuildRequires: libopenssl-devel %else BuildRequires: openssl-devel %endif %endif -%if %{defined buildcompresszlib} +%if %{with zlib} BuildRequires: zlib-devel %endif -%if %{defined buildcompresslz4} +%if %{with lz4} %if 0%{?suse_version} BuildRequires: liblz4-devel %else BuildRequires: lz4-devel %endif %endif -%if %{defined buildcompresslzo2} +%if %{with lzo2} BuildRequires: lzo-devel %endif -%if %{defined buildcompresslzma} +%if %{with lzma} BuildRequires: xz-devel %endif -%if %{defined buildcompressbzip2} +%if %{with bzip2} %if 0%{?suse_version} BuildRequires: libbz2-devel %else BuildRequires: bzip2-devel %endif %endif -%if %{defined buildcompresszstd} +%if %{with zstd} BuildRequires: libzstd-devel %endif -%if %{defined buildkronosnetd} +%if %{with kronosnetd} BuildRequires: pam-devel %endif -%if %{defined buildlibnozzle} +%if %{with libnozzle} BuildRequires: libnl3-devel %endif -%if %{defined buildautogen} -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: libtool +%if %{with runautogen} +BuildRequires: autoconf automake 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} +%if %{with installtests} --enable-install-tests \ %else --disable-install-tests \ %endif -%if %{defined buildmanpages} +%if %{with buildman} --enable-man \ %else --disable-man \ %endif -%if %{defined buildsctp} +%if %{with sctp} --enable-libknet-sctp \ %else --disable-libknet-sctp \ %endif -%if %{defined buildcryptonss} +%if %{with nss} --enable-crypto-nss \ %else --disable-crypto-nss \ %endif -%if %{defined buildcryptoopenssl} +%if %{with openssl} --enable-crypto-openssl \ %else --disable-crypto-openssl \ %endif -%if %{defined buildcompresszlib} +%if %{with zlib} --enable-compress-zlib \ %else --disable-compress-zlib \ %endif -%if %{defined buildcompresslz4} +%if %{with lz4} --enable-compress-lz4 \ %else --disable-compress-lz4 \ %endif -%if %{defined buildcompresslzo2} +%if %{with lzo2} --enable-compress-lzo2 \ %else --disable-compress-lzo2 \ %endif -%if %{defined buildcompresslzma} +%if %{with lzma} --enable-compress-lzma \ %else --disable-compress-lzma \ %endif -%if %{defined buildcompressbzip2} +%if %{with bzip2} --enable-compress-bzip2 \ %else --disable-compress-bzip2 \ %endif -%if %{defined buildcompresszstd} +%if %{with zstd} --enable-compress-zstd \ %else --disable-compress-zstd \ %endif -%if %{defined buildkronosnetd} +%if %{with kronosnetd} --enable-kronosnetd \ +%else + --disable-kronosnetd \ %endif -%if %{defined buildlibnozzle} +%if %{with libnozzle} --enable-libnozzle \ +%else + --disable-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} +%if %{with kronosnetd} ## 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} +%if %{with libnozzle} %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%{_isa} = %{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 +%if %{with buildman} %{_mandir}/man3/nozzle*.3.gz %endif +%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%{_isa} = %{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} +%if %{with buildman} %{_mandir}/man3/knet*.3.gz %endif -%if %{defined buildcryptonss} +%if %{with nss} %package -n libknet1-crypto-nss-plugin Group: System Environment/Libraries Summary: libknet1 nss support Requires: libknet1%{_isa} = %{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} +%if %{with openssl} %package -n libknet1-crypto-openssl-plugin Group: System Environment/Libraries Summary: libknet1 openssl support Requires: libknet1%{_isa} = %{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} +%if %{with zlib} %package -n libknet1-compress-zlib-plugin Group: System Environment/Libraries Summary: libknet1 zlib support Requires: libknet1%{_isa} = %{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} +%if %{with lz4} %package -n libknet1-compress-lz4-plugin Group: System Environment/Libraries Summary: libknet1 lz4 and lz4hc support Requires: libknet1%{_isa} = %{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} +%if %{with lzo2} %package -n libknet1-compress-lzo2-plugin Group: System Environment/Libraries Summary: libknet1 lzo2 support Requires: libknet1%{_isa} = %{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} +%if %{with lzma} %package -n libknet1-compress-lzma-plugin Group: System Environment/Libraries Summary: libknet1 lzma support Requires: libknet1%{_isa} = %{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} +%if %{with bzip2} %package -n libknet1-compress-bzip2-plugin Group: System Environment/Libraries Summary: libknet1 bzip2 support Requires: libknet1%{_isa} = %{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 -%if %{defined buildcompresszstd} +%if %{with zstd} %package -n libknet1-compress-zstd-plugin Group: System Environment/Libraries Summary: libknet1 zstd support Requires: libknet1%{_isa} = %{version}-%{release} %description -n libknet1-compress-zstd-plugin zstd compression support for libknet1. %files -n libknet1-compress-zstd-plugin %defattr(-,root,root,-) %{_libdir}/kronosnet/compress_zstd.so %endif %package -n libknet1-crypto-plugins-all Group: System Environment/Libraries Summary: libknet1 crypto plugins meta package -%if %{defined buildcryptonss} +%if %{with nss} Requires: libknet1-crypto-nss-plugin%{_isa} = %{version}-%{release} %endif -%if %{defined buildcryptoopenssl} +%if %{with openssl} Requires: libknet1-crypto-openssl-plugin%{_isa} = %{version}-%{release} %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} +%if %{with zlib} Requires: libknet1-compress-zlib-plugin%{_isa} = %{version}-%{release} %endif -%if %{defined buildcompresslz4} +%if %{with lz4} Requires: libknet1-compress-lz4-plugin%{_isa} = %{version}-%{release} %endif -%if %{defined buildcompresslzo2} +%if %{with lzo2} Requires: libknet1-compress-lzo2-plugin%{_isa} = %{version}-%{release} %endif -%if %{defined buildcompresslzma} +%if %{with lzma} Requires: libknet1-compress-lzma-plugin%{_isa} = %{version}-%{release} %endif -%if %{defined buildcompressbzip2} +%if %{with bzip2} Requires: libknet1-compress-bzip2-plugin%{_isa} = %{version}-%{release} %endif -%if %{defined buildcompresszstd} +%if %{with zstd} Requires: libknet1-compress-zstd-plugin%{_isa} = %{version}-%{release} %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%{_isa} = %{version}-%{release} Requires: libknet1-crypto-plugins-all%{_isa} = %{version}-%{release} %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%{_isa} = %{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 - @version@-1-@numcomm@.@alphatag@.@dirty@ - These aren't the droids you're looking for.