File mingw64-strongswan.spec of Package mingw64-strongswan

#
# spec file for package mingw64-strongswan
#
# Copyright (c) 2025, 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/
#


%define realname strongswan
Name:           mingw64-%{realname}
Version:        6.0.1
Release:        0
Summary:        IPsec-based VPN solution
License:        GPL-2.0-or-later
Group:          Productivity/Networking/Security
URL:            https://www.strongswan.org/
Source0:        http://download.strongswan.org/strongswan-%{version}.tar.bz2
Source1:        http://download.strongswan.org/strongswan-%{version}.tar.bz2.sig
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  mingw64-cross-gcc
BuildRequires:  mingw64-cross-pkg-config
BuildRequires:  mingw64-libopenssl-1_1-devel
%{_mingw64_package_header_debug}
BuildArch:      noarch

%description
StrongSwan is an IPsec-based VPN solution.

* IKEv1 and IKEv2 (RFC 4306, 9370) key exchange protocol support
* Support of IPv6 IPsec tunnel and transport connections
* Dynamic IP address and interface update with IKEv2 MOBIKE (RFC 4555)
* Automatic insertion and deletion of IPsec-policy-based firewall rules
* 128/192/256-bit AES encryption
* NAT Traversal via UDP encapsulation and port floating (RFC 3947)
* Dead Peer Detection (DPD, RFC 3706) to detect dangling tunnels
* XAUTH server and client functionality on top of IKEv1 Main Mode authentication
* Virtual IP address pool managed by IKE daemon or SQL database
* IKEv2 EAP user authentication (EAP-SIM, EAP-AKA, EAP-MSCHAPv2, etc.)
* Optional relaying of EAP messages to AAA server via EAP-RADIUS plugin
* Support of IKEv2 Multiple Authentication Exchanges (RFC 4739)
* Authentication based on X.509 certificates or preshared keys
* Generation of a default self-signed certificate during first strongSwan startup
* Retrieval and local caching of Certificate Revocation Lists via HTTP or LDAP
* Full support of the Online Certificate Status Protocol (OCSP, RCF 2560).
* CA management (OCSP and CRL URIs, default LDAP server)
* IPsec policies based on wildcards or intermediate CAs
* Group policies based on X.509 attribute certificates (RFC 3281)
* Storage of RSA private keys and certificates on a smartcard (PKCS#11 interface)
* Modular plugins for crypto algorithms and relational database interfaces
* Support of elliptic curve DH groups and ECDSA certificates (Suite B, RFC 4869)

%{_mingw64_debug_package}

%prep
%autosetup -p1 -n %{realname}-%{version}

%build
autoreconf -fiv
# https://docs.strongswan.org/docs/latest/os/windows.html#_toolchain
%{_mingw64_configure} \
  --disable-defaults \
  --enable-monolithic \
  --enable-static \
  --enable-svc \
  --enable-ikev2 \
  --enable-ikev1  \
  --enable-nonce \
  --enable-pem \
  --enable-rdrand \
  --enable-revocation \
  --enable-pkcs1 \
  --enable-pkcs8 \
  --enable-vici \
  --enable-eap-identity \
  --enable-eap-tls \
  --enable-eap-ttls \
  --enable-x509 \
  --enable-openssl \
  --enable-socket-win \
  --enable-kernel-wfp \
  --enable-kernel-iph \
  --enable-pubkey \
  --enable-swanctl \
  --with-swanctldir=swanctl \
  --with-strongswan-conf=strongswan.conf
%{_mingw64_make} %{?_smp_mflags}

%install
#%%{_mingw64_make_install} #DESTDIR=%{buildroot}

# make install is broken


%files
%license COPYING LICENSE
%doc README NEWS README AUTHORS ChangeLog

# make install is broken

#[  106s]     File not found: /home/abuild/rpmbuild/BUILD/mingw64-strongswan-6.0.1-build/BUILDROOT/usr/x86_64-w64-mingw32/sys-root/mingw/bin/charon-svc.exe
#[  106s]     File not found: /home/abuild/rpmbuild/BUILD/mingw64-strongswan-6.0.1-build/BUILDROOT/usr/x86_64-w64-mingw32/sys-root/mingw/sbin/swanctl.exe


#%%{_mingw64_bindir}/charon-svc.exe
#%%{_mingw64_sbindir}/swanctl.exe
#%%{_mingw64_mandir}/man5/strongswan.conf.5%{?ext_man}
#%%{_mingw64_mandir}/man5/swanctl.conf.5%{?ext_man}
#%%{_mingw64_mandir}/man8/swanctl.8%{?ext_man}
#%%{_mingw64_datadir}/strongswan
#%%{_mingw64_bindir}/libcharon-0.dll
#%%{_mingw64_bindir}/libstrongswan-0.dll
#%%{_mingw64_libdir}/ipsec


%changelog
openSUSE Build Service is sponsored by