]> git.pld-linux.org Git - packages/libgit2.git/blob - libgit2.spec
adjust online tests workaround; rel 4
[packages/libgit2.git] / libgit2.spec
1 #
2 # Conditional build:
3 %bcond_without  curl            # Use cURL for HTTP
4 %bcond_without  kerberos5       # GSSAPI for SPNEGO auth
5 %bcond_without  libssh          # SSH support via libssh2
6 %bcond_without  tests           # build without tests
7
8 Summary:        C Git library
9 Summary(pl.UTF-8):      Biblioteka Git dla C
10 Name:           libgit2
11 Version:        0.27.4
12 Release:        4
13 License:        GPL v2 with linking exception
14 Group:          Libraries
15 #Source0Download: https://github.com/libgit2/libgit2/releases
16 Source0:        https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz
17 # Source0-md5:  d38b06b3de52ff5ef0c29e7b5dbe415b
18 Patch0:         %{name}-no-libgit2-test.patch
19 URL:            http://libgit2.github.com/
20 BuildRequires:  cmake >= 2.8
21 %{?with_curl:BuildRequires:     curl-devel}
22 %{?with_kerberos5:BuildRequires:        heimdal-devel}
23 BuildRequires:  http-parser-devel >= 2
24 %{?with_libssh:BuildRequires:   libssh2-devel}
25 BuildRequires:  openssl-devel
26 BuildRequires:  pkgconfig
27 %{?with_tests:BuildRequires:    python}
28 BuildRequires:  zlib-devel
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 # Usage: cmake_with BCOND_NAME [OPTION_NAME]
32 %define         cmake_on_off() -D%{?2}%{!?2:%{1}}:BOOL=%{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}}
33
34 %description
35 libgit2 is a portable, pure C implementation of the Git core methods
36 provided as a re-entrant linkable library with a solid API, allowing
37 you to write native speed custom Git applications in any language with
38 bindings.
39
40 %description -l pl.UTF-8
41 libgit2 to przenośna implementacja w czystym C głównych metod Gita,
42 udostępniona jako bezpieczna dla wątków biblioteka ze stałym API,
43 pozwalająca na pisanie własnych aplikacji dla Gita o natywnej
44 szybkości w dowolnym języku posiadającym odpowiednie wiązania.
45
46 %package devel
47 Summary:        Header files for libgit2 library
48 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libgit2
49 Group:          Development/Libraries
50 Requires:       %{name} = %{version}-%{release}
51 Requires:       http-parser-devel
52 Requires:       libssh2-devel
53 Requires:       openssl-devel
54 Requires:       zlib-devel
55
56 %description devel
57 Header files for libgit2 library.
58
59 %description devel -l pl.UTF-8
60 Pliki nagłówkowe biblioteki libgit2.
61
62 %prep
63 %setup -q
64 %patch0 -p1
65
66 # Don't test network
67 sed -i 's/ionline/xonline/' tests/CMakeLists.txt
68
69 %build
70 install -d build
71 cd build
72 # CMakeLists.txt supports only relative LIB_INSTALL_DIR and INCLUDE_INSTALL_DIR
73 # (otherwise .pc file is generated incorrectly).
74 # Type (:PATH or :STRING) must be specified explicitly to avoid expansion
75 # relative to cwd.
76 %cmake .. \
77         -DINCLUDE_INSTALL_DIR:PATH=include \
78         -DLIB_INSTALL_DIR:PATH=%{_lib} \
79         %{cmake_on_off tests BUILD_CLAR} \
80         %{cmake_on_off curl CURL} \
81         %{cmake_on_off kerberos5 USE_GSSAPI} \
82         %{cmake_on_off libssh USE_SSH} \
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.27
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.064015 seconds and 3 git commands to generate.