#
# spec file for package lksctp-tools
#
# 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:           lksctp-tools
Version:        1.0.21
Release:        1.3
Summary:        Utilities for SCTP (Stream Control Transmission Protocol)
License:        LGPL-2.1-or-later
Group:          Productivity/Networking/Other
URL:            http://lksctp.sourceforge.net
#Git-Clone:     https://github.com/sctp/lksctp-tools
Source:         https://github.com/sctp/lksctp-tools/archive/refs/tags/v%version.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  libtool

%description
This package contains the SCTP base runtime library and command line
tools.

SCTP (Stream Control Transmission Protocol) is a message-oriented,
reliable transport protocol with congestion control, support for
transparent multihoming, and multiple ordered streams of messages.

%package devel
Summary:        Development files for SCTP (Stream Control Transmission Protocol)
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}-%{release}
Requires:       glibc-devel

%description devel
This package contains the SCTP development libraries and C header
files.

SCTP (Stream Control Transmission Protocol) is a message oriented,
reliable transport protocol, with congestion control, support for
transparent multi-homing, and multiple ordered streams of messages.

%prep
%setup -q
sed -i 's/\r$//' doc/rfc2960.txt

%build
autoreconf -fi
%configure --prefix=%{_prefix} \
	--enable-shared \
	--disable-static
