Blame libgit2_1.6.spec

25d17a3
# libssh2 is not available on RHEL
25d17a3
%if 0%{?rhel}
25d17a3
%bcond_with libssh2
25d17a3
%else
25d17a3
%bcond_without libssh2
25d17a3
%endif
25d17a3
25d17a3
Name:           libgit2_1.6
a220dd6
Version:        1.6.5
25d17a3
Release:        %autorelease
25d17a3
Summary:        C implementation of the Git core methods as a library with a solid API
25d17a3
License:        GPLv2 with exceptions
25d17a3
URL:            https://libgit2.org/
25d17a3
Source0:        https://github.com/libgit2/libgit2/archive/refs/tags/v%{version}.tar.gz#/libgit2-%{version}.tar.gz
25d17a3
25d17a3
BuildRequires:  gcc
25d17a3
BuildRequires:  cmake >= 3.5.1
25d17a3
BuildRequires:  ninja-build
25d17a3
BuildRequires:  http-parser-devel
25d17a3
BuildRequires:  libcurl-devel
25d17a3
%if %{with libssh2}
25d17a3
BuildRequires:  libssh2-devel
25d17a3
%endif
25d17a3
BuildRequires:  openssl-devel
25d17a3
BuildRequires:  pcre2-devel
25d17a3
BuildRequires:  python3
25d17a3
BuildRequires:  zlib-devel
25d17a3
Provides:       bundled(libxdiff)
25d17a3
25d17a3
%description
25d17a3
libgit2 is a portable, pure C implementation of the Git core methods
25d17a3
provided as a re-entrant linkable library with a solid API, allowing
25d17a3
you to write native speed custom Git applications in any language
25d17a3
with bindings.
25d17a3
25d17a3
%package        devel
25d17a3
Summary:        Development files for %{name}
25d17a3
Requires:       %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
25d17a3
# This compat -devel package provides an older version of libgit2-devel
25d17a3
Provides:       libgit2-devel = %{?epoch:%{epoch}:}%{version}-%{release}
25d17a3
# These devel packages are not installable in parallel
25d17a3
Conflicts:      pkgconfig(libgit2)
25d17a3
25d17a3
%description    devel
25d17a3
This package contains libraries and header files for
25d17a3
developing applications that use %{name}.
25d17a3
25d17a3
%prep
25d17a3
%autosetup -p1 -n libgit2-%{version}
25d17a3
25d17a3
# Remove VCS files from examples
25d17a3
find examples -name ".gitignore" -delete -print
25d17a3
25d17a3
# Don't run "online" tests
25d17a3
sed -i '/-sonline/s/^/#/' tests/libgit2/CMakeLists.txt
25d17a3
f48a9f2
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
f48a9f2
# On Fedora 40+ and RHEL 10+, we're using zlib-ng rather than
f48a9f2
# zlib for compression. As a result, all of the pack tests fail
f48a9f2
# due to checking the hashes of the packed data against static
f48a9f2
# values that were created with zlib.
f48a9f2
# https://github.com/libgit2/libgit2/issues/6728
f48a9f2
sed -i 's/-xonline/-xonline -xpack/' tests/libgit2/CMakeLists.txt
f48a9f2
%endif
f48a9f2
25d17a3
# Remove bundled libraries
25d17a3
rm -vr deps
25d17a3
25d17a3
%build
25d17a3
%cmake \
25d17a3
  -GNinja \
25d17a3
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
25d17a3
  -DREGEX_BACKEND=pcre2 \
25d17a3
  -DBUILD_CLI=OFF \
25d17a3
  -DUSE_HTTP_PARSER=system \
25d17a3
  -DUSE_SHA1=HTTPS \
25d17a3
  -DUSE_HTTPS=OpenSSL \
25d17a3
  -DUSE_NTLMCLIENT=OFF \
25d17a3
%if %{with libssh2}
25d17a3
  -DUSE_SSH=ON \
25d17a3
%else
25d17a3
  -DUSE_SSH=OFF \
25d17a3
%endif
25d17a3
  %{nil}
25d17a3
%cmake_build
25d17a3
25d17a3
%install
25d17a3
%cmake_install
25d17a3
25d17a3
%check
25d17a3
%ctest
25d17a3
25d17a3
%files
25d17a3
%license COPYING
25d17a3
%{_libdir}/libgit2.so.1.6*
25d17a3
25d17a3
%files devel
25d17a3
%doc AUTHORS docs examples README.md
25d17a3
%{_libdir}/libgit2.so
25d17a3
%{_libdir}/pkgconfig/libgit2.pc
25d17a3
%{_includedir}/git2.h
25d17a3
%{_includedir}/git2/
25d17a3
25d17a3
%changelog
25d17a3
%autochangelog