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