]>
Commit | Line | Data |
---|---|---|
7b8d5afb | 1 | # |
75aa8bfe ER |
2 | # TODO: |
3 | # - init script, sysconfig | |
4 | # - merge apache-couchdb/apache-couchdb.spec here | |
b918a33e ER |
5 | # - tmpfiles.d |
6 | # - system packages: | |
7 | # erlang-ibrowse >= 1.5.3 | |
8 | # erlang-mochiweb | |
9 | # erlang-oauth | |
10 | ||
11 | %define mochiwebver r113 | |
12 | %define ibrowsever 1.5.2 | |
7b8d5afb | 13 | Summary: A distributed document-oriented database |
14 | Summary(pl.UTF-8): Rozproszona baza danych oparta o dokumenty | |
15 | Name: couchdb | |
0ee4d046 | 16 | Version: 1.0.1 |
17 | Release: 0.1 | |
b918a33e | 18 | License: Apache v2.0 |
7b8d5afb | 19 | Group: Applications |
b918a33e | 20 | Source0: http://www.apache.org/dist/couchdb/%{version}/apache-%{name}-%{version}.tar.gz |
0ee4d046 | 21 | # Source0-md5: 001cf286b72492617e9ffba271702a00 |
05085770 | 22 | Source1: %{name}.init |
26dc796c | 23 | Source2: %{name}.tmpfiles |
05085770 | 24 | URL: http://couchdb.apache.org/ |
b918a33e ER |
25 | BuildRequires: autoconf >= 2.59 |
26 | BuildRequires: automake >= 1.6.3 | |
0ee4d046 | 27 | BuildRequires: curl-devel >= 7.18.0 |
b918a33e | 28 | BuildRequires: erlang >= 1:R12B5 |
7b8d5afb | 29 | BuildRequires: help2man |
30 | BuildRequires: intltool | |
0ee4d046 | 31 | BuildRequires: js-devel |
32 | BuildRequires: libicu-devel >= 3.4.1 | |
b918a33e | 33 | BuildRequires: libtool |
0ee4d046 | 34 | BuildRequires: pakchois-devel |
b918a33e | 35 | BuildRequires: pkgconfig |
26dc796c | 36 | BuildRequires: rpmbuild(macros) >= 1.647 |
0ee4d046 | 37 | Requires(post,preun): /sbin/chkconfig |
7b8d5afb | 38 | Requires(pre): /bin/id |
39 | Requires(pre): /usr/bin/getgid | |
40 | Requires(pre): /usr/sbin/groupadd | |
41 | Requires(pre): /usr/sbin/useradd | |
b918a33e | 42 | Requires: erlang >= 1:R12B5 |
7b8d5afb | 43 | Provides: group(couchdb) |
44 | Provides: user(couchdb) | |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | Apache CouchDB is a distributed, fault-tolerant and schema-free | |
b918a33e ER |
49 | document-oriented database accessible via a RESTful HTTP/JSON API. |
50 | Among other features, it provides robust, incremental replication with | |
51 | bi-directional conflict detection and resolution, and is queryable and | |
52 | indexable using a table-oriented view engine with JavaScript acting as | |
53 | the default view definition language. | |
7b8d5afb | 54 | |
55 | %description -l pl.UTF-8 | |
7b8d5afb | 56 | Apache CouchDB jest rozproszoną, odporną na błędy, nie wymagającą |
57 | schematów, zorientowaną na dokument bazą danych z RESTowym API opartym | |
b918a33e ER |
58 | o HTTP/JSON. Między innymi zapewnia solidną, przyrostową replikację z |
59 | dwukierunkowym wykrywaniem i rozwiązywaniem konfliktów, oraz | |
60 | odpytywanie i indeksowanie za pośrednictwem opartego na tablicach | |
61 | silnika widoków używającego JavaScriptu jako głównego języka definicji | |
62 | widoku. | |
7b8d5afb | 63 | |
64 | %prep | |
0ee4d046 | 65 | %setup -q -n apache-%{name}-%{version} |
7b8d5afb | 66 | |
67 | %build | |
b918a33e ER |
68 | %{__libtoolize} |
69 | %{__aclocal} -I m4 | |
70 | %{__autoconf} | |
71 | %{__autoheader} | |
72 | %{__automake} | |
73 | %configure \ | |
74 | --with-erlang=%{_libdir}/erlang%{_includedir} \ | |
75 | ||
7b8d5afb | 76 | %{__make} |
77 | ||
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
7b8d5afb | 80 | %{__make} install \ |
81 | DESTDIR=$RPM_BUILD_ROOT | |
82 | ||
b918a33e ER |
83 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} |
84 | mv $RPM_BUILD_ROOT%{_sysconfdir}/default/couchdb $RPM_BUILD_ROOT/etc/sysconfig | |
0ee4d046 | 85 | |
26dc796c | 86 | %{__rm} $RPM_BUILD_ROOT/etc/rc.d/%{name} |
b918a33e ER |
87 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
88 | ||
26dc796c ER |
89 | install -d $RPM_BUILD_ROOT%{systemdtmpfilesdir} |
90 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf | |
91 | ||
b918a33e | 92 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} |
7b8d5afb | 93 | |
94 | %clean | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %pre | |
b918a33e ER |
98 | %groupadd -g 203 -r -f couchdb |
99 | %useradd -u 203 -r -d /var/lib/couchdb -s /bin/sh -c "CouchDB Administrator" -g couchdb couchdb | |
7b8d5afb | 100 | |
101 | %post | |
102 | /sbin/chkconfig --add %{name} | |
103 | %service %{name} restart "CouchDB server" | |
104 | ||
105 | %preun | |
106 | if [ "$1" = "0" ]; then | |
107 | %service %{name} stop | |
108 | /sbin/chkconfig --del %{name} | |
109 | fi | |
110 | ||
b918a33e ER |
111 | %postun |
112 | if [ "$1" = "0" ]; then | |
113 | %userremove couchdb | |
114 | %groupremove couchdb | |
115 | fi | |
116 | ||
7b8d5afb | 117 | %files |
118 | %defattr(644,root,root,755) | |
119 | %doc AUTHORS BUGS CHANGES NEWS NOTICE README THANKS | |
0ee4d046 | 120 | %dir %{_sysconfdir}/couchdb |
121 | %dir %{_sysconfdir}/couchdb/default.d | |
b918a33e ER |
122 | %attr(755,couchdb,couchdb) %dir %{_sysconfdir}/couchdb/local.d |
123 | %attr(644,couchdb,couchdb) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/couchdb/default.ini | |
124 | %attr(644,couchdb,couchdb) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/couchdb/local.ini | |
125 | ||
126 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
127 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
26dc796c | 128 | %{systemdtmpfilesdir}/couchdb.conf |
b918a33e ER |
129 | |
130 | # XXX: sbindir? | |
131 | %attr(755,root,root) %{_bindir}/couchdb | |
132 | %attr(755,root,root) %{_bindir}/couchjs | |
133 | %{_mandir}/man1/couchdb.1* | |
134 | %{_mandir}/man1/couchjs.1* | |
135 | ||
136 | %dir %{_libdir}/couchdb | |
137 | ||
138 | %dir %{_libdir}/couchdb/bin | |
139 | %attr(755,root,root) %{_libdir}/couchdb/bin/couchjs | |
140 | ||
141 | %dir %{_libdir}/couchdb/erlang | |
142 | %dir %{_libdir}/couchdb/erlang/lib | |
143 | # XXX: better have unversioned dirs? | |
144 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version} | |
145 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/ebin | |
146 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/ebin/*.beam | |
147 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/ebin/*.app | |
148 | # XXX check if this include is needed runtime | |
149 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/include | |
150 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/include/couch_db.hrl | |
151 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/include/couch_js_functions.hrl | |
152 | ||
153 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv | |
154 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/couchspawnkillable | |
155 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/stat_descriptions.cfg | |
156 | ||
157 | %dir %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib | |
158 | # XXX: check if .la is needed | |
159 | %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib/couch_icu_driver.la | |
160 | %attr(755,root,root) %{_libdir}/couchdb/erlang/lib/couch-%{version}/priv/lib/couch_icu_driver.so | |
161 | ||
162 | # XXX: better have unversioned dirs? | |
163 | %dir %{_libdir}/couchdb/erlang/lib/mochiweb-%{mochiwebver} | |
164 | %dir %{_libdir}/couchdb/erlang/lib/mochiweb-%{mochiwebver}/ebin | |
165 | %{_libdir}/couchdb/erlang/lib/mochiweb-%{mochiwebver}/ebin/*.beam | |
166 | %{_libdir}/couchdb/erlang/lib/mochiweb-%{mochiwebver}/ebin/*.app | |
167 | ||
168 | %dir %{_libdir}/couchdb/erlang/lib/etap | |
169 | %{_libdir}/couchdb/erlang/lib/etap/ebin | |
170 | ||
171 | %dir %{_libdir}/couchdb/erlang/lib/erlang-oauth | |
172 | %{_libdir}/couchdb/erlang/lib/erlang-oauth/ebin | |
173 | ||
174 | %dir %{_libdir}/couchdb/erlang/lib/ibrowse-%{ibrowsever} | |
175 | %{_libdir}/couchdb/erlang/lib/ibrowse-%{ibrowsever}/ebin | |
176 | ||
177 | %{_datadir}/couchdb | |
178 | ||
0ee4d046 | 179 | %attr(700,couchdb,couchdb) %dir %{_sharedstatedir}/couchdb |
b918a33e ER |
180 | |
181 | %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/couchdb | |
0ee4d046 | 182 | %attr(700,couchdb,couchdb) %dir %{_localstatedir}/log/couchdb |
26dc796c ER |
183 | |
184 | %attr(755,couchdb,root) %dir /var/run/couchdb |