kronosnet/kronosnet.spec

489 lines
12 KiB
RPMSpec
Raw Normal View History

2018-03-20 22:07:32 +00:00
###############################################################################
###############################################################################
##
## Copyright (C) 2012-2018 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
##
###############################################################################
###############################################################################
# set defaults from ./configure invokation
%bcond_without sctp
%bcond_without nss
%bcond_without openssl
%bcond_without zlib
%bcond_without lz4
%bcond_without lzo2
%bcond_without lzma
%bcond_without bzip2
%bcond_with kronosnetd
%bcond_with libtap
%bcond_with runautogen
%bcond_with rpmdebuginfo
%bcond_with overriderpmdebuginfo
2018-11-27 21:50:24 +00:00
%bcond_without buildman
2018-03-20 22:07:32 +00:00
%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 libtap}
%global buildlibtap 1
%endif
%if %{with kronosnetd}
%global buildlibtap 1
%global buildkronosnetd 1
%endif
%if %{with runautogen}
%global buildautogen 1
%endif
2018-11-27 21:50:24 +00:00
%if %{with buildman}
%global buildmanpages 1
%endif
2018-03-20 22:07:32 +00:00
# main (empty) package
# http://www.rpm.org/max-rpm/s1-rpm-subpack-spec-file-changes.html
Name: kronosnet
Summary: Multipoint-to-Multipoint VPN daemon
2018-11-27 21:50:24 +00:00
Version: 1.5
2018-08-15 02:55:36 +00:00
Release: 1%{?dist}
2018-03-20 22:07:32 +00:00
License: GPLv2+ and LGPLv2+
URL: http://www.kronosnet.org
Source0: http://www.kronosnet.org/releases/kronosnet-%{version}.tar.gz
2018-11-27 21:50:24 +00:00
2018-03-20 22:07:32 +00:00
# Build dependencies
BuildRequires: gcc
# required to build man pages
2018-11-27 21:50:24 +00:00
%if %{defined buildmanpages}
BuildRequires: libqb-devel libxml2-devel doxygen
%endif
2018-03-20 22:07:32 +00:00
%if %{defined buildsctp}
BuildRequires: lksctp-tools-devel
%endif
%if %{defined buildcryptonss}
BuildRequires: nss-devel
%endif
%if %{defined buildcryptoopenssl}
BuildRequires: openssl-devel
%endif
%if %{defined buildcompresszlib}
BuildRequires: zlib-devel
%endif
%if %{defined buildcompresslz4}
BuildRequires: lz4-devel
%endif
%if %{defined buildcompresslzo2}
BuildRequires: lzo-devel
%endif
%if %{defined buildcompresslzma}
BuildRequires: xz-devel
%endif
%if %{defined buildcompressbzip2}
BuildRequires: bzip2-devel
%endif
%if %{defined buildkronosnetd}
BuildRequires: pam-devel
%endif
%if %{defined buildautogen}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
%endif
%prep
%setup -q -n %{name}-%{version}
%build
%if %{with runautogen}
./autogen.sh
%endif
%{configure} \
2018-11-27 21:50:24 +00:00
%if %{defined buildmanpages}
--enable-man \
%else
--disable-man \
%endif
2018-03-20 22:07:32 +00:00
%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 buildlibtap}
--enable-libtap \
%endif
--with-systemddir=%{_unitdir}
make %{_smp_mflags}
%install
2018-11-27 21:50:24 +00:00
rm -rf %{buildroot}
2018-03-20 22:07:32 +00:00
make install DESTDIR=%{buildroot}
# tree cleanup
# remove static libraries
find %{buildroot} -name "*.a" -exec rm {} \;
# remove libtools leftovers
find %{buildroot} -name "*.la" -exec rm {} \;
2018-11-27 21:50:24 +00:00
# remove systemd specific bits
find %{buildroot} -name "*.service" -exec rm {} \;
2018-03-20 22:07:32 +00:00
# remove docs
rm -rf %{buildroot}/usr/share/doc/kronosnet
# Disabled because of concern that the testsuite does not play nice with the
# network loopback interface. Upstream has a comprehensive CI/CD system which
# tests different versions of Fedora and should be very safe. In the unlikely
# event of bugs, we should probably avoid DoS´ing the fedora builders by
# generating unwanted traffic.
#%check
# main empty package
%description
kronosnet source
%if %{defined buildkronosnetd}
## Runtime and subpackages section
%package -n kronosnetd
Summary: Multipoint-to-Multipoint VPN daemon
2018-11-27 21:50:24 +00:00
# Needed for systemd unit
Requires(post): systemd-sysv
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(post): shadow-utils
Requires(preun): shadow-utils
2018-03-20 22:07:32 +00:00
Requires: pam, /etc/pam.d/passwd
%description -n kronosnetd
2018-11-27 21:50:24 +00:00
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.
2018-03-20 22:07:32 +00:00
%post -n kronosnetd
2018-11-27 21:50:24 +00:00
%if 0%{?systemd_post:1}
%systemd_post kronosnetd.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
/usr/sbin/groupadd --force --system kronosnetadm
2018-03-20 22:07:32 +00:00
%preun -n kronosnetd
2018-11-27 21:50:24 +00:00
%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
2018-03-20 22:07:32 +00:00
%files -n kronosnetd
2018-11-27 21:50:24 +00:00
%license COPYING.* COPYRIGHT
2018-03-20 22:07:32 +00:00
%dir %{_sysconfdir}/kronosnet
%dir %{_sysconfdir}/kronosnet/*
%config(noreplace) %{_sysconfdir}/sysconfig/kronosnetd
%config(noreplace) %{_sysconfdir}/pam.d/kronosnetd
%config(noreplace) %{_sysconfdir}/logrotate.d/kronosnetd
%{_unitdir}/kronosnetd.service
%{_sbindir}/*
%{_mandir}/man8/*
%endif
%if %{defined buildlibtap}
%package -n libtap1
Summary: Simple userland wrapper around kernel tap devices
License: LGPLv2+
%description -n libtap1
2018-11-27 21:50:24 +00:00
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.
2018-03-20 22:07:32 +00:00
%files -n libtap1
%license COPYING.* COPYRIGHT
%{_libdir}/libtap.so.*
2018-11-27 21:50:24 +00:00
%post -n libtap1 -p /sbin/ldconfig
%postun -n libtap1 -p /sbin/ldconfig
2018-03-20 22:07:32 +00:00
%package -n libtap1-devel
Summary: Simple userland wrapper around kernel tap devices (developer files)
License: LGPLv2+
Requires: libtap1%{_isa} = %{version}-%{release}
Requires: pkgconfig
%description -n libtap1-devel
2018-11-27 21:50:24 +00:00
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.
2018-03-20 22:07:32 +00:00
%files -n libtap1-devel
%license COPYING.* COPYRIGHT
%{_libdir}/libtap.so
%{_includedir}/libtap.h
%{_libdir}/pkgconfig/libtap.pc
%endif
%package -n libknet1
2018-11-27 21:50:24 +00:00
Summary: Kronosnet core switching implementation
2018-03-20 22:07:32 +00:00
License: LGPLv2+
%description -n libknet1
2018-11-27 21:50:24 +00:00
The whole kronosnet core is implemented in this library.
Please refer to the not-yet-existing documentation for further
information.
2018-03-20 22:07:32 +00:00
%files -n libknet1
%license COPYING.* COPYRIGHT
%{_libdir}/libknet.so.*
%dir %{_libdir}/kronosnet
2018-11-27 21:50:24 +00:00
%post -n libknet1 -p /sbin/ldconfig
%postun -n libknet1 -p /sbin/ldconfig
2018-03-20 22:07:32 +00:00
%package -n libknet1-devel
Summary: Kronosnet core switching implementation (developer files)
License: LGPLv2+
Requires: libknet1%{_isa} = %{version}-%{release}
Requires: pkgconfig
%description -n libknet1-devel
2018-11-27 21:50:24 +00:00
The whole kronosnet core is implemented in this library.
Please refer to the not-yet-existing documentation for further
information.
2018-03-20 22:07:32 +00:00
%files -n libknet1-devel
%{_libdir}/libknet.so
%{_includedir}/libknet.h
%{_libdir}/pkgconfig/libknet.pc
2018-11-27 21:50:24 +00:00
%if %{defined buildmanpages}
%{_mandir}/man3/knet*.3.gz
%endif
2018-03-20 22:07:32 +00:00
%if %{defined buildcryptonss}
%package -n libknet1-crypto-nss-plugin
2018-11-27 21:50:24 +00:00
Summary: libknet1 nss support
2018-03-20 22:07:32 +00:00
License: LGPLv2+
Requires: libknet1%{_isa} = %{version}-%{release}
%description -n libknet1-crypto-nss-plugin
2018-11-27 21:50:24 +00:00
NSS crypto support for libknet1.
2018-03-20 22:07:32 +00:00
%files -n libknet1-crypto-nss-plugin
%{_libdir}/kronosnet/crypto_nss.so
%endif
%if %{defined buildcryptoopenssl}
%package -n libknet1-crypto-openssl-plugin
2018-11-27 21:50:24 +00:00
Summary: libknet1 openssl support
2018-03-20 22:07:32 +00:00
License: LGPLv2+
Requires: libknet1%{_isa} = %{version}-%{release}
%description -n libknet1-crypto-openssl-plugin
2018-11-27 21:50:24 +00:00
OpenSSL crypto support for libknet1.
2018-03-20 22:07:32 +00:00
%files -n libknet1-crypto-openssl-plugin
%{_libdir}/kronosnet/crypto_openssl.so
%endif
%if %{defined buildcompresszlib}
%package -n libknet1-compress-zlib-plugin
2018-11-27 21:50:24 +00:00
Summary: libknet1 zlib support
2018-03-20 22:07:32 +00:00
License: LGPLv2+
Requires: libknet1%{_isa} = %{version}-%{release}
%description -n libknet1-compress-zlib-plugin
2018-11-27 21:50:24 +00:00
zlib compression support for libknet1.
2018-03-20 22:07:32 +00:00
%files -n libknet1-compress-zlib-plugin
%{_libdir}/kronosnet/compress_zlib.so
%endif
%if %{defined buildcompresslz4}
%package -n libknet1-compress-lz4-plugin
2018-11-27 21:50:24 +00:00
Summary: libknet1 lz4 and lz4hc support
2018-03-20 22:07:32 +00:00
License: LGPLv2+
Requires: libknet1%{_isa} = %{version}-%{release}
%description -n libknet1-compress-lz4-plugin
2018-11-27 21:50:24 +00:00
lz4 and lz4hc compression support for libknet1.
2018-03-20 22:07:32 +00:00
%files -n libknet1-compress-lz4-plugin
%{_libdir}/kronosnet/compress_lz4.so
%{_libdir}/kronosnet/compress_lz4hc.so
%endif
%if %{defined buildcompresslzo2}
%package -n libknet1-compress-lzo2-plugin
2018-11-27 21:50:24 +00:00
Summary: libknet1 lzo2 support
2018-03-20 22:07:32 +00:00
License: LGPLv2+
Requires: libknet1%{_isa} = %{version}-%{release}
%description -n libknet1-compress-lzo2-plugin
2018-11-27 21:50:24 +00:00
lzo2 compression support for libknet1.
2018-03-20 22:07:32 +00:00
%files -n libknet1-compress-lzo2-plugin
%{_libdir}/kronosnet/compress_lzo2.so
%endif
%if %{defined buildcompresslzma}
%package -n libknet1-compress-lzma-plugin
2018-11-27 21:50:24 +00:00
Summary: libknet1 lzma support
2018-03-20 22:07:32 +00:00
License: LGPLv2+
Requires: libknet1%{_isa} = %{version}-%{release}
%description -n libknet1-compress-lzma-plugin
2018-11-27 21:50:24 +00:00
lzma compression support for libknet1.
2018-03-20 22:07:32 +00:00
%files -n libknet1-compress-lzma-plugin
%{_libdir}/kronosnet/compress_lzma.so
%endif
%if %{defined buildcompressbzip2}
%package -n libknet1-compress-bzip2-plugin
2018-11-27 21:50:24 +00:00
Summary: libknet1 bzip2 support
2018-03-20 22:07:32 +00:00
License: LGPLv2+
Requires: libknet1%{_isa} = %{version}-%{release}
%description -n libknet1-compress-bzip2-plugin
2018-11-27 21:50:24 +00:00
bzip2 compression support for libknet1.
2018-03-20 22:07:32 +00:00
%files -n libknet1-compress-bzip2-plugin
%{_libdir}/kronosnet/compress_bzip2.so
%endif
%package -n libknet1-crypto-plugins-all
2018-11-27 21:50:24 +00:00
Summary: libknet1 crypto plugins meta package
2018-03-20 22:07:32 +00:00
License: LGPLv2+
%if %{defined buildcryptonss}
Requires: libknet1-crypto-nss-plugin%{_isa} = %{version}-%{release}
%endif
%if %{defined buildcryptoopenssl}
Requires: libknet1-crypto-openssl-plugin%{_isa} = %{version}-%{release}
%endif
%description -n libknet1-crypto-plugins-all
2018-11-27 21:50:24 +00:00
meta package to install all of libknet1 crypto plugins
2018-03-20 22:07:32 +00:00
%files -n libknet1-crypto-plugins-all
%package -n libknet1-compress-plugins-all
2018-11-27 21:50:24 +00:00
Summary: libknet1 compress plugins meta package
2018-03-20 22:07:32 +00:00
License: LGPLv2+
%if %{defined buildcompresszlib}
Requires: libknet1-compress-zlib-plugin%{_isa} = %{version}-%{release}
%endif
%if %{defined buildcompresslz4}
Requires: libknet1-compress-lz4-plugin%{_isa} = %{version}-%{release}
%endif
%if %{defined buildcompresslzo2}
Requires: libknet1-compress-lzo2-plugin%{_isa} = %{version}-%{release}
%endif
%if %{defined buildcompresslzma}
Requires: libknet1-compress-lzma-plugin%{_isa} = %{version}-%{release}
%endif
%if %{defined buildcompressbzip2}
Requires: libknet1-compress-bzip2-plugin%{_isa} = %{version}-%{release}
%endif
%description -n libknet1-compress-plugins-all
2018-11-27 21:50:24 +00:00
meta package to install all of libknet1 compress plugins
2018-03-20 22:07:32 +00:00
%files -n libknet1-compress-plugins-all
%package -n libknet1-plugins-all
2018-11-27 21:50:24 +00:00
Summary: libknet1 plugins meta package
2018-03-20 22:07:32 +00:00
License: LGPLv2+
Requires: libknet1-compress-plugins-all%{_isa} = %{version}-%{release}
Requires: libknet1-crypto-plugins-all%{_isa} = %{version}-%{release}
%description -n libknet1-plugins-all
2018-11-27 21:50:24 +00:00
meta package to install all of libknet1 plugins
2018-03-20 22:07:32 +00:00
%files -n libknet1-plugins-all
%if %{with rpmdebuginfo}
# This is left over from upstream.
%debug_package
%endif
%changelog
2018-11-27 21:50:24 +00:00
* Mon Nov 26 2018 Madison Kelly <mkelly@alteeve.ca> - 1.5-1
- Updated to upstream release v1.5.
2018-03-20 22:07:32 +00:00