]>
Commit | Line | Data |
---|---|---|
1 | %define _mochiwebver r97 | |
2 | %define _ibrowsever 1.5.2 | |
3 | ||
4 | Summary: Apache CouchDB | |
5 | Name: apache-couchdb | |
6 | Version: 0.10.0 | |
7 | Release: 0.3 | |
8 | License: Apache v2.0 | |
9 | Group: Applications | |
10 | Source0: http://www.apache.org/dist/couchdb/%{version}/%{name}-%{version}.tar.gz | |
11 | # Source0-md5: 227886b5ecbb6bcbbdc538aac4592b0e | |
12 | Source1: %{name}.init | |
13 | Patch0: %{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 | Requires: libicu-devel | |
32 | Requires: pkgconfig | |
33 | # these came from readme, need to check if these are really needed | |
34 | #Requires: Mozilla-SpiderMonkey | |
35 | #Requires: gcc | |
36 | #Requires: make | |
37 | #Requires: openssl | |
38 | Provides: group(couchdb) | |
39 | Provides: user(couchdb) | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | Apache CouchDB is a distributed, fault-tolerant and schema-free | |
44 | document-oriented database accessible via a RESTful HTTP/JSON API. | |
45 | Among other features, it provides robust, incremental replication with | |
46 | bi-directional conflict detection and resolution, and is queryable and | |
47 | indexable using a table-oriented view engine with JavaScript acting as | |
48 | the default view definition language. | |
49 | ||
50 | %prep | |
51 | %setup -q | |
52 | %patch0 -p1 | |
53 | ||
54 | %build | |
55 | ||
56 | %{__libtoolize} | |
57 | %{__aclocal} | |
58 | %{__autoconf} | |
59 | %{__autoheader} | |
60 | %{__automake} | |
61 | %configure | |
62 | %{__make} | |
63 | ||
64 | ||
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | %{__make} install \ | |
68 | DESTDIR=$RPM_BUILD_ROOT | |
69 | ||
70 | rm -rf $RPM_BUILD_ROOT%{_docdir}/couchdb | |
71 | install -d $RPM_BUILD_ROOT/var/log/couchdb | |
72 | ||
73 | install -d $RPM_BUILD_ROOT/etc/sysconfig | |
74 | mv $RPM_BUILD_ROOT/etc/default/couchdb $RPM_BUILD_ROOT/etc/sysconfig | |
75 | ||
76 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d | |
77 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/couchdb | |
78 | ||
79 | %clean | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | ||
82 | %pre | |
83 | %groupadd -g 203 -r -f couchdb | |
84 | %useradd -u 203 -r -d /var/lib/couchdb -s /bin/sh -c "CouchDB Administrator" -g couchdb couchdb | |
85 | ||
86 | %post | |
87 | /sbin/chkconfig --add couchdb | |
88 | %service couchdb restart | |
89 | ||
90 | %preun | |
91 | if [ "$1" = "0" ]; then | |
92 | %service -q couchdb stop | |
93 | /sbin/chkconfig --del couchdb | |
94 | fi | |
95 | ||
96 | %postun | |
97 | if [ "$1" = "0" ]; then | |
98 | %userremove couchdb | |
99 | %groupremove couchdb | |
100 | fi | |
101 | ||
102 | %files | |
103 | %defattr(644,root,root,755) | |
104 | %doc AUTHORS BUGS CHANGES NEWS NOTICE README THANKS | |
105 | %dir %{_sysconfdir}/couchdb | |
106 | %dir %{_sysconfdir}/couchdb/default.d | |
107 | %attr(755,couchdb,couchdb) %{_sysconfdir}/couchdb/default.d | |
108 | %attr(755,couchdb,couchdb) %dir %{_sysconfdir}/couchdb/local.d | |
109 | %attr(644,couchdb,couchdb) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/couchdb/default.ini | |
110 | %attr(644,couchdb,couchdb) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/couchdb/local.ini | |
111 | # XXX -> sysconfdir | |
112 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sysconfig/couchdb | |
113 | %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/couchdb | |
114 | %attr(754,root,root) /etc/rc.d/init.d/couchdb | |
115 | ||
116 | %dir /var/log/couchdb | |
117 | %attr(755,couchdb,couchdb) /var/log/couchdb | |
118 | ||
119 | # XXX: sbindir? | |
120 | %attr(755,root,root) %{_bindir}/couchdb | |
121 | %attr(755,root,root) %{_bindir}/couchjs | |
122 | %{_mandir}/man1/couchdb.1* | |
123 | %{_mandir}/man1/couchjs.1* | |
124 | ||
125 | %dir %{_libdir}/couchdb | |
126 | ||
127 | %dir %{_libdir}/couchdb/bin | |
128 | %attr(755,root,root) %{_libdir}/couchdb/bin/couchjs | |
129 | ||
130 | %dir %{_libdir}/couchdb/erlang | |
131 | %dir %{_libdir}/couchdb/erlang/lib | |
132 | # XXX: better have unversioned dirs? | |
133 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version} | |
134 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/ebin | |
135 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/ebin/*.beam | |
136 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/ebin/*.app | |
137 | # XXX check if this include is needed runtime | |
138 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/include | |
139 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/include/couch_db.hrl | |
140 | ||
141 | # XXX: check if .la is needed | |
142 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv | |
143 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/couchspawnkillable | |
144 | ||
145 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib | |
146 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib/couch_erl_driver.la | |
147 | %attr(755,root,root) %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib/couch_erl_driver.so | |
148 | ||
149 | # XXX: better have unversioned dirs? | |
150 | %dir %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver} | |
151 | %dir %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}/ebin | |
152 | %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}/ebin/*.beam | |
153 | %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}/ebin/*.app | |
154 | ||
155 | %dir %{_libdir}/couchdb/erlang/lib/etap | |
156 | %{_libdir}/couchdb/erlang/lib/etap/ebin | |
157 | ||
158 | %dir %{_libdir}/couchdb/erlang/lib/erlang-oauth | |
159 | %{_libdir}/couchdb/erlang/lib/erlang-oauth/ebin | |
160 | ||
161 | %dir %{_libdir}/couchdb/erlang/lib/ibrowse-%{_ibrowsever} | |
162 | %{_libdir}/couchdb/erlang/lib/ibrowse-%{_ibrowsever}/ebin | |
163 | ||
164 | %attr(755,couchdb,couchdb) %{_datadir}/couchdb |