]>
Commit | Line | Data |
---|---|---|
e02620dc KK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
c1bf3b60 | 4 | %bcond_with tests_online # build with tests reqiuring online access |
3ed59b63 | 5 | |
e02620dc | 6 | Summary: C git library |
6053f043 | 7 | Summary(pl.UTF-8): Biblioteka git dla C |
e02620dc | 8 | Name: libgit2 |
5bad49ba | 9 | Version: 0.22.1 |
cfe22010 | 10 | Release: 1 |
3ed59b63 | 11 | License: GPL v2 with linking exception |
e02620dc | 12 | Group: Libraries |
cfe22010 | 13 | Source0: https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz |
5bad49ba | 14 | # Source0-md5: dbf516d18e176bbb131de3efccfee533 |
43bce41a | 15 | Patch0: %{name}-test-online.patch |
6bc0cd1c | 16 | Patch1: %{name}-no-libgit2-test.patch |
e02620dc KK |
17 | URL: http://libgit2.github.com/ |
18 | BuildRequires: cmake >= 2.6 | |
3c0e613e | 19 | BuildRequires: http-parser-devel |
43bce41a | 20 | BuildRequires: libssh2-devel |
e02620dc KK |
21 | BuildRequires: openssl-devel |
22 | %{?with_tests:BuildRequires: python} | |
23 | BuildRequires: zlib-devel | |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
25 | ||
26 | %description | |
27 | libgit2 is a portable, pure C implementation of the Git core methods | |
28 | provided as a re-entrant linkable library with a solid API, allowing | |
29 | you to write native speed custom Git applications in any language with | |
30 | bindings. | |
31 | ||
6053f043 JB |
32 | %description -l pl.UTF-8 |
33 | libgit2 to przenośna implementacja w czystym C głównych metod Gita, | |
34 | udostępniona jako bezpieczna dla wątków biblioteka ze stałym API, | |
35 | pozwalająca na pisanie własnych aplikacji dla Gita o natywnej | |
36 | szybkości w dowolnym języku posiadającym odpowiednie wiązania. | |
37 | ||
e02620dc | 38 | %package devel |
6053f043 JB |
39 | Summary: Header files for libgit2 library |
40 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libgit2 | |
e02620dc KK |
41 | Group: Development/Libraries |
42 | Requires: %{name} = %{version}-%{release} | |
b96b78fd JB |
43 | Requires: http-parser-devel |
44 | Requires: libssh2-devel | |
6053f043 JB |
45 | Requires: openssl-devel |
46 | Requires: zlib-devel | |
e02620dc KK |
47 | |
48 | %description devel | |
6053f043 JB |
49 | Header files for libgit2 library. |
50 | ||
51 | %description devel -l pl.UTF-8 | |
52 | Pliki nagłówkowe biblioteki libgit2. | |
e02620dc KK |
53 | |
54 | %prep | |
55 | %setup -q | |
3c0e613e | 56 | %patch0 -p1 |
6bc0cd1c | 57 | %patch1 -p1 |
e02620dc KK |
58 | |
59 | %build | |
3ed59b63 | 60 | install -d build |
e02620dc | 61 | cd build |
b96b78fd JB |
62 | # CMakeLists.txt supports only relative LIB_INSTALL_DIR and INCLUDE_INSTALL_DIR |
63 | # (otherwise .pc file is generated incorrectly). | |
64 | # Type (:PATH or :STRING) must be specified explicitly to avoid expansion | |
65 | # relative to cwd. | |
43bce41a | 66 | %cmake .. \ |
b96b78fd JB |
67 | -DINCLUDE_INSTALL_DIR:PATH=include \ |
68 | -DLIB_INSTALL_DIR:PATH=%{_lib} \ | |
2f30668d JB |
69 | %{?with_tests_online:-DONLINE_TESTS:BOOL=ON} \ |
70 | -DTHREADSAFE:BOOL=ON | |
e02620dc KK |
71 | %{__make} |
72 | ||
d1549dd1 | 73 | %{?with_tests:%{__make} test ARGS="-V"} |
e02620dc KK |
74 | |
75 | %install | |
76 | rm -rf $RPM_BUILD_ROOT | |
3ed59b63 | 77 | %{__make} -C build install \ |
e02620dc KK |
78 | DESTDIR=$RPM_BUILD_ROOT |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %post -p /sbin/ldconfig | |
84 | %postun -p /sbin/ldconfig | |
85 | ||
e02620dc KK |
86 | %files |
87 | %defattr(644,root,root,755) | |
88 | %doc AUTHORS CONTRIBUTING.md COPYING README.md | |
89 | %attr(755,root,root) %{_libdir}/libgit2.so.*.*.* | |
5bad49ba | 90 | %attr(755,root,root) %ghost %{_libdir}/libgit2.so.22 |
e02620dc KK |
91 | |
92 | %files devel | |
93 | %defattr(644,root,root,755) | |
94 | %attr(755,root,root) %{_libdir}/libgit2.so | |
95 | %{_includedir}/git2.h | |
96 | %{_includedir}/git2 | |
97 | %{_pkgconfigdir}/libgit2.pc |