libgit2/libgit2.spec
Your Name 52a2a843c3
All checks were successful
Run CI/CD... / main (push) Successful in 6m27s
1.9.0
2025-02-18 14:28:20 +00:00

98 lines
2.6 KiB
RPMSpec

%define major 1.9
%define libname %mklibname git2_ %{major}
%define devname %mklibname git2 -d
Summary: A C implementation of the Git core methods as a library
Name: libgit2
Version: 1.9.0
Release: 1
License: GPLv2 with exceptions
Group: System/Libraries
URL: https://libgit2.org
Source0: https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz
Source1000: %{name}.rpmlintrc
BuildRequires: cmake
BuildRequires: pkgconfig(krb5-gssapi)
BuildRequires: pkgconfig(libpcre)
BuildRequires: pkgconfig(libssh2)
BuildRequires: pkgconfig(openssl3.3)
BuildRequires: openssl-devel
BuildRequires: pkgconfig(zlib)
Provides: git2
%description
libgit2 is a portable, pure C implementation of the Git core methods
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.
#----------------------------------------------------------------------------
%package -n %{libname}
Summary: A C implementation of the Git core methods as a library
Group: System/Libraries
%description -n %{libname}
libgit2 is a portable, pure C implementation of the Git core methods
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.
%files -n %{libname}
%doc README.md COPYING AUTHORS
%{_bindir}/git2
%{_libdir}/libgit2.so.%{major}
%{_libdir}/libgit2.so.%{major}.*
#----------------------------------------------------------------------------
%package -n %{devname}
Summary: Development files for %{name}
Group: Development/C
Requires: %{libname} = %{EVRD}
%description -n %{devname}
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%files -n %{devname}
%doc AUTHORS docs examples README.md SECURITY.md COPYING
%{_libdir}/libgit2.so
%{_libdir}/pkgconfig/libgit2.pc
%{_includedir}/git2*
%{_libdir}/cmake/%{name}/*.cmake
#----------------------------------------------------------------------------
%prep
%setup -q
# Remove VCS files from examples
find examples -name ".gitignore" -delete
# Remove some bundled libraries
rm -rf deps/{chromium-zlib,pcre,winhttp,zlib}
#rm -rf src/xdiff
%build
%cmake \
-DBUILD_TESTS=OFF \
-DUSE_SSH=ON \
-DBUILD_CLI=ON \
-DUSE_HTTPS=ON \
-DUSE_SHA1=ON \
-DUSE_SHA256=ON \
-DUSE_LEAK_CHECKER=ON
%make
%install
%makeinstall_std -C build
# fix cmake path
%ifarch x86_64
install -d %{buildroot}%{_libdir}/cmake/%{name}
mv %{buildroot}%{_prefix}/lib/cmake/%{name}/* %{buildroot}%{_libdir}/cmake/%{name}/
%endif
%check
ctest -V