]>
Commit | Line | Data |
---|---|---|
e02620dc KK |
1 | # |
2 | # Conditional build: | |
5a6c8e52 | 3 | %bcond_without kerberos5 # GSSAPI for SPNEGO auth |
ce3c8080 | 4 | %bcond_without libssh # SSH support via libssh2 |
2be19a6f | 5 | %bcond_with tests # build without tests |
3ed59b63 | 6 | |
bed40d56 ER |
7 | Summary: C Git library |
8 | Summary(pl.UTF-8): Biblioteka Git dla C | |
e02620dc | 9 | Name: libgit2 |
1317fb22 | 10 | Version: 1.7.2 |
952904a2 | 11 | Release: 1 |
3ed59b63 | 12 | License: GPL v2 with linking exception |
e02620dc | 13 | Group: Libraries |
ce3c8080 | 14 | #Source0Download: https://github.com/libgit2/libgit2/releases |
cfe22010 | 15 | Source0: https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz |
1317fb22 | 16 | # Source0-md5: fa4f30e57c67fabee18c5961af72fb3f |
915109a7 | 17 | Patch0: %{name}-no-libgit2-test.patch |
e02620dc | 18 | URL: http://libgit2.github.com/ |
6d435468 | 19 | BuildRequires: cmake >= 3.5.1 |
5a6c8e52 JB |
20 | %{?with_kerberos5:BuildRequires: heimdal-devel} |
21 | BuildRequires: http-parser-devel >= 2 | |
f967805f | 22 | %{?with_libssh:BuildRequires: libssh2-devel} |
e02620dc | 23 | BuildRequires: openssl-devel |
dafc2bd7 | 24 | BuildRequires: pcre2-8-devel |
5a6c8e52 | 25 | BuildRequires: pkgconfig |
e02620dc | 26 | %{?with_tests:BuildRequires: python} |
3bd4ac36 | 27 | BuildRequires: rpmbuild(macros) >= 1.742 |
e02620dc KK |
28 | BuildRequires: zlib-devel |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | libgit2 is a portable, pure C implementation of the Git core methods | |
33 | provided as a re-entrant linkable library with a solid API, allowing | |
34 | you to write native speed custom Git applications in any language with | |
35 | bindings. | |
36 | ||
6053f043 JB |
37 | %description -l pl.UTF-8 |
38 | libgit2 to przenośna implementacja w czystym C głównych metod Gita, | |
39 | udostępniona jako bezpieczna dla wątków biblioteka ze stałym API, | |
40 | pozwalająca na pisanie własnych aplikacji dla Gita o natywnej | |
41 | szybkości w dowolnym języku posiadającym odpowiednie wiązania. | |
42 | ||
e02620dc | 43 | %package devel |
6053f043 JB |
44 | Summary: Header files for libgit2 library |
45 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgit2 | |
e02620dc | 46 | Group: Development/Libraries |
9749d92d | 47 | Requires: %{name}%{?_isa} = %{version}-%{release} |
b96b78fd JB |
48 | Requires: http-parser-devel |
49 | Requires: libssh2-devel | |
6053f043 JB |
50 | Requires: openssl-devel |
51 | Requires: zlib-devel | |
e02620dc KK |
52 | |
53 | %description devel | |
6053f043 JB |
54 | Header files for libgit2 library. |
55 | ||
56 | %description devel -l pl.UTF-8 | |
57 | Pliki nagłówkowe biblioteki libgit2. | |
e02620dc | 58 | |
4b968fb1 JP |
59 | %package tools |
60 | Summary: Tools for libgit2 library | |
61 | Summary(pl.UTF-8): Narzędzia dla biblioteki libgit2 | |
62 | Group: Application | |
63 | Requires: %{name}%{?_isa} = %{version}-%{release} | |
64 | ||
65 | %description tools | |
66 | Tools for libgit2 library. | |
67 | ||
68 | %description tools -l pl.UTF-8 | |
69 | Narzędzia dla biblioteki libgit2. | |
70 | ||
e02620dc KK |
71 | %prep |
72 | %setup -q | |
3c0e613e | 73 | %patch0 -p1 |
915109a7 AM |
74 | |
75 | # Don't test network | |
c2bb0da7 | 76 | sed -i '/ADD_TEST(online/s/^/#/' tests/CMakeLists.txt |
e02620dc KK |
77 | |
78 | %build | |
3ed59b63 | 79 | install -d build |
e02620dc | 80 | cd build |
b96b78fd JB |
81 | # CMakeLists.txt supports only relative LIB_INSTALL_DIR and INCLUDE_INSTALL_DIR |
82 | # (otherwise .pc file is generated incorrectly). | |
83 | # Type (:PATH or :STRING) must be specified explicitly to avoid expansion | |
84 | # relative to cwd. | |
43bce41a | 85 | %cmake .. \ |
dafc2bd7 JB |
86 | %{cmake_on_off tests BUILD_TESTS} \ |
87 | -DREGEX_BACKEND=pcre2 \ | |
ce3c8080 | 88 | %{cmake_on_off kerberos5 USE_GSSAPI} \ |
6d435468 | 89 | -DUSE_HTTP_PARSER=system \ |
dafc2bd7 | 90 | %{cmake_on_off libssh USE_SSH} |
e02620dc KK |
91 | %{__make} |
92 | ||
d1549dd1 | 93 | %{?with_tests:%{__make} test ARGS="-V"} |
e02620dc KK |
94 | |
95 | %install | |
96 | rm -rf $RPM_BUILD_ROOT | |
dafc2bd7 | 97 | |
3ed59b63 | 98 | %{__make} -C build install \ |
e02620dc KK |
99 | DESTDIR=$RPM_BUILD_ROOT |
100 | ||
101 | %clean | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
104 | %post -p /sbin/ldconfig | |
105 | %postun -p /sbin/ldconfig | |
106 | ||
e02620dc KK |
107 | %files |
108 | %defattr(644,root,root,755) | |
76a2bdaf | 109 | %doc AUTHORS docs/contributing.md COPYING README.md |
e02620dc | 110 | %attr(755,root,root) %{_libdir}/libgit2.so.*.*.* |
5267f40a | 111 | %attr(755,root,root) %ghost %{_libdir}/libgit2.so.1.7 |
e02620dc KK |
112 | |
113 | %files devel | |
114 | %defattr(644,root,root,755) | |
115 | %attr(755,root,root) %{_libdir}/libgit2.so | |
116 | %{_includedir}/git2.h | |
117 | %{_includedir}/git2 | |
118 | %{_pkgconfigdir}/libgit2.pc | |
4b968fb1 JP |
119 | |
120 | %files tools | |
121 | %defattr(644,root,root,755) | |
122 | %attr(755,root,root) %{_bindir}/git2 |