2021-01-19 07:09:52 +00:00
|
|
|
# libssh2 is not available on RHEL
|
|
|
|
%if 0%{?rhel}
|
|
|
|
%bcond_with libssh2
|
|
|
|
%else
|
|
|
|
%bcond_without libssh2
|
|
|
|
%endif
|
|
|
|
|
2014-06-21 08:12:44 +00:00
|
|
|
Name: libgit2
|
2023-01-20 22:41:04 +00:00
|
|
|
Version: 1.4.5
|
2021-11-28 12:58:35 +00:00
|
|
|
Release: %autorelease
|
2014-06-21 08:12:44 +00:00
|
|
|
Summary: C implementation of the Git core methods as a library with a solid API
|
|
|
|
License: GPLv2 with exceptions
|
2019-02-02 23:08:24 +00:00
|
|
|
URL: https://libgit2.org/
|
2021-11-28 13:15:32 +00:00
|
|
|
Source0: https://github.com/libgit2/libgit2/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
2016-10-10 08:26:47 +00:00
|
|
|
|
2017-07-08 16:30:12 +00:00
|
|
|
BuildRequires: gcc
|
2020-03-02 18:08:36 +00:00
|
|
|
BuildRequires: cmake >= 3.5.1
|
2018-08-10 05:22:52 +00:00
|
|
|
BuildRequires: ninja-build
|
2014-06-21 08:12:44 +00:00
|
|
|
BuildRequires: http-parser-devel
|
2015-09-02 13:55:06 +00:00
|
|
|
BuildRequires: libcurl-devel
|
2021-01-19 07:09:52 +00:00
|
|
|
%if %{with libssh2}
|
2014-06-21 08:12:44 +00:00
|
|
|
BuildRequires: libssh2-devel
|
2021-01-19 07:09:52 +00:00
|
|
|
%endif
|
2014-06-21 08:12:44 +00:00
|
|
|
BuildRequires: openssl-devel
|
2020-03-03 05:24:10 +00:00
|
|
|
BuildRequires: pcre2-devel
|
2018-08-10 05:22:52 +00:00
|
|
|
BuildRequires: python3
|
2014-06-21 08:12:44 +00:00
|
|
|
BuildRequires: zlib-devel
|
|
|
|
Provides: bundled(libxdiff)
|
2014-03-25 13:22:26 +00:00
|
|
|
|
2013-06-15 10:16:20 +00:00
|
|
|
%description
|
2019-02-02 23:08:24 +00:00
|
|
|
libgit2 is a portable, pure C implementation of the Git core methods
|
2013-06-15 10:16:20 +00:00
|
|
|
provided as a re-entrant linkable library with a solid API, allowing
|
|
|
|
you to write native speed custom Git applications in any language
|
|
|
|
with bindings.
|
|
|
|
|
2014-06-21 08:12:44 +00:00
|
|
|
%package devel
|
|
|
|
Summary: Development files for %{name}
|
2017-01-10 12:49:04 +00:00
|
|
|
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
2013-06-15 10:16:20 +00:00
|
|
|
|
2014-06-21 09:42:28 +00:00
|
|
|
%description devel
|
2014-06-21 08:12:44 +00:00
|
|
|
This package contains libraries and header files for
|
2013-06-15 10:16:20 +00:00
|
|
|
developing applications that use %{name}.
|
|
|
|
|
|
|
|
%prep
|
2016-10-10 08:26:47 +00:00
|
|
|
%autosetup -p1
|
2015-01-20 18:00:57 +00:00
|
|
|
|
2013-06-15 10:16:20 +00:00
|
|
|
# Remove VCS files from examples
|
2014-06-21 08:12:44 +00:00
|
|
|
find examples -name ".gitignore" -delete -print
|
2013-06-15 10:16:20 +00:00
|
|
|
|
2018-10-27 10:13:16 +00:00
|
|
|
# Don't run "online" tests
|
2020-03-02 18:08:36 +00:00
|
|
|
sed -i '/-sonline/s/^/#/' tests/CMakeLists.txt
|
2013-06-15 10:16:20 +00:00
|
|
|
|
|
|
|
# Remove bundled libraries
|
2020-03-02 18:08:36 +00:00
|
|
|
rm -vr deps
|
2013-06-15 10:16:20 +00:00
|
|
|
|
|
|
|
%build
|
2021-11-28 13:15:32 +00:00
|
|
|
%cmake \
|
2018-08-10 05:22:52 +00:00
|
|
|
-GNinja \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2020-03-03 05:24:10 +00:00
|
|
|
-DREGEX_BACKEND=pcre2 \
|
2020-03-02 18:08:36 +00:00
|
|
|
-DUSE_HTTP_PARSER=system \
|
|
|
|
-DUSE_SHA1=HTTPS \
|
2018-08-10 05:22:52 +00:00
|
|
|
-DUSE_HTTPS=OpenSSL \
|
2020-03-02 18:08:36 +00:00
|
|
|
-DUSE_NTLMCLIENT=OFF \
|
2022-12-09 00:57:50 +00:00
|
|
|
%if %{with libssh2}
|
|
|
|
-DUSE_SSH=ON \
|
|
|
|
%else
|
2022-03-19 20:46:29 +00:00
|
|
|
-DUSE_SSH=OFF \
|
|
|
|
%endif
|
2018-08-10 05:22:52 +00:00
|
|
|
%{nil}
|
2021-11-28 13:15:32 +00:00
|
|
|
%cmake_build
|
2013-06-15 10:16:20 +00:00
|
|
|
|
2014-06-21 08:12:44 +00:00
|
|
|
%install
|
2021-11-28 13:15:32 +00:00
|
|
|
%cmake_install
|
2013-06-15 10:16:20 +00:00
|
|
|
|
|
|
|
%check
|
2021-11-28 13:15:32 +00:00
|
|
|
%ctest
|
2013-06-15 10:16:20 +00:00
|
|
|
|
|
|
|
%files
|
2015-07-30 15:28:38 +00:00
|
|
|
%license COPYING
|
2022-12-09 00:57:50 +00:00
|
|
|
%{_libdir}/libgit2.so.1.4*
|
2013-06-15 10:16:20 +00:00
|
|
|
|
|
|
|
%files devel
|
2014-08-08 02:20:32 +00:00
|
|
|
%doc AUTHORS docs examples README.md
|
2019-07-14 11:34:21 +00:00
|
|
|
%{_libdir}/libgit2.so
|
|
|
|
%{_libdir}/pkgconfig/libgit2.pc
|
2014-06-21 08:12:44 +00:00
|
|
|
%{_includedir}/git2.h
|
|
|
|
%{_includedir}/git2/
|
2013-06-15 10:16:20 +00:00
|
|
|
|
|
|
|
%changelog
|
2021-11-28 12:58:35 +00:00
|
|
|
%autochangelog
|