File mptcpd.spec of Package mptcpd

#
# spec file for package mptcpd
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           mptcpd
Version:        0.12
Release:        0
Summary:        The Multipath TCP Daemon
Group:          Productivity/Networking/Routing
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License:        BSD-3-Clause, GPL-2.0-or-later WITH Linux-syscall-note
URL:            https://github.com/multipath-tcp/mptcpd
Source:         https://github.com/multipath-tcp/mptcpd/releases/download/v0.12/mptcpd-0.12.tar.gz
Patch0:         %{name}-systemd.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  doxygen
BuildRequires:  ell-devel
BuildRequires:  gcc-c++
BuildRequires:  glibc-devel
BuildRequires:  libtool
#BuildRequires:  mt-st
BuildRequires:  pandoc
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(systemd)

%description
The Multipath TCP Daemon - mptcpd - is a daemon for Linux based
operating systems that performs multipath TCP path management related
operations in the user space. It interacts with the Linux kernel
through a generic netlink connection to track per-connection
information (e.g. available remote addresses), available network
interfaces, request new MPTCP subflows, handle requests for subflows,
etc.

%package devel
Summary:        Development files for Multipath TCP Daemon
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
This package contains Development files for Multipath TCP Daemon


%prep
%autosetup -p0

%build
%configure
%make_build

%install
%make_install

# fix systemd service name
mv %{buildroot}/%{_unitdir}/mptcp.service %{buildroot}/%{_unitdir}/%{name}.service
install -d %{buildroot}/%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rc%{name}

%pre
%service_add_pre %{name}.service

%preun
%service_del_preun %{name}.service

%post
/sbin/ldconfig
%service_add_post %{name}.service

%postun
/sbin/ldconfig
%service_del_postun %{name}.service

%files
%license COPYING LICENSES/COPYING.GPL LICENSES/Linux-syscall-note
%doc ChangeLog README README.md
%doc %{_mandir}/man?/*
%dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/%{name}.conf
%{_bindir}/mptcpize
%{_sbindir}/rc%{name}
%{_libdir}/lib%{name}.so.*
%{_libexecdir}/%{name}
%{_unitdir}/%{name}.service

%files devel
%license COPYING LICENSES/COPYING.GPL LICENSES/Linux-syscall-note
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*
%{_libdir}/*
%exclude %{_libdir}/lib%{name}.so.*

%changelog

openSUSE Build Service is sponsored by