]>
Commit | Line | Data |
---|---|---|
6d6ce29d | 1 | %define _mochiwebver r97 |
2 | %define _ibrowsever 1.5.2 | |
3 | ||
ec3f1cc9 ER |
4 | Summary: Apache CouchDB |
5 | Name: apache-couchdb | |
6d6ce29d | 6 | Version: 0.10.0 |
ec3f1cc9 ER |
7 | Release: 0.1 |
8 | License: Apache v2.0 | |
9 | Group: Applications | |
6d6ce29d | 10 | Source0: http://www.apache.org/dist/couchdb/%{version}/%{name}-%{version}.tar.gz |
11 | # Source0-md5: 227886b5ecbb6bcbbdc538aac4592b0e | |
4fdf00cc | 12 | Patch0: %{name}-init.d.patch |
6d6ce29d | 13 | Patch1: %{name}-aclocal.patch |
14 | URL: http://couchdb.apache.org/ | |
ec3f1cc9 ER |
15 | BuildRequires: autoconf >= 2.59 |
16 | BuildRequires: automake >= 1.6.3 | |
6d6ce29d | 17 | BuildRequires: erlang >= 1:R12B5 |
ec3f1cc9 ER |
18 | BuildRequires: help2man |
19 | BuildRequires: js-devel | |
20 | BuildRequires: libicu-devel | |
21 | BuildRequires: libtool | |
4fdf00cc ER |
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 | |
6d6ce29d | 30 | Requires: erlang >= 1:R12B5 |
4fdf00cc ER |
31 | # these came from readme, need to check if these are really needed |
32 | #Requires: Mozilla-SpiderMonkey | |
33 | #Requires: gcc | |
34 | #Requires: make | |
35 | #Requires: openssl | |
36 | Provides: group(couchdb) | |
37 | Provides: user(couchdb) | |
ec3f1cc9 ER |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
39 | ||
40 | %description | |
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. | |
47 | ||
48 | %prep | |
6d6ce29d | 49 | %setup -q |
4fdf00cc | 50 | %patch0 -p1 |
6d6ce29d | 51 | %patch1 -p1 |
ec3f1cc9 ER |
52 | |
53 | %build | |
6d6ce29d | 54 | |
4fdf00cc ER |
55 | %{__libtoolize} |
56 | %{__aclocal} | |
57 | %{__autoconf} | |
58 | %{__autoheader} | |
59 | %{__automake} | |
ec3f1cc9 ER |
60 | %configure |
61 | %{__make} | |
62 | ||
6d6ce29d | 63 | |
ec3f1cc9 ER |
64 | %install |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | %{__make} install \ | |
67 | DESTDIR=$RPM_BUILD_ROOT | |
68 | ||
4fdf00cc ER |
69 | rm -rf $RPM_BUILD_ROOT%{_docdir}/couchdb |
70 | ||
ec3f1cc9 ER |
71 | %clean |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
74 | %pre | |
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 | |
77 | ||
4fdf00cc ER |
78 | %post |
79 | /sbin/chkconfig --add couchdb | |
80 | %service couchdb restart | |
81 | ||
82 | %preun | |
83 | if [ "$1" = "0" ]; then | |
84 | %service -q couchdb stop | |
85 | /sbin/chkconfig --del couchdb | |
86 | fi | |
87 | ||
ec3f1cc9 ER |
88 | %postun |
89 | if [ "$1" = "0" ]; then | |
90 | %userremove couchdb | |
91 | %groupremove couchdb | |
92 | fi | |
93 | ||
94 | %files | |
95 | %defattr(644,root,root,755) | |
96 | %doc AUTHORS BUGS CHANGES NEWS NOTICE README THANKS | |
6d6ce29d | 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 | |
4fdf00cc ER |
101 | # XXX -> sysconfdir |
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 | |
105 | ||
106 | # XXX: sbindir? | |
107 | %attr(755,root,root) %{_bindir}/couchdb | |
108 | %attr(755,root,root) %{_bindir}/couchjs | |
109 | %{_mandir}/man1/couchdb.1* | |
110 | %{_mandir}/man1/couchjs.1* | |
111 | ||
112 | %dir %{_libdir}/couchdb | |
113 | ||
114 | %dir %{_libdir}/couchdb/bin | |
115 | %attr(755,root,root) %{_libdir}/couchdb/bin/couchjs | |
116 | ||
117 | %dir %{_libdir}/couchdb/erlang | |
118 | %dir %{_libdir}/couchdb/erlang/lib | |
119 | # XXX: better have unversioned dirs? | |
6d6ce29d | 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 | |
4fdf00cc | 124 | # XXX check if this include is needed runtime |
6d6ce29d | 125 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/include/couch_db.hrl |
4fdf00cc | 126 | # XXX: check if .la is needed |
6d6ce29d | 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 | |
130 | ||
4fdf00cc | 131 | # XXX: better have unversioned dirs? |
6d6ce29d | 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 | |
136 | ||
137 | %{_libdir}/couchdb/erlang/lib/etap/ebin | |
138 | %{_libdir}/couchdb/erlang/lib/erlang-oauth/ebin | |
139 | %{_libdir}/couchdb/erlang/lib/ibrowse-%{_ibrowsever}/ebin | |
140 | ||
4fdf00cc | 141 | %{_datadir}/couchdb |