]>
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 |
8ed0acf8 | 7 | Release: 0.3 |
ec3f1cc9 ER |
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 | |
8ed0acf8 | 12 | Source1: %{name}.init |
13 | Patch0: %{name}-aclocal.patch | |
6d6ce29d | 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 |
8ed0acf8 | 31 | Requires: libicu-devel |
32 | Requires: pkgconfig | |
4fdf00cc ER |
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) | |
ec3f1cc9 ER |
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 | |
6d6ce29d | 51 | %setup -q |
4fdf00cc | 52 | %patch0 -p1 |
ec3f1cc9 ER |
53 | |
54 | %build | |
6d6ce29d | 55 | |
4fdf00cc ER |
56 | %{__libtoolize} |
57 | %{__aclocal} | |
58 | %{__autoconf} | |
59 | %{__autoheader} | |
60 | %{__automake} | |
ec3f1cc9 ER |
61 | %configure |
62 | %{__make} | |
63 | ||
6d6ce29d | 64 | |
ec3f1cc9 ER |
65 | %install |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | %{__make} install \ | |
68 | DESTDIR=$RPM_BUILD_ROOT | |
69 | ||
4fdf00cc | 70 | rm -rf $RPM_BUILD_ROOT%{_docdir}/couchdb |
8ed0acf8 | 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 | |
4fdf00cc | 78 | |
ec3f1cc9 ER |
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 | ||
4fdf00cc ER |
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 | ||
ec3f1cc9 ER |
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 | |
abe26a11 | 105 | %dir %{_sysconfdir}/couchdb |
6d6ce29d | 106 | %dir %{_sysconfdir}/couchdb/default.d |
8ed0acf8 | 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 | |
4fdf00cc | 111 | # XXX -> sysconfdir |
8ed0acf8 | 112 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sysconfig/couchdb |
4fdf00cc ER |
113 | %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/couchdb |
114 | %attr(754,root,root) /etc/rc.d/init.d/couchdb | |
115 | ||
8ed0acf8 | 116 | %dir /var/log/couchdb |
117 | %attr(755,couchdb,couchdb) /var/log/couchdb | |
118 | ||
4fdf00cc ER |
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? | |
6d6ce29d | 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 | |
4fdf00cc | 137 | # XXX check if this include is needed runtime |
abe26a11 | 138 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/include |
6d6ce29d | 139 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/include/couch_db.hrl |
abe26a11 | 140 | |
4fdf00cc | 141 | # XXX: check if .la is needed |
abe26a11 | 142 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv |
6d6ce29d | 143 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/couchspawnkillable |
abe26a11 | 144 | |
145 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib | |
6d6ce29d | 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 | ||
4fdf00cc | 149 | # XXX: better have unversioned dirs? |
6d6ce29d | 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 | ||
abe26a11 | 155 | %dir %{_libdir}/couchdb/erlang/lib/etap |
6d6ce29d | 156 | %{_libdir}/couchdb/erlang/lib/etap/ebin |
abe26a11 | 157 | |
158 | %dir %{_libdir}/couchdb/erlang/lib/erlang-oauth | |
6d6ce29d | 159 | %{_libdir}/couchdb/erlang/lib/erlang-oauth/ebin |
abe26a11 | 160 | |
161 | %dir %{_libdir}/couchdb/erlang/lib/ibrowse-%{_ibrowsever} | |
6d6ce29d | 162 | %{_libdir}/couchdb/erlang/lib/ibrowse-%{_ibrowsever}/ebin |
163 | ||
8ed0acf8 | 164 | %attr(755,couchdb,couchdb) %{_datadir}/couchdb |