%make_build

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

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%license COPYING COPYING.lib
%doc AUTHORS ChangeLog
%doc doc/*.txt
%{_bindir}/*
%{_libdir}/libsctp.so.*
%dir %{_libdir}/lksctp-tools
%{_libdir}/lksctp-tools/*.so.*
%{_mandir}/man7/*

%files devel
%{_includedir}/netinet/sctp.h
%{_libdir}/pkgconfig/libsctp.pc
%{_libdir}/libsctp.so
%dir %{_libdir}/lksctp-tools
%{_libdir}/lksctp-tools/*.so
%dir %{_datadir}/lksctp-tools
%{_datadir}/lksctp-tools/*
%{_mandir}/man3/*

%changelog
* Sat Sep 28 2024 Martin Hauke <mardnh@gmx.de>
- Update to version 1.0.21
  App
  * Close some opened sockets in sctp_darn and sctp_test
  * Free host_s and serv_s in sctp_test and sctp_status
  Test
  * Call close on the correct sk in test_1_to_1_send
  * Free the allocated buffers before return
  * Replace malloc with test_malloc
- Update to version 1.0.20
  App
  * Replace use of deprecated gethostbyname with getaddrinfo
  * Check strdup return in append_addr
  Lib
  * Define cmsg array with correct size in sendv and recvv
  * zero-initialize sinfo_assoc_id in sctp_rcvmsg
  * Man page updates
  Test
  * Add a test case for RE_CONFIG and interleaving
* Thu Mar 23 2023 Martin Liška <mliska@suse.cz>
- Enable LTO now (boo#1133097).
* Mon Aug 29 2022 Jan Engelhardt <jengelh@inai.de>
- Update to release 1.0.19
  * Added support for sctp_peeloff_flags function
  * Added macro definitions indicating which kernel features were
    detected during build
  * Fixes ignored parameter on sctp_sendv
* Mon Mar 28 2022 Martin Hauke <mardnh@gmx.de>
- Update to version 1.0.17
  * Build: add option to disable tests build
  * sctp_test: fix hostname resolution
  * man: remove sysctl listing from sctp.7
  * Fix recieved->received typos
  * Fix usage help for sctp_test
  * test_1_to_1_accept_close: also expect EACCES when accept on
    an established socket
  * lksctp-tools: make bind_test can do while disable IPV6
  * libsctp: add pkg-config support
  * autoconf: add m4 folder
- Run spec-cleaner
* Tue Apr 23 2019 Martin Liška <mliska@suse.cz>
- Disable LTO (boo#1133097).
* Sun Jan 11 2015 Led <ledest@gmail.com>
- upgrade to 1.0.16
  * code cleanups
  * various sctp_status fixes
  * avoid using file descriptor 0 to get ENOTSOCK
  * various fixes
  * fix build for prefixed architectures
- remove patches:
  * lksctp-fixes.patch
* Thu Aug  1 2013 andreas.stieger@gmx.de
- upgrade to 1.0.15
  * withsctp: fix quoted command line arguments
  * sctp_status: fix printstatus output
  * do not returns an error if AM_SILENT_RULES does not exist
- include changes from 1.0.14
  * build: only use AM_CPPFLAGS instead of a mixture of AM_CFLAGS and AM_CPPFLAGS
  * test_sctp_sendrecvmsg: fix bug in msg_flag passing
  * build: fix out-of-tree build of withsctp.
  * test_1_to_1_threads: fixup pthread hung by giving an array instead of a pointer
  * test_1_to_1_threads: remove unused variable for t_recv and t_send
  * sctp: Add new spinfo state values to enumeration
  * build: Modernize autotools
* Sat Jan 26 2013 meissner@suse.com
- upgraded to 1.0.13 (bugfixes)
  T:BUILD Use silent rules
  T:BUILD Fix build warnings all over the place
  T:APP Fix memory leak in sctp_xconnect
  T:TEST Fix deprecated values in test cases
- lskctp-fixes.patch: implicit warning fix
* Mon Jan 21 2013 meissner@suse.com
- upgraded to 1.0.12
  T:API Add needed definitions for DTLS/SCTP.
  T:API Fix data corruption in sctp_send
  T:API Implement private SCTP_GET_ASSOC_STATS option to fetch addition
    association data.
  T:TEST Add more options to conformace test tool.
  T:APP Add HEARTBEAT command to sctp_darn
  T:API Obsolete interefaces have been removed
  T:API Suport for SCTP_SACK_IMMEDIATELY options
  T:API Support for non-blocking sctp-connectx
* Wed Jun 20 2012 meissner@suse.com
- upgraded to 1.0.11
  T:BUILD fix parallel build warning
  T:BUILD fix make distcheck for lksctp-tools
  T:BUILD fix compiler warnings in the libraray, apps and tests
  T:API   Update the sctp.h header to match the kernel.
* Wed Feb 15 2012 jengelh@medozas.de
- Remove redundant tags/sections from specfile
* Thu Nov 24 2011 coolo@suse.com
- add libtool as buildrequire to avoid implicit dependency
* Wed Dec 16 2009 jengelh@medozas.de
- enable parallel building
* Mon Apr  6 2009 meissner@suse.de
- upgraded to 1.0.10
  T:TEST Split the kernel frame test framework from lksctp-tools.
    The framework is very sensitive to all kernel changes, not just
    ones related to SCTP.  As such, it has been a gating fractor
    to the releases of the new tools.
  T:APP New tool sctp_status to be used with SCTP conformance tests.
    http://networktest.sourceforge.net/
  T:APP Add -T option to sctp_test
  T:APP Fix the -e option to sctp_darn
  T:LIB Fix building of static libraries.
  T:LIB Fix compile warning in addrs.c
  T:APP Update the application useage of sctp_connectx
  T:TEST Update the sctp_connectx() functional tests.
  T:API Update to the sctp_connectx().  Now takes additional argument.
  T:API Let sctp_recvmsg() honor passed in MSG_ flags
  K:    See kernel change log for details.  We'll track only tools
    changes here from now on.
* Mon Sep  1 2008 meissner@suse.de
- upgraded to 1.0.9
  - adjusted to 2.6.26
  - Implement and export SCTP-AUTH API extensions based on sctpsocket-16 draft
  - lots of bugfixes
- disable shared libraries and .la files
* Mon Feb 25 2008 meissner@suse.de
- upgraded to 1.0.8
  - added various new features
  - adjusted to 2.6.24
  - bugfixes
* Tue Jul 17 2007 meissner@suse.de
- upgraded to 1.0.7
  - lots of fixes
  - adjusted to 2.6.22 kernel
* Wed Apr 25 2007 meissner@suse.de
- fixed some rpmlint problems. Changed permissions
  to 755/644, moved some development libraries.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Dec 12 2005 okir@suse.de
- Updated to latest upstream version (1.0.4)
* Wed Nov  2 2005 dmueller@suse.de
- don't build as root
* Fri Jan 21 2005 okir@suse.de
- Updated to latest upstream version (1.0.2)
* Wed May 12 2004 okir@suse.de
- Updated to lksctp-tools to 1.0.1 per request from IBM
* Tue Mar 16 2004 okir@suse.de
- Built initial package