1 |
%define tarname apache-couchdb |
2 |
%define couchdb_user couchdb |
3 |
%define couchdb_group couchdb |
4 |
%define couchdb_home %{_localstatedir}/lib/couchdb |
5 |
|
6 |
Name: couchdb |
7 |
Version: 1.1.1 |
8 |
Release: %mkrel 1 |
9 |
Summary: A document database server, accessible via a RESTful JSON API |
10 |
Group: Databases |
11 |
License: Apache License |
12 |
URL: http://couchdb.apache.org/ |
13 |
Source0: http://www.apache.org/dist/%{name}/%{version}/%{tarname}-%{version}.tar.gz |
14 |
Source1: %{name}.init |
15 |
BuildRequires: erlang-devel erlang-compiler erlang-crypto erlang-eunit |
16 |
BuildRequires: libicu-devel |
17 |
BuildRequires: js-devel |
18 |
BuildRequires: help2man |
19 |
BuildRequires: curl-devel |
20 |
|
21 |
Requires: couchdb-bin |
22 |
#Initscripts |
23 |
Requires(post): chkconfig |
24 |
Requires(preun): chkconfig initscripts |
25 |
|
26 |
Requires(pre): shadow-utils |
27 |
|
28 |
|
29 |
%description |
30 |
Apache CouchDB is a distributed, fault-tolerant and schema-free |
31 |
document-oriented database accessible via a RESTful HTTP/JSON API. |
32 |
Among other features, it provides robust, incremental replication |
33 |
with bi-directional conflict detection and resolution, and is |
34 |
queryable and indexable using a table-oriented view engine with |
35 |
JavaScript acting as the default view definition language. |
36 |
|
37 |
This package contains the initscript needed to start a systemwide instance |
38 |
of CouchDB. |
39 |
|
40 |
%package bin |
41 |
Group: Databases |
42 |
Summary: Binary for Couchdb, a document database server |
43 |
|
44 |
Requires: erlang |
45 |
Requires: erlang-crypto |
46 |
Requires: erlang-ssl |
47 |
Requires: erlang-xmerl |
48 |
Requires: erlang-inets |
49 |
Requires: erlang-tools |
50 |
Requires: erlang-public_key |
51 |
|
52 |
|
53 |
%description bin |
54 |
Apache CouchDB is a distributed, fault-tolerant and schema-free |
55 |
document-oriented database accessible via a RESTful HTTP/JSON API. |
56 |
Among other features, it provides robust, incremental replication |
57 |
with bi-directional conflict detection and resolution, and is |
58 |
queryable and indexable using a table-oriented view engine with |
59 |
JavaScript acting as the default view definition language. |
60 |
|
61 |
This package contains the binary needed to run a CouchDB instance. |
62 |
|
63 |
%prep |
64 |
%setup -q -n %{tarname}-%{version} |
65 |
|
66 |
%build |
67 |
%configure2_5x \ |
68 |
--with-js-include=$(pkg-config --cflags libjs | sed 's/-I//') \ |
69 |
--with-erlang=%_libdir/erlang%_includedir |
70 |
|
71 |
# build seems to fail on klodia, with make -j16 |
72 |
# (no error logger present) error: "Failed to create 16 scheduler-threads(no er (eagain:11); ror logger present) |
73 |
# error: "Failed to creaonly 15 scheduler-threads te 16 scheduler-twhreerae dcs (eagain:11); on(rno erealy 1ror |
74 |
# logger present) teed.\n" |
75 |
# 3 scheduler-threads rror: "Failed to create 16were created.\n" |
76 |
make |
77 |
|
78 |
%install |
79 |
%makeinstall_std |
80 |
|
81 |
## Install couchdb initscript |
82 |
install -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name} |
83 |
|
84 |
# Create /var/log/couchdb |
85 |
mkdir -p %{buildroot}%{_localstatedir}/log/%{name} |
86 |
|
87 |
# Create /var/run/couchdb |
88 |
mkdir -p %{buildroot}%{_localstatedir}/run/%{name} |
89 |
|
90 |
# Create /var/lib/couchdb |
91 |
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name} |
92 |
|
93 |
# Create /etc/couchdb/default.d |
94 |
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/default.d |
95 |
|
96 |
# Create /etc/couchdb/local.d |
97 |
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/local.d |
98 |
|
99 |
## Use /etc/sysconfig instead of /etc/default |
100 |
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig |
101 |
mv %{buildroot}%{_sysconfdir}/default/couchdb \ |
102 |
%{buildroot}%{_sysconfdir}/sysconfig/%{name} |
103 |
rm -rf %{buildroot}%{_sysconfdir}/default |
104 |
|
105 |
# Remove unecessary files |
106 |
rm %{buildroot}%{_sysconfdir}/rc.d/couchdb |
107 |
rm -rf %{buildroot}%{_datadir}/doc/couchdb |
108 |
|
109 |
# clean-up .la archives |
110 |
find %{buildroot} -name '*.la' -exec rm -f {} ';' |
111 |
|
112 |
%pre bin |
113 |
%_pre_useradd %{couchdb_user} %{couchdb_home} /bin/bash |
114 |
|
115 |
%post |
116 |
%_post_service %{name} |
117 |
|
118 |
%postun bin |
119 |
%_postun_userdel %{couchdb_user} |
120 |
|
121 |
%preun |
122 |
%_preun_service %{name} |
123 |
|
124 |
%files |
125 |
%defattr(-,root,root,-) |
126 |
%doc AUTHORS BUGS CHANGES LICENSE NEWS NOTICE README THANKS |
127 |
%config(noreplace) %{_sysconfdir}/sysconfig/%{name} |
128 |
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} |
129 |
%{_initrddir}/%{name} |
130 |
|
131 |
%files bin |
132 |
%defattr(-,root,root,-) |
133 |
%{_bindir}/* |
134 |
%dir %{_sysconfdir}/%{name} |
135 |
%dir %{_sysconfdir}/%{name}/local.d |
136 |
%dir %{_sysconfdir}/%{name}/default.d |
137 |
%config(noreplace) %attr(0644,%{couchdb_user},root) %{_sysconfdir}/%{name}/default.ini |
138 |
%config(noreplace) %attr(0644,%{couchdb_user},root) %{_sysconfdir}/%{name}/local.ini |
139 |
%{_libdir}/%{name} |
140 |
%{_datadir}/%{name} |
141 |
%{_mandir}/man1/* |
142 |
%dir %attr(0755,%{couchdb_user},root) %{_localstatedir}/log/%{name} |
143 |
%dir %attr(0755,%{couchdb_user},root) %{_localstatedir}/run/%{name} |
144 |
%dir %attr(0755,%{couchdb_user},root) %{_localstatedir}/lib/%{name} |