File jool.spec of Package jool

#
# spec file for package jool
#
# Copyright (c) 2018-2024, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           jool
Version:        4.1.12
Release:        0
Summary:        Open Source SIIT and NAT64 Translator for Linux
License:        GPL-2.0-or-later
Group:          Productivity/Networking/System
URL:            https://nicmx.github.io/Jool/en/index.html
Source:         https://github.com/NICMx/Jool/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        preamble
BuildRequires:  %{kernel_module_package_buildreqs}
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(libnl-genl-3.0)
BuildRequires:  pkgconfig(xtables)
%kernel_module_package -p %{_sourcedir}/preamble

%description
SIIT mangles packets, simply replacing IPv4 headers and IPv6 headers.
Stateful NAT64 will enable you to run multiple IPv6 client nodes behind
a few IPv4 addresses.

Jool is an Open Source implementation of IPv4/IPv6 Translation on Linux
which aims to be fully RFC-compliant, building a bridge between IPv4-only
and IPv6-only networking nodes. I consists of two kernel modules and
a set of corresponding userspace tools.

%package tools
Summary:        Open Source SIIT and NAT64 Translator for Linux
Group:          Productivity/Networking/System

%description tools
SIIT mangles packets, simply replacing IPv4 headers and IPv6 headers.
Stateful NAT64 will enable you to run multiple IPv6 client nodes behind
a few IPv4 addresses.

Jool is an Open Source implementation of IPv4/IPv6 Translation on Linux
which aims to be fully RFC-compliant, building a bridge between IPv4-only
and IPv6-only networking nodes. I consists of two kernel modules and
a set of corresponding userspace tools.

This package contains command-line tools to interact with the
jools kernel modules. Currently, it provides two tools:

* jool_siit - Interacts with SIIT Jool kernel module
* jool - Interacts with NAT64 Jool kernel module

%package -n jool-bash-completion
Summary:        Bash completion for jool
Group:          Productivity/Networking/System
BuildRequires:  bash-completion
Requires:       bash-completion
Requires:       jool-tools
Supplements:    (%{name} and bash-completion)

%description -n jool-bash-completion
This package contains the bash completion command for jool.

%prep
%setup -q -n Jool-%{version}

### kernel modules
mkdir source
cp -r src/common src/mod src/usr source
mkdir obj

%build
### kernel modules
for flavor in %{flavors_to_build}; do
    cp -r source obj/$flavor
    make V=99 -C obj/$flavor/mod #%%{?_smp_mflags} # paralle build is br0ken
done

### tools
autoreconf -fiv
%configure --disable-static
%make_build

%install
### kernel modules
export INSTALL_MOD_PATH=%{buildroot}
for flavor in %{flavors_to_build}; do
    make -C obj/$flavor/mod modules_install
done

### tools
%make_install
find %{buildroot} -type f -name "*.la" -delete -print

# FIXME: remove files that should in in a devel package for now
#rm %{buildroot}%{_libdir}/jool/*.so


%files tools
%license COPYING
%doc README.md
%{_bindir}/jool
%{_bindir}/jool_siit
%{_bindir}/joold
%dir %{_libdir}/xtables
%{_libdir}/xtables/libxt_JOOL.so
%{_libdir}/xtables/libxt_JOOL_SIIT.so
#
#%dir %{_libdir}/jool
##%{_libdir}/jool/libjoolargp.so
#%{_libdir}/jool/libjoolargp.so.*
##%{_libdir}/jool/libjoolnl.so
#%{_libdir}/jool/libjoolnl.so.*
##%{_libdir}/jool/libjoolutil.so
#%{_libdir}/jool/libjoolutil.so.*
##
%{_mandir}/man8/jool.8%{?ext_man}
%{_mandir}/man8/joold.8%{?ext_man}
%{_mandir}/man8/jool_siit.8%{?ext_man}

%files -n jool-bash-completion
%{_datadir}/bash-completion/completions/jool.bash
%{_datadir}/bash-completion/completions/jool_siit.bash

%changelog
openSUSE Build Service is sponsored by