]> git.pld-linux.org Git - packages/libgit2.git/blame - libgit2.spec
disable "Build Tests using the Clar suite" when not running tests
[packages/libgit2.git] / libgit2.spec
CommitLineData
e02620dc
KK
1#
2# Conditional build:
5a6c8e52 3%bcond_without kerberos5 # GSSAPI for SPNEGO auth
e02620dc 4%bcond_without tests # build without tests
f967805f
ER
5%bcond_without libssh # Link with libssh2 to enable SSH support
6%bcond_without curl # Use cURL for HTTP
c1bf3b60 7%bcond_with tests_online # build with tests reqiuring online access
3ed59b63 8
bed40d56
ER
9Summary: C Git library
10Summary(pl.UTF-8): Biblioteka Git dla C
e02620dc 11Name: libgit2
bed40d56 12Version: 0.24.0
cfe22010 13Release: 1
3ed59b63 14License: GPL v2 with linking exception
e02620dc 15Group: Libraries
cfe22010 16Source0: https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz
bed40d56 17# Source0-md5: 8cabf04502d7203793b32f47ca410ae3
43bce41a 18Patch0: %{name}-test-online.patch
6bc0cd1c 19Patch1: %{name}-no-libgit2-test.patch
e02620dc 20URL: http://libgit2.github.com/
5a6c8e52 21BuildRequires: cmake >= 2.8
f967805f 22%{?with_curl:BuildRequires: curl-devel}
5a6c8e52
JB
23%{?with_kerberos5:BuildRequires: heimdal-devel}
24BuildRequires: http-parser-devel >= 2
f967805f 25%{?with_libssh:BuildRequires: libssh2-devel}
e02620dc 26BuildRequires: openssl-devel
5a6c8e52 27BuildRequires: pkgconfig
e02620dc
KK
28%{?with_tests:BuildRequires: python}
29BuildRequires: zlib-devel
30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
f967805f
ER
32# Usage: cmake_with BCOND_NAME [OPTION_NAME]
33%define cmake_with() %{expand:%%{?with_%{1}:-D%{?2}%{!?2:%{1}}=BOOL:ON}%%{!?with_%{1}:-D%{?2}%{!?2:%{1}}=BOOL:OFF}}
34
e02620dc
KK
35%description
36libgit2 is a portable, pure C implementation of the Git core methods
37provided as a re-entrant linkable library with a solid API, allowing
38you to write native speed custom Git applications in any language with
39bindings.
40
6053f043
JB
41%description -l pl.UTF-8
42libgit2 to przenośna implementacja w czystym C głównych metod Gita,
43udostępniona jako bezpieczna dla wątków biblioteka ze stałym API,
44pozwalająca na pisanie własnych aplikacji dla Gita o natywnej
45szybkości w dowolnym języku posiadającym odpowiednie wiązania.
46
e02620dc 47%package devel
6053f043
JB
48Summary: Header files for libgit2 library
49Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgit2
e02620dc
KK
50Group: Development/Libraries
51Requires: %{name} = %{version}-%{release}
b96b78fd
JB
52Requires: http-parser-devel
53Requires: libssh2-devel
6053f043
JB
54Requires: openssl-devel
55Requires: zlib-devel
e02620dc
KK
56
57%description devel
6053f043
JB
58Header files for libgit2 library.
59
60%description devel -l pl.UTF-8
61Pliki nagłówkowe biblioteki libgit2.
e02620dc
KK
62
63%prep
64%setup -q
3c0e613e 65%patch0 -p1
6bc0cd1c 66%patch1 -p1
e02620dc
KK
67
68%build
3ed59b63 69install -d build
e02620dc 70cd build
b96b78fd
JB
71# CMakeLists.txt supports only relative LIB_INSTALL_DIR and INCLUDE_INSTALL_DIR
72# (otherwise .pc file is generated incorrectly).
73# Type (:PATH or :STRING) must be specified explicitly to avoid expansion
74# relative to cwd.
43bce41a 75%cmake .. \
b96b78fd
JB
76 -DINCLUDE_INSTALL_DIR:PATH=include \
77 -DLIB_INSTALL_DIR:PATH=%{_lib} \
281d638a 78 %{cmake_with tests BUILD_CLAR} \
f967805f
ER
79 %{cmake_with curl CURL} \
80 %{cmake_with kerberos5 USE_GSSAPI} \
81 %{cmake_with libssh USE_SSH} \
82 %{cmake_with tests_online ONLINE_TESTS} \
83 -DTHREADSAFE:BOOL=ON
e02620dc
KK
84%{__make}
85
d1549dd1 86%{?with_tests:%{__make} test ARGS="-V"}
e02620dc
KK
87
88%install
89rm -rf $RPM_BUILD_ROOT
3ed59b63 90%{__make} -C build install \
e02620dc
KK
91 DESTDIR=$RPM_BUILD_ROOT
92
93%clean
94rm -rf $RPM_BUILD_ROOT
95
96%post -p /sbin/ldconfig
97%postun -p /sbin/ldconfig
98
e02620dc
KK
99%files
100%defattr(644,root,root,755)
101%doc AUTHORS CONTRIBUTING.md COPYING README.md
102%attr(755,root,root) %{_libdir}/libgit2.so.*.*.*
bed40d56 103%attr(755,root,root) %ghost %{_libdir}/libgit2.so.24
e02620dc
KK
104
105%files devel
106%defattr(644,root,root,755)
107%attr(755,root,root) %{_libdir}/libgit2.so
108%{_includedir}/git2.h
109%{_includedir}/git2
110%{_pkgconfigdir}/libgit2.pc
This page took 0.12269 seconds and 4 git commands to generate.