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