1 %define _mochiwebver r97
2 %define _ibrowsever 1.5.2
4 Summary: Apache CouchDB
10 Source0: http://www.apache.org/dist/couchdb/%{version}/%{name}-%{version}.tar.gz
11 # Source0-md5: 227886b5ecbb6bcbbdc538aac4592b0e
12 Patch0: %{name}-init.d.patch
13 Patch1: %{name}-aclocal.patch
14 URL: http://couchdb.apache.org/
15 BuildRequires: autoconf >= 2.59
16 BuildRequires: automake >= 1.6.3
17 BuildRequires: erlang >= 1:R12B5
18 BuildRequires: help2man
19 BuildRequires: js-devel
20 BuildRequires: libicu-devel
21 BuildRequires: libtool
22 BuildRequires: rpmbuild(macros) >= 1.228
23 Requires(post,preun): /sbin/chkconfig
24 Requires(postun): /usr/sbin/groupdel
25 Requires(postun): /usr/sbin/userdel
26 Requires(pre): /bin/id
27 Requires(pre): /usr/bin/getgid
28 Requires(pre): /usr/sbin/groupadd
29 Requires(pre): /usr/sbin/useradd
30 Requires: erlang >= 1:R12B5
31 # these came from readme, need to check if these are really needed
32 #Requires: Mozilla-SpiderMonkey
36 Provides: group(couchdb)
37 Provides: user(couchdb)
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 Apache CouchDB is a distributed, fault-tolerant and schema-free
42 document-oriented database accessible via a RESTful HTTP/JSON API.
43 Among other features, it provides robust, incremental replication with
44 bi-directional conflict detection and resolution, and is queryable and
45 indexable using a table-oriented view engine with JavaScript acting as
46 the default view definition language.
65 rm -rf $RPM_BUILD_ROOT
67 DESTDIR=$RPM_BUILD_ROOT
69 rm -rf $RPM_BUILD_ROOT%{_docdir}/couchdb
72 rm -rf $RPM_BUILD_ROOT
75 %groupadd -g 203 -r -f couchdb
76 %useradd -u 203 -r -d /var/lib/couchdb -s /bin/sh -c "CouchDB Administrator" -g couchdb couchdb
79 /sbin/chkconfig --add couchdb
80 %service couchdb restart
83 if [ "$1" = "0" ]; then
84 %service -q couchdb stop
85 /sbin/chkconfig --del couchdb
89 if [ "$1" = "0" ]; then
95 %defattr(644,root,root,755)
96 %doc AUTHORS BUGS CHANGES NEWS NOTICE README THANKS
97 %dir %{_sysconfdir}/couchdb/default.d
98 %dir %{_sysconfdir}/couchdb/local.d
99 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/couchdb/default.ini
100 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/couchdb/local.ini
102 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/default/couchdb
103 %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/couchdb
104 %attr(754,root,root) /etc/rc.d/init.d/couchdb
107 %attr(755,root,root) %{_bindir}/couchdb
108 %attr(755,root,root) %{_bindir}/couchjs
109 %{_mandir}/man1/couchdb.1*
110 %{_mandir}/man1/couchjs.1*
112 %dir %{_libdir}/couchdb
114 %dir %{_libdir}/couchdb/bin
115 %attr(755,root,root) %{_libdir}/couchdb/bin/couchjs
117 %dir %{_libdir}/couchdb/erlang
118 %dir %{_libdir}/couchdb/erlang/lib
119 # XXX: better have unversioned dirs?
120 %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}
121 %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/ebin
122 %{_libdir}/couchdb/erlang/lib/couch-%{version}/ebin/*.beam
123 %{_libdir}/couchdb/erlang/lib/couch-%{version}/ebin/*.app
124 # XXX check if this include is needed runtime
125 %{_libdir}/couchdb/erlang/lib/couch-%{version}/include/couch_db.hrl
126 # XXX: check if .la is needed
127 %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/couchspawnkillable
128 %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib/couch_erl_driver.la
129 %attr(755,root,root) %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib/couch_erl_driver.so
131 # XXX: better have unversioned dirs?
132 %dir %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}
133 %dir %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}/ebin
134 %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}/ebin/*.beam
135 %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}/ebin/*.app
137 %{_libdir}/couchdb/erlang/lib/etap/ebin
138 %{_libdir}/couchdb/erlang/lib/erlang-oauth/ebin
139 %{_libdir}/couchdb/erlang/lib/ibrowse-%{_ibrowsever}/ebin