]> git.pld-linux.org Git - packages/libgit2.git/blob - libgit2.spec
disable "Build Tests using the Clar suite" when not running tests
[packages/libgit2.git] / libgit2.spec
1 #
2 # Conditional build:
3 %bcond_without  kerberos5       # GSSAPI for SPNEGO auth
4 %bcond_without  tests           # build without tests
5 %bcond_without  libssh          # Link with libssh2 to enable SSH support
6 %bcond_without  curl            # Use cURL for HTTP
7 %bcond_with     tests_online    # build with tests reqiuring online access
8
9 Summary:        C Git library
10 Summary(pl.UTF-8):      Biblioteka Git dla C
11 Name:           libgit2
12 Version:        0.24.0
13 Release:        1
14 License:        GPL v2 with linking exception
15 Group:          Libraries
16 Source0:        https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz
17 # Source0-md5:  8cabf04502d7203793b32f47ca410ae3
18 Patch0:         %{name}-test-online.patch
19 Patch1:         %{name}-no-libgit2-test.patch
20 URL:            http://libgit2.github.com/
21 BuildRequires:  cmake >= 2.8
22 %{?with_curl:BuildRequires:     curl-devel}
23 %{?with_kerberos5:BuildRequires:        heimdal-devel}
24 BuildRequires:  http-parser-devel >= 2
25 %{?with_libssh:BuildRequires:   libssh2-devel}
26 BuildRequires:  openssl-devel
27 BuildRequires:  pkgconfig
28 %{?with_tests:BuildRequires:    python}
29 BuildRequires:  zlib-devel
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
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
35 %description
36 libgit2 is a portable, pure C implementation of the Git core methods
37 provided as a re-entrant linkable library with a solid API, allowing
38 you to write native speed custom Git applications in any language with
39 bindings.
40
41 %description -l pl.UTF-8
42 libgit2 to przenośna implementacja w czystym C głównych metod Gita,
43 udostępniona jako bezpieczna dla wątków biblioteka ze stałym API,
44 pozwalająca na pisanie własnych aplikacji dla Gita o natywnej
45 szybkości w dowolnym języku posiadającym odpowiednie wiązania.
46
47 %package devel
48 Summary:        Header files for libgit2 library
49 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libgit2
50 Group:          Development/Libraries
51 Requires:       %{name} = %{version}-%{release}
52 Requires:       http-parser-devel
53 Requires:       libssh2-devel
54 Requires:       openssl-devel
55 Requires:       zlib-devel
56
57 %description devel
58 Header files for libgit2 library.
59
60 %description devel -l pl.UTF-8
61 Pliki nagłówkowe biblioteki libgit2.
62
63 %prep
64 %setup -q
65 %patch0 -p1
66 %patch1 -p1
67
68 %build
69 install -d build
70 cd build
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.
75 %cmake .. \
76         -DINCLUDE_INSTALL_DIR:PATH=include \
77         -DLIB_INSTALL_DIR:PATH=%{_lib} \
78         %{cmake_with tests BUILD_CLAR} \
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
84 %{__make}
85
86 %{?with_tests:%{__make} test ARGS="-V"}
87
88 %install
89 rm -rf $RPM_BUILD_ROOT
90 %{__make} -C build install \
91         DESTDIR=$RPM_BUILD_ROOT
92
93 %clean
94 rm -rf $RPM_BUILD_ROOT
95
96 %post   -p /sbin/ldconfig
97 %postun -p /sbin/ldconfig
98
99 %files
100 %defattr(644,root,root,755)
101 %doc AUTHORS CONTRIBUTING.md COPYING README.md
102 %attr(755,root,root) %{_libdir}/libgit2.so.*.*.*
103 %attr(755,root,root) %ghost %{_libdir}/libgit2.so.24
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.133041 seconds and 3 git commands to generate.