]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - merge to couchdb/couchdb.spec | |
3 | ||
4 | %define _mochiwebver r113 | |
5 | %define _ibrowsever 2.1.2 | |
6 | ||
7 | Summary: Apache CouchDB | |
8 | Name: apache-couchdb | |
9 | Version: 1.0.2 | |
10 | Release: 0.1 | |
11 | License: Apache v2.0 | |
12 | Group: Applications | |
13 | Source0: http://www.apache.org/dist/couchdb/%{version}/%{name}-%{version}.tar.gz | |
14 | # Source0-md5: 7ffbbe0f23f672181c89923c9f7a1de1 | |
15 | Source1: %{name}.init | |
16 | URL: http://couchdb.apache.org/ | |
17 | BuildRequires: autoconf >= 2.59 | |
18 | BuildRequires: automake >= 1.6.3 | |
19 | BuildRequires: curl-devel | |
20 | BuildRequires: erlang >= 1:R12B5 | |
21 | BuildRequires: help2man | |
22 | BuildRequires: js-devel | |
23 | BuildRequires: libicu-devel | |
24 | BuildRequires: libtool | |
25 | BuildRequires: pkgconfig | |
26 | BuildRequires: rpmbuild(macros) >= 1.228 | |
27 | Requires(post,preun): /sbin/chkconfig | |
28 | Requires(postun): /usr/sbin/groupdel | |
29 | Requires(postun): /usr/sbin/userdel | |
30 | Requires(pre): /bin/id | |
31 | Requires(pre): /usr/bin/getgid | |
32 | Requires(pre): /usr/sbin/groupadd | |
33 | Requires(pre): /usr/sbin/useradd | |
34 | Requires: erlang >= 1:R12B5 | |
35 | Requires: libicu-devel | |
36 | Requires: pkgconfig | |
37 | # these came from readme, need to check if these are really needed | |
38 | #Requires: Mozilla-SpiderMonkey | |
39 | #Requires: gcc | |
40 | #Requires: make | |
41 | #Requires: openssl | |
42 | Provides: group(couchdb) | |
43 | Provides: user(couchdb) | |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | Apache CouchDB is a distributed, fault-tolerant and schema-free | |
48 | document-oriented database accessible via a RESTful HTTP/JSON API. | |
49 | Among other features, it provides robust, incremental replication with | |
50 | bi-directional conflict detection and resolution, and is queryable and | |
51 | indexable using a table-oriented view engine with JavaScript acting as | |
52 | the default view definition language. | |
53 | ||
54 | %prep | |
55 | %setup -q | |
56 | ||
57 | %build | |
58 | ||
59 | %{__libtoolize} | |
60 | %{__aclocal} -I m4 | |
61 | %{__autoconf} | |
62 | %{__autoheader} | |
63 | %{__automake} | |
64 | %configure | |
65 | %{__make} | |
66 | ||
67 | ||
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | %{__make} install \ | |
71 | DESTDIR=$RPM_BUILD_ROOT | |
72 | ||
73 | rm -rf $RPM_BUILD_ROOT%{_docdir}/couchdb | |
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 | |
81 | ||
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 | ||
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 | ||
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 | |
108 | %dir %{_sysconfdir}/couchdb | |
109 | %dir %{_sysconfdir}/couchdb/default.d | |
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 | |
114 | # XXX -> sysconfdir | |
115 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sysconfig/couchdb | |
116 | %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/couchdb | |
117 | %attr(754,root,root) /etc/rc.d/init.d/couchdb | |
118 | ||
119 | %dir /var/log/couchdb | |
120 | %attr(755,couchdb,couchdb) /var/log/couchdb | |
121 | ||
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? | |
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 | |
140 | # XXX check if this include is needed runtime | |
141 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/include | |
142 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/include/couch_db.hrl | |
143 | ||
144 | # XXX: check if .la is needed | |
145 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv | |
146 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/couchspawnkillable | |
147 | ||
148 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib | |
149 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib/couch_icu_driver.la | |
150 | %attr(755,root,root) %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib/couch_icu_driver.so | |
151 | /usr/lib64/couchdb/erlang/lib/couch-1.0.2/include/couch_js_functions.hrl | |
152 | /usr/lib64/couchdb/erlang/lib/couch-1.0.2/priv/stat_descriptions.cfg | |
153 | ||
154 | # XXX: better have unversioned dirs? | |
155 | %dir %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver} | |
156 | %dir %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}/ebin | |
157 | %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}/ebin/*.beam | |
158 | %{_libdir}/couchdb/erlang/lib/mochiweb-%{_mochiwebver}/ebin/*.app | |
159 | ||
160 | %dir %{_libdir}/couchdb/erlang/lib/etap | |
161 | %{_libdir}/couchdb/erlang/lib/etap/ebin | |
162 | ||
163 | %dir %{_libdir}/couchdb/erlang/lib/erlang-oauth | |
164 | %{_libdir}/couchdb/erlang/lib/erlang-oauth/ebin | |
165 | ||
166 | %dir %{_libdir}/couchdb/erlang/lib/ibrowse-%{_ibrowsever} | |
167 | %{_libdir}/couchdb/erlang/lib/ibrowse-%{_ibrowsever}/ebin | |
168 | ||
169 | %attr(755,couchdb,couchdb) %{_datadir}/couchdb |