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