%define couchdb_user couchdb %define couchdb_group couchdb %define couchdb_home %{_localstatedir}/lib/couchdb Name: couchdb Version: 1.0.2 Release: 2%{?dist} Summary: A document database server, accessible via a RESTful JSON API Group: Applications/Databases License: ASL 2.0 URL: http://couchdb.apache.org/ Source0: http://www.apache.org/dist/%{name}/%{version}/apache-%{name}-%{version}.tar.gz Source1: %{name}.init Patch1: couchdb-0001-Do-not-gzip-doc-files-and-do-not-install-installatio.patch Patch2: couchdb-0002-Install-docs-into-versioned-directory.patch Patch3: couchdb-0003-More-directories-to-search-for-place-for-init-script.patch Patch4: couchdb-0004-Install-into-erllibdir-by-default.patch Patch5: couchdb-0005-Remove-bundled-erlang-oauth-library.patch Patch6: couchdb-0006-Remove-bundled-etap-library.patch Patch7: couchdb-0007-Remove-bundled-ibrowse-library.patch Patch8: couchdb-0008-Remove-bundled-mochiweb-library.patch Patch9: couchdb-0009-Fixes-for-system-wide-ibrowse.patch Patch10: couchdb-0010-Remove-pid-file-after-stop.patch Patch11: couchdb-0011-deleting-a-DB-while-it-was-being-opened-would-crash-.patch Patch12: couchdb-0012-Change-respawn-timeout-to-0.patch Patch13: couchdb-0013-Relax-curl-dependency-to-7.15-for-RHEL5.patch Patch14: couchdb-0014-Port-to-Spidermonkey-1.8.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: curl-devel BuildRequires: erlang-erts BuildRequires: erlang-etap BuildRequires: erlang-ibrowse BuildRequires: erlang-mochiweb BuildRequires: erlang-oauth BuildRequires: help2man BuildRequires: js-devel BuildRequires: libicu-devel # For /usr/bin/prove BuildRequires: perl(Test::Harness) Requires: erlang-crypto Requires: erlang-erts Requires: erlang-ibrowse >= 2.1.0 Requires: erlang-inets Requires: erlang-kernel Requires: erlang-mochiweb Requires: erlang-oauth Requires: erlang-sasl Requires: erlang-stdlib Requires: erlang-tools #Initscripts Requires(post): chkconfig Requires(preun): chkconfig initscripts # Users and groups Requires(pre): shadow-utils %description Apache CouchDB is a distributed, fault-tolerant and schema-free document-oriented database accessible via a RESTful HTTP/JSON API. Among other features, it provides robust, incremental replication with bi-directional conflict detection and resolution, and is queryable and indexable using a table-oriented view engine with JavaScript acting as the default view definition language. %prep %setup -q -n apache-%{name}-%{version} %patch1 -p1 -b .dont_gzip %patch2 -p1 -b .use_versioned_docdir %patch3 -p1 -b .more_init_dirs %patch4 -p1 -b .install_into_erldir %patch5 -p1 -b .remove_bundled_oauth %patch6 -p1 -b .remove_bundled_etap %patch7 -p1 -b .remove_bundled_ibrowse %patch8 -p1 -b .remove_bundled_mochiweb %patch9 -p1 -b .workaround_for_system_wide_ibrowse %patch10 -p1 -b .remove_pid_file %patch11 -p1 -b .fix_crash %patch12 -p1 -b .fix_respawn %if 0%{?el5} # Erlang/OTP R12B5 %patch13 -p1 -b .curl_7_15 %endif %patch14 -p1 -b .to_new_js %build autoreconf -ivf %configure make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT # Install our custom couchdb initscript install -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/%{name} # Use /etc/sysconfig instead of /etc/default mv $RPM_BUILD_ROOT%{_sysconfdir}/{default,sysconfig} %check make check || exit 1 %clean rm -rf $RPM_BUILD_ROOT %pre getent group %{couchdb_group} >/dev/null || groupadd -r %{couchdb_group} getent passwd %{couchdb_user} >/dev/null || \ useradd -r -g %{couchdb_group} -d %{couchdb_home} -s /bin/bash \ -c "Couchdb Database Server" %{couchdb_user} exit 0 %post /sbin/chkconfig --add couchdb %preun if [ $1 = 0 ] ; then /sbin/service couchdb stop >/dev/null 2>&1 /sbin/chkconfig --del couchdb fi %files %defattr(-,root,root,-) %doc AUTHORS BUGS CHANGES LICENSE NEWS NOTICE README THANKS %dir %{_sysconfdir}/couchdb %dir %{_sysconfdir}/couchdb/local.d %dir %{_sysconfdir}/couchdb/default.d %config(noreplace) %attr(0644, %{couchdb_user}, root) %{_sysconfdir}/couchdb/default.ini %config(noreplace) %attr(0644, %{couchdb_user}, root) %{_sysconfdir}/couchdb/local.ini %config(noreplace) %{_sysconfdir}/sysconfig/couchdb %config(noreplace) %{_sysconfdir}/logrotate.d/couchdb %{_initrddir}/couchdb %{_bindir}/couchdb %{_bindir}/couchjs %{_libdir}/erlang/lib/couch-%{version} %{_datadir}/couchdb %{_mandir}/man1/couchdb.1.* %{_mandir}/man1/couchjs.1.* %dir %attr(0755, %{couchdb_user}, root) %{_localstatedir}/log/couchdb %dir %attr(0755, %{couchdb_user}, root) %{_localstatedir}/run/couchdb %dir %attr(0755, %{couchdb_user}, root) %{_localstatedir}/lib/couchdb %changelog * Tue May 3 2011 Jan Horak - 1.0.2-2 - Added patch for Spidermonkey 1.8.5 * Thu Nov 25 2010 Peter Lemenkov 1.0.2-1 - Ver. 1.0.2 - Patches were rebased * Tue Oct 12 2010 Peter Lemenkov 1.0.1-4 - Added patches for compatibility with R12B5 * Mon Oct 11 2010 Peter Lemenkov 1.0.1-3 - Narrowed list of BuildRequires * Thu Aug 26 2010 Peter Lemenkov 1.0.1-2 - Cleaned up spec-file a bit * Fri Aug 6 2010 Peter Lemenkov 1.0.1-1 - Ver. 1.0.1 * Thu Jul 15 2010 Peter Lemenkov 1.0.0-1 - Ver. 1.0.0 * Wed Jul 14 2010 Peter Lemenkov 0.11.1-1 - Ver. 0.11.1 - Removed patch for compatibility with Erlang/OTP R14A (merged upstream) * Sun Jul 11 2010 Peter Lemenkov 0.11.0-3 - Compatibility with Erlang R14A (see patch9) * Tue Jun 22 2010 Peter Lemenkov 0.11.0-2 - Massive spec cleanup * Tue Jun 18 2010 Peter Lemenkov 0.11.0-1 - Ver. 0.11.0 (a feature-freeze release candidate) * Fri Jun 18 2010 Peter Lemenkov 0.10.2-13 - Remove ldconfig invocation (no system-wide shared libraries) - Removed icu-config requires * Tue Jun 15 2010 Peter Lemenkov 0.10.2-12 - Narrow explicit requires * Tue Jun 8 2010 Peter Lemenkov 0.10.2-11 - Remove bundled ibrowse library (see rhbz #581282). * Mon Jun 7 2010 Peter Lemenkov 0.10.2-10 - Use system-wide erlang-mochiweb instead of bundled copy (rhbz #581284) - Added %%check target and necessary BuildRequires - etap, oauth, mochiweb * Wed Jun 2 2010 Peter Lemenkov 0.10.2-9 - Remove pid-file after stopping CouchDB * Tue Jun 1 2010 Peter Lemenkov 0.10.2-8 - Suppress unneeded message while stopping CouchDB via init-script * Mon May 31 2010 Peter Lemenkov 0.10.2-7 - Do not manually remove pid-file while stopping CouchDB * Mon May 31 2010 Peter Lemenkov 0.10.2-6 - Fix 'stop' and 'status' targets in the init-script (see rhbz #591026) * Thu May 27 2010 Peter Lemenkov 0.10.2-5 - Use system-wide erlang-etap instead of bundled copy (rhbz #581281) * Fri May 14 2010 Peter Lemenkov 0.10.2-4 - Use system-wide erlang-oauth instead of bundled copy (rhbz #581283) * Thu May 13 2010 Peter Lemenkov 0.10.2-3 - Fixed init-script to use /etc/sysconfig/couchdb values (see rhbz #583004) - Fixed installation location of beam-files (moved to erlang directory) * Fri May 7 2010 Peter Lemenkov 0.10.2-2 - Remove useless BuildRequires * Fri May 7 2010 Peter Lemenkov 0.10.2-1 - Update to 0.10.2 (resolves rhbz #578580 and #572176) - Fixed chkconfig priority (see rhbz #579568) * Fri Apr 02 2010 Caolán McNamara 0.10.0-3 - rebuild for icu 4.4 * Thu Oct 15 2009 Allisson Azevedo 0.10.0-2 - Added patch to force init_enabled=true in configure.ac. * Thu Oct 15 2009 Allisson Azevedo 0.10.0-1 - Update to 0.10.0. * Sun Oct 04 2009 Rahul Sundaram 0.9.1-2 - Change url. Fixes rhbz#525949 * Thu Jul 30 2009 Allisson Azevedo 0.9.1-1 - Update to 0.9.1. - Drop couchdb-0.9.0-pid.patch. * Fri Jul 24 2009 Fedora Release Engineering - 0.9.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Tue Apr 21 2009 Allisson Azevedo 0.9.0-2 - Fix permission for ini files. - Fix couchdb.init start process. * Tue Apr 21 2009 Allisson Azevedo 0.9.0-1 - Update to 0.9.0. * Tue Nov 25 2008 Allisson Azevedo 0.8.1-4 - Use /etc/sysconfig for settings. * Tue Nov 25 2008 Allisson Azevedo 0.8.1-3 - Fix couchdb_home. - Added libicu-devel for requires. * Tue Nov 25 2008 Allisson Azevedo 0.8.1-2 - Fix spec issues. * Tue Nov 25 2008 Allisson Azevedo 0.8.1-1 - Initial RPM release