summaryrefslogtreecommitdiffstats
path: root/libcouchbase.spec
blob: 8892dec354ffa1a8e2ef6f12ff53eeb55a1463e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
%global gh_owner    couchbase
%global gh_commit   b2ad9312dfe25c792b03231166c80cf5761cafdd
%global gh_short    %(c=%{gh_commit}; echo ${c:0:7})

# Tests require some need which are downloaded during make
%global with_tests  %{?_with_tests:1}%{!?_with_tests:0}

%if 0%{?fedora} >= 15 || 0%{?rhel} >= 6
%global with_dtrace 1
%else
%global with_dtrace 0
%endif

Name:          libcouchbase
Version:       2.0.5
Release:       1%{?dist}
Summary:       Couchbase client library
Group:         System Environment/Libraries
License:       ASL 2.0
URL:           http://www.couchbase.com/develop/c/current
Source0:       https://github.com/%{gh_owner}/%{name}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz

%if %{with_tests}
Source10:      http://googletest.googlecode.com/files/gtest-1.6.0.zip
Source11:      http://files.couchbase.com/maven2/org/couchbase/mock/CouchbaseMock/0.5-SNAPSHOT/CouchbaseMock-0.5-20120726.220757-19.jar
%endif

BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libtool
BuildRequires: cyrus-sasl-devel
BuildRequires: libevent-devel >= 1.4
BuildRequires: libev-devel >= 1.4
%if %{with_dtrace}
BuildRequires: systemtap-sdt-devel >= 1.8
%endif


%description
The C library provides fast access to documents in Couchbase Server 2.0.
With JSON documents and Couchbase server 2.0 you have new ways to index
and query data stored in the cluster through views. This client library,
libcouchbase, also simplifies requests to Views through its handling of
HTTP transport.

This Couchbase Client Library for C and C++ provides a complete interface
to the functionality of Couchbase Server.


%package       devel
Summary:       Development files for Couchbase client library
Group:         Development/Libraries
Requires:      %{name}%{?_isa} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%package       tools
Summary:       Couchbase tools
Group:         Applications/System
Requires:      %{name}%{?_isa} = %{version}-%{release}

%description tools
The %{name}-tools package contains some command line tools to manage
a Couchbase Server.


%prep
%setup -qn %{name}-%{gh_commit}

cat <<EOF | tee m4/version.m4
m4_define([VERSION_NUMBER], [%{version}])
m4_define([GIT_CHANGESET],[%{gh_commit}])
EOF

%if %{with_tests}
cp %{SOURCE10} gtest-1.6.0.zip
cp %{SOURCE11} tests/CouchbaseMock.jar
%endif


%build
autoreconf -i --force

# Hack for manpage layout
sed -e '/manpage_layout=/s/=.*/=bsd/' \
    -i configure

%{configure} \
%if ! %{with_tests}
    --disable-tests \
    --disable-couchbasemock \
%endif
    --enable-system-libsasl

make %{?_smp_mflags} V=1


%install
make install DESTDIR=%{buildroot}

# Remove uneeded files
rm -f %{buildroot}%{_libdir}/*.la


%files
%defattr(-,root,root,-)
%doc LICENSE RELEASE_NOTES.markdown
%{_libdir}/%{name}.so.*
# Backends
%{_libdir}/%{name}_libevent.so
%{_libdir}/%{name}_libev.so

%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}
%{_mandir}/man3/couch*
%{_mandir}/man3/lcb*
%{_mandir}/man5/lcb*
%{_libdir}/%{name}.so

%files tools
%defattr(-,root,root,-)
%{_bindir}/cbc*
%{_mandir}/man1/cbc*
%{_mandir}/man5/cbc*

%check
%if %{with_tests}
make check
%else
: check disabled, missing '--with tests' option
%endif


%changelog
* Sun Apr 14 2013 Remi Collet <remi@feoraproject.org> - 2.0.5-1
- Initial package