libssh/libssh.spec

158 lines
4.1 KiB
RPMSpec
Raw Normal View History

#
# spec file for package libssh
#
# Copyright (c) 2019 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/
#
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} >= 150000
%bcond_without docs
%else
# We need cmake >= 3.9 to build docs
%bcond_with docs
%endif
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%bcond_without test
%else
%bcond_with test
%endif
%if %{with test}
Name: libssh-%{flavor}
%else
Name: libssh
%endif
Version: 0.8.6
Release: 0
Summary: The SSH library
License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
URL: https://www.libssh.org
Source0: https://www.libssh.org/files/0.8/libssh-%{version}.tar.xz
Source1: https://www.libssh.org/files/0.8/libssh-%{version}.tar.xz.asc
Source2: https://cryptomilk.org/gpgkey-8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D.gpg#/libssh.keyring
Source99: baselibs.conf
Patch0: 0001-disable-timeout-test-on-slow-buildsystems.patch
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: krb5-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: xz
BuildRequires: zlib-devel
%if %{with test}
BuildRequires: libcmocka-devel
%endif
%description
An SSH implementation in the form of a library. With libssh, you can remotely
execute programs, transfer files, use a secure and transparent tunnel for your
remote programs. It supports SFTP as well.
This package provides libssh from https://www.libssh.org that should not be
confused with libssh2 available from https://www.libssh2.org (libssh2 package)
%package -n libssh4
Summary: SSH library
Group: System/Libraries
%description -n libssh4
An SSH implementation in the form of a library. With libssh, you can remotely
execute programs, transfer files, use a secure and transparent tunnel for your
remote programs. It supports SFTP as well.
This package provides libssh from https://www.libssh.org that should not be
confused with libssh2 available from https://www.libssh2.org (libssh2 package)
%package devel
Summary: SSH library development headers
Group: Development/Libraries/C and C++
Requires: cmake
Requires: libssh4 = %{version}
%description devel
Development headers for the SSH library.
%package devel-doc
Summary: SSH library API documentation
Group: Documentation/HTML
%description devel-doc
Documentation for libssh development.
%prep
%autosetup -p1 -n libssh-0.8.6
%build
%if %{with test}
%ifarch s390 s390x ppc64le
%define slow_test_system "ON"
%else
%define slow_test_system "OFF"
%endif
%endif
%cmake \
-DCMAKE_C_FLAGS:STRING="%{optflags} -DOPENSSL_LOAD_CONF" \
%if %{with test}
-DUNIT_TESTING="ON" \
-DSLOW_TEST_SYSTEM=%{slow_test_system} \
%endif
-DWITH_GSSAPI=ON \
-DWITH_EXAMPLES="OFF"
make %{?_smp_mflags}
%if %{with docs}
make %{?_smp_mflags} docs
%endif # with docs
%install
%if !%{with test}
%cmake_install
%endif
%check
cd build
%if %{with test}
ctest --output-on-failure
%endif
%if !%{with test}
%post -n libssh4 -p /sbin/ldconfig
%postun -n libssh4 -p /sbin/ldconfig
%files -n libssh4
%doc AUTHORS README ChangeLog
%{_libdir}/libssh.so.*
%files devel
%{_includedir}/libssh
%{_libdir}/libssh.so
%{_libdir}/pkgconfig/libssh.pc
%dir %{_libdir}/cmake/libssh
%{_libdir}/cmake/libssh/libssh-config.cmake
%{_libdir}/cmake/libssh/libssh-config-version.cmake
%if %{with docs}
%files devel-doc
%doc build/doc/html
%endif # with docs
%endif
%changelog