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