File wolfssl.spec of Package wolfssl

#
# spec file for package wolfssl
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#

%bcond_with pdf

%define sonum 24

Name:           wolfssl
Version:        4.4.0
Release:        0
Summary:        Embedded SSL Library
License:        GPL-2.0-only
Group:          Productivity/Networking/Security
URL:            http://www.wolfssl.com/
#https://github.com/wolfSSL/wolfssl/archive/v4.3.0-stable.tar.gz
Source:         https://github.com/wolfSSL/%{name}/archive/v%{version}-stable.tar.gz#/%{name}-%{version}-stable.tar.gz
Patch0:         wolfssl-nocmakegitetc-docbuild.patch
%if %{with pdf}
BuildRequires:  texlive-float
BuildRequires:  texlive-colortbl
BuildRequires:  texlive-tabu
BuildRequires:  texlive-multirow
BuildRequires:  texlive-adjustbox
BuildRequires:  texlive-wasysym
BuildRequires:  texlive-psnfss
BuildRequires:  texlive-sectsty
BuildRequires:  texlive-fancyhdr
BuildRequires:  texlive-tocloft
BuildRequires:  texlive-natbib
BuildRequires:  texlive-caption
%endif
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  doxygen
BuildRequires:  libtool
BuildRequires:  pkgconfig

%description
The wolfSSL embedded SSL library (formerly CyaSSL) is a lightweight
SSL/TLS library written in ANSI C and targeted for embedded, RTOS,
and resource-constrained environments - primarily because of its
small size, speed, and feature set. It is commonly used in standard
operating environments as well because of its royalty-free pricing
and excellent cross platform support. wolfSSL supports industry
standards up to the current TLS 1.3 and DTLS 1.2 levels.
Unit test example binaries in this package.

%package -n libwolfssl%{sonum}
Summary:        a lightweight SSL/TLS library
Group:          System/Libraries

%description -n libwolfssl%{sonum}
The wolfSSL embedded SSL library (formerly CyaSSL) is a lightweight
SSL/TLS library written in ANSI C and targeted for embedded, RTOS,
and resource-constrained environments - primarily because of its
small size, speed, and feature set. It is commonly used in standard
operating environments as well because of its royalty-free pricing
and excellent cross platform support. wolfSSL supports industry
standards up to the current TLS 1.3 and DTLS 1.2 levels.

%package doc
BuildArch:      noarch
Summary:        Documentation files files for %{name}
Group:          Productivity/Networking/Security

%description doc
This package contains the header files and development libraries
for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-devel.


%package devel
Summary:        Header files and development libraries for %{name}
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{sonum} = %{version}-%{release}
Recommends:     %{name}-doc = %{version}

%description devel
This package contains the header files and development libraries
for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-devel.

%prep
%setup -q -n wolfssl-%{version}-stable
%autopatch -p1

%build
./autogen.sh
export CFLAGS="`echo %optflags | sed 's/-O2/-O0/'` -ggdb"
echo $CFLAGS
%configure --disable-postauth \
           --disable-certservice \
           --disable-opensslextra \
           --enable-leantls \
           --enable-tlsv12 \
           --enable-singlethreaded \
           --enable-debug \
           --disable-oldtls \
           --enable-stacksize \
           --disable-filesystem
#           --enable-all \


make %{?_smp_mflags} V=1
make dox-html

%install
make install  DESTDIR=%{buildroot} AM_INSTALL_PROGRAM_FLAGS=""
mkdir -p %{buildroot}/
rm %{buildroot}%{_libdir}/*.la
mkdir %{buildroot}%{_docdir}
mv %{buildroot}%{_datadir}/doc/wolfssl %{buildroot}%{_docdir}/wolfssl
#Copy the example binaries to /usr/bin
pushd examples
for i in `find */.libs/ -type f` ;do cp -v ${i} %{buildroot}%{_bindir};done
popd
#Add the included CA certificates
mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
cp -vr certs %{buildroot}%{_sharedstatedir}/%{name}

%if 1 == 0
%check
testsuite/testsuite.test
%endif

%post -n libwolfssl%{sonum} -p /sbin/ldconfig
%postun -n libwolfssl%{sonum} -p /sbin/ldconfig

%files
#%%{_bindir}/client
#%%{_bindir}/echoclient
#%%{_bindir}/echoserver
#%%{_bindir}/server
#%%{_bindir}/tls_bench
%{_sharedstatedir}/%{name}/

%files doc
%license COPYING
%doc ChangeLog.md README.md doc/html
%dir %{_docdir}/wolfssl
%dir %{_docdir}/wolfssl/example
%{_docdir}/wolfssl/taoCert.txt
%{_docdir}/wolfssl/example/echoserver.c
%{_docdir}/wolfssl/example/server.c
%{_docdir}/wolfssl/example/echoclient.c
%{_docdir}/wolfssl/example/client.c
%{_docdir}/wolfssl/example/sctp-client.c
%{_docdir}/wolfssl/example/sctp-server.c
%{_docdir}/wolfssl/example/sctp-client-dtls.c
%{_docdir}/wolfssl/example/sctp-server-dtls.c
%{_docdir}/wolfssl/example/tls_bench.c
%{_docdir}/wolfssl/README.txt

%files  -n libwolfssl%{sonum}
%license COPYING
%{_libdir}/*.so.%{sonum}*

%files devel
%{_bindir}/wolfssl-config
%dir %{_includedir}/cyassl
%dir %{_includedir}/cyassl/ctaocrypt
%dir %{_includedir}/cyassl/openssl
%dir %{_includedir}/wolfssl
%dir %{_includedir}/wolfssl/wolfcrypt
%dir %{_includedir}/wolfssl/openssl
%{_includedir}/cyassl/*.h
%{_includedir}/cyassl/ctaocrypt/*.h
%{_includedir}/cyassl/openssl/*.h
%{_includedir}/wolfssl/*.h
%{_includedir}/wolfssl/wolfcrypt/*.h
%{_includedir}/wolfssl/openssl/*.h
%{_libdir}/pkgconfig/wolfssl.pc
%{_libdir}/libwolfssl.so

%changelog
openSUSE Build Service is sponsored by