diff --git a/couchdb-0001-Do-not-gzip-doc-files-and-do-not-install-installatio.patch b/couchdb-0001-Do-not-gzip-doc-files-and-do-not-install-installatio.patch index f7c0304..5dc882a 100644 --- a/couchdb-0001-Do-not-gzip-doc-files-and-do-not-install-installatio.patch +++ b/couchdb-0001-Do-not-gzip-doc-files-and-do-not-install-installatio.patch @@ -1,7 +1,7 @@ From 0f86f6e868dbdcbf832f28639bdc4c23e3304799 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 13 Feb 2011 13:52:38 +0300 -Subject: [PATCH 01/12] Do not gzip doc-files and do not install installation +Subject: [PATCH 01/13] Do not gzip doc-files and do not install installation instructions Signed-off-by: Peter Lemenkov diff --git a/couchdb-0002-Install-docs-into-versioned-directory.patch b/couchdb-0002-Install-docs-into-versioned-directory.patch index e0c7fa6..b0caae6 100644 --- a/couchdb-0002-Install-docs-into-versioned-directory.patch +++ b/couchdb-0002-Install-docs-into-versioned-directory.patch @@ -1,7 +1,7 @@ From 71ba13a7fb4a06571152da599dae9fe7bcb18807 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 13 Feb 2011 14:06:12 +0300 -Subject: [PATCH 02/12] Install docs into versioned directory +Subject: [PATCH 02/13] Install docs into versioned directory Signed-off-by: Peter Lemenkov --- diff --git a/couchdb-0003-More-directories-to-search-for-place-for-init-script.patch b/couchdb-0003-More-directories-to-search-for-place-for-init-script.patch index 911bb3f..d3dd63c 100644 --- a/couchdb-0003-More-directories-to-search-for-place-for-init-script.patch +++ b/couchdb-0003-More-directories-to-search-for-place-for-init-script.patch @@ -1,7 +1,7 @@ From 80fea41e3912f06e76e487531533e6b77e25ad93 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 13 Feb 2011 14:21:20 +0300 -Subject: [PATCH 03/12] More directories to search for place for init-script +Subject: [PATCH 03/13] More directories to search for place for init-script Signed-off-by: Peter Lemenkov --- diff --git a/couchdb-0004-Install-into-erllibdir-by-default.patch b/couchdb-0004-Install-into-erllibdir-by-default.patch index c6d8bb6..5b45763 100644 --- a/couchdb-0004-Install-into-erllibdir-by-default.patch +++ b/couchdb-0004-Install-into-erllibdir-by-default.patch @@ -1,7 +1,7 @@ From e25c39956757cd457737ae8cba60a488b259e582 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 13 Feb 2011 14:36:36 +0300 -Subject: [PATCH 04/12] Install into erllibdir by default +Subject: [PATCH 04/13] Install into erllibdir by default Signed-off-by: Peter Lemenkov --- diff --git a/couchdb-0005-Don-t-use-bundled-etap-erlang-oauth-ibrowse-and-moch.patch b/couchdb-0005-Don-t-use-bundled-etap-erlang-oauth-ibrowse-and-moch.patch index 913ae1f..7c1fe87 100644 --- a/couchdb-0005-Don-t-use-bundled-etap-erlang-oauth-ibrowse-and-moch.patch +++ b/couchdb-0005-Don-t-use-bundled-etap-erlang-oauth-ibrowse-and-moch.patch @@ -1,7 +1,7 @@ From 7113cf9456398a0f86280f07ed6b6056df4fdc36 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 15 May 2011 18:47:41 +0400 -Subject: [PATCH 05/12] Don't use bundled etap, erlang-oauth, ibrowse and +Subject: [PATCH 05/13] Don't use bundled etap, erlang-oauth, ibrowse and mochiweb Signed-off-by: Peter Lemenkov diff --git a/couchdb-0006-Fixes-for-system-wide-ibrowse.patch b/couchdb-0006-Fixes-for-system-wide-ibrowse.patch index 20e76ef..36212f2 100644 --- a/couchdb-0006-Fixes-for-system-wide-ibrowse.patch +++ b/couchdb-0006-Fixes-for-system-wide-ibrowse.patch @@ -1,7 +1,7 @@ From a09f1bc003bfb3279ed5b5ac39eb799213b346bb Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 13 Feb 2011 14:52:57 +0300 -Subject: [PATCH 06/12] Fixes for system-wide ibrowse +Subject: [PATCH 06/13] Fixes for system-wide ibrowse Signed-off-by: Peter Lemenkov --- diff --git a/couchdb-0007-Remove-pid-file-after-stop.patch b/couchdb-0007-Remove-pid-file-after-stop.patch index a16cfe0..974e999 100644 --- a/couchdb-0007-Remove-pid-file-after-stop.patch +++ b/couchdb-0007-Remove-pid-file-after-stop.patch @@ -1,7 +1,7 @@ From e724c3c7b5d23cbc1e770714a3e313a8c2c0731a Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Mon, 7 Jun 2010 15:08:42 +0400 -Subject: [PATCH 07/12] Remove pid-file after stop +Subject: [PATCH 07/13] Remove pid-file after stop --- bin/couchdb.tpl.in | 4 +--- diff --git a/couchdb-0008-deleting-a-DB-while-it-was-being-opened-would-crash-.patch b/couchdb-0008-deleting-a-DB-while-it-was-being-opened-would-crash-.patch index e498f02..424f2d2 100644 --- a/couchdb-0008-deleting-a-DB-while-it-was-being-opened-would-crash-.patch +++ b/couchdb-0008-deleting-a-DB-while-it-was-being-opened-would-crash-.patch @@ -1,7 +1,7 @@ From d31c7fa681b53f477dc3415b72cf85d15df49b2f Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Sun, 11 Jul 2010 01:00:50 +0000 -Subject: [PATCH 08/12] deleting a DB while it was being opened would crash +Subject: [PATCH 08/13] deleting a DB while it was being opened would crash couch_server git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@962964 13f79535-47bb-0310-9956-ffa450edef68 diff --git a/couchdb-0009-Change-respawn-timeout-to-0.patch b/couchdb-0009-Change-respawn-timeout-to-0.patch index ab92397..8dd048d 100644 --- a/couchdb-0009-Change-respawn-timeout-to-0.patch +++ b/couchdb-0009-Change-respawn-timeout-to-0.patch @@ -1,7 +1,7 @@ From 4bd09efc05b341514d854a5382ef7f967cf1e404 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Thu, 26 Aug 2010 13:22:56 +0400 -Subject: [PATCH 09/12] Change respawn timeout to 0. +Subject: [PATCH 09/13] Change respawn timeout to 0. Signed-off-by: Peter Lemenkov --- diff --git a/couchdb-0010-Relax-curl-dependency-to-7.15-for-RHEL5.patch b/couchdb-0010-Relax-curl-dependency-to-7.15-for-RHEL5.patch index 4528a79..12963ee 100644 --- a/couchdb-0010-Relax-curl-dependency-to-7.15-for-RHEL5.patch +++ b/couchdb-0010-Relax-curl-dependency-to-7.15-for-RHEL5.patch @@ -1,7 +1,7 @@ From fcd8231239e4ca2da118e2c100fd39bc123b2e60 Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Sun, 13 Feb 2011 14:59:16 +0300 -Subject: [PATCH 10/12] Relax curl dependency to 7.15 (for RHEL5) +Subject: [PATCH 10/13] Relax curl dependency to 7.15 (for RHEL5) Signed-off-by: Peter Lemenkov --- diff --git a/couchdb-0011-Added-Spidermonkey-1.8.5-patch.patch b/couchdb-0011-Added-Spidermonkey-1.8.5-patch.patch index 1fec4b1..476c37a 100644 --- a/couchdb-0011-Added-Spidermonkey-1.8.5-patch.patch +++ b/couchdb-0011-Added-Spidermonkey-1.8.5-patch.patch @@ -1,7 +1,7 @@ From 1ebb83df98c94e509666e80b14908696fc0113cc Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 5 May 2011 16:24:08 +0200 -Subject: [PATCH 11/12] Added Spidermonkey 1.8.5 patch +Subject: [PATCH 11/13] Added Spidermonkey 1.8.5 patch --- src/couchdb/priv/couch_js/http.c | 66 ++++++++++++-------- diff --git a/couchdb-0012-Replicator-fix-error-when-restarting-replications-in.patch b/couchdb-0012-Replicator-fix-error-when-restarting-replications-in.patch index 4129b29..f718ac4 100644 --- a/couchdb-0012-Replicator-fix-error-when-restarting-replications-in.patch +++ b/couchdb-0012-Replicator-fix-error-when-restarting-replications-in.patch @@ -1,7 +1,7 @@ From 3f37157da19e8ae2fecc52a3b39be959e17aa713 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Mon, 28 Mar 2011 11:08:58 +0000 -Subject: [PATCH 12/12] Replicator: fix error when restarting replications in +Subject: [PATCH 12/13] Replicator: fix error when restarting replications in OTP R14B02 This is a workaround for a change introduced in OTP R14B02 to the supervisor diff --git a/couchdb-0013-Fix-for-ibrowse-2.2.0.patch b/couchdb-0013-Fix-for-ibrowse-2.2.0.patch new file mode 100644 index 0000000..4921b0a --- /dev/null +++ b/couchdb-0013-Fix-for-ibrowse-2.2.0.patch @@ -0,0 +1,28 @@ +From ad79ce1dee0e5aa571597f2646dc3e5157226ab4 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov +Date: Fri, 20 May 2011 13:11:01 +0400 +Subject: [PATCH 13/13] Fix for ibrowse-2.2.0 + +Signed-off-by: Peter Lemenkov +--- + src/couchdb/couch_rep_httpc.erl | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl +index 2e567e7..15effe5 100644 +--- a/src/couchdb/couch_rep_httpc.erl ++++ b/src/couchdb/couch_rep_httpc.erl +@@ -123,8 +123,8 @@ config_http(Url) -> + redirect_url(RespHeaders, OrigUrl) -> + MochiHeaders = mochiweb_headers:make(RespHeaders), + RedUrl = mochiweb_headers:get_value("Location", MochiHeaders), +- {url, _, Base, Port, _, _, Path, Proto} = ibrowse_lib:parse_url(RedUrl), +- {url, _, _, _, User, Passwd, _, _} = ibrowse_lib:parse_url(OrigUrl), ++ {url, _, Base, Port, _, _, Path, Proto, _} = ibrowse_lib:parse_url(RedUrl), ++ {url, _, _, _, User, Passwd, _, _, _} = ibrowse_lib:parse_url(OrigUrl), + Creds = case is_list(User) andalso is_list(Passwd) of + true -> + User ++ ":" ++ Passwd ++ "@"; +-- +1.7.5.1 + diff --git a/couchdb-0014-Fix-for-js-1.8.5.patch b/couchdb-0014-Fix-for-js-1.8.5.patch new file mode 100644 index 0000000..695bf5f --- /dev/null +++ b/couchdb-0014-Fix-for-js-1.8.5.patch @@ -0,0 +1,92 @@ +From 7e6bc002508b34d21a025865f65a27c8f5969c43 Mon Sep 17 00:00:00 2001 +From: Martin Stransky +Date: Mon, 30 May 2011 21:12:59 +0400 +Subject: [PATCH 14/14] Fix for js-1.8.5 + +--- + src/couchdb/priv/couch_js/main.c | 29 +++++++++++++++++------------ + 1 files changed, 17 insertions(+), 12 deletions(-) + +diff --git a/src/couchdb/priv/couch_js/main.c b/src/couchdb/priv/couch_js/main.c +index 243e971..bcd8096 100644 +--- a/src/couchdb/priv/couch_js/main.c ++++ b/src/couchdb/priv/couch_js/main.c +@@ -10,11 +10,13 @@ + // License for the specific language governing permissions and limitations under + // the License. + ++#include + #include + #include + #include + #include + #include "config.h" ++ + #include "utf8.h" + #include "http.h" + +@@ -46,6 +48,9 @@ static JSClass global_class = { + JSCLASS_NO_OPTIONAL_MEMBERS + }; + ++static void ++printerror(JSContext *cx, const char *mesg, JSErrorReport *report); ++ + static JSBool + evalcx(JSContext *cx, uintN argc, jsval *vp) + { +@@ -63,7 +68,6 @@ evalcx(JSContext *cx, uintN argc, jsval *vp) + return JS_FALSE; + } + +- + subcx = JS_NewContext(JS_GetRuntime(cx), 8L * 1024L); + if(!subcx) + { +@@ -71,20 +75,17 @@ evalcx(JSContext *cx, uintN argc, jsval *vp) + return JS_FALSE; + } + +- JSObject *global = JS_NewCompartmentAndGlobalObject(cx, &global_class, NULL); +- if (!global) return 1; +- JS_SetGlobalObject(subcx, global); +- + SETUP_REQUEST(subcx); + +- src = JS_GetStringCharsZ(cx, str); +- srclen = JS_GetStringLength(str); +- + if(!sandbox) + { +- sandbox = JS_NewObject(subcx, NULL, NULL, NULL); +- if(!sandbox || !JS_InitStandardClasses(subcx, global)) goto done; ++ sandbox = JS_NewCompartmentAndGlobalObject(subcx, &global_class, NULL); ++ if(!sandbox || !JS_InitStandardClasses(subcx, sandbox)) goto done; + } ++ JS_SetGlobalObject(subcx, sandbox); ++ ++ src = JS_GetStringCharsZ(subcx, str); ++ srclen = JS_GetStringLength(str); + + if(srclen == 0) + { +@@ -92,9 +93,13 @@ evalcx(JSContext *cx, uintN argc, jsval *vp) + } + else + { +- jsval rval; +- JS_EvaluateUCScript(subcx, sandbox, src, srclen, NULL, 0, &rval); +- JS_SET_RVAL(cx, vp, rval); ++ JSObject *script = JS_CompileUCScript(subcx, sandbox, src, srclen, NULL, 0); ++ jsval rval; ++ if(script) ++ { ++ JS_ExecuteScript(subcx, sandbox, script, &rval); ++ JS_SET_RVAL(cx, vp, rval); ++ } + } + + ret = JS_TRUE; +-- +1.7.5.2 + diff --git a/couchdb.spec b/couchdb.spec index 68b0e19..f680516 100644 --- a/couchdb.spec +++ b/couchdb.spec @@ -4,7 +4,7 @@ Name: couchdb Version: 1.0.2 -Release: 4%{?dist} +Release: 7%{?dist} Summary: A document database server, accessible via a RESTful JSON API Group: Applications/Databases @@ -24,6 +24,8 @@ Patch9: couchdb-0009-Change-respawn-timeout-to-0.patch Patch10: couchdb-0010-Relax-curl-dependency-to-7.15-for-RHEL5.patch Patch11: couchdb-0011-Added-Spidermonkey-1.8.5-patch.patch Patch12: couchdb-0012-Replicator-fix-error-when-restarting-replications-in.patch +Patch13: couchdb-0013-Fix-for-ibrowse-2.2.0.patch +Patch14: couchdb-0014-Fix-for-js-1.8.5.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -34,7 +36,7 @@ BuildRequires: libtool BuildRequires: curl-devel BuildRequires: erlang-erts BuildRequires: erlang-etap -BuildRequires: erlang-ibrowse +BuildRequires: erlang-ibrowse >= 2.2.0 BuildRequires: erlang-mochiweb BuildRequires: erlang-oauth BuildRequires: help2man @@ -45,7 +47,7 @@ BuildRequires: perl(Test::Harness) Requires: erlang-crypto Requires: erlang-erts -Requires: erlang-ibrowse >= 2.1.0 +Requires: erlang-ibrowse >= 2.2.0 Requires: erlang-inets Requires: erlang-kernel Requires: erlang-mochiweb @@ -83,13 +85,16 @@ JavaScript acting as the default view definition language. %patch8 -p1 -b .fix_crash %patch9 -p1 -b .fix_respawn %if 0%{?el5} -# Erlang/OTP R12B5 +# Old CURL library %patch10 -p1 -b .curl_7_15 %endif +%patch12 -p1 -b .fix_R14B02 +%patch13 -p1 -b .ibrowse_2_2_0 +# JS 1.8.5 %if 0%{?fc15}%{?fc16} %patch11 -p1 -b .to_new_js +%patch14 -p1 -b .to_new_js_again %endif -%patch12 -p1 -b .fix_R14B02 # Remove bundled libraries rm -rf src/erlang-oauth @@ -113,6 +118,12 @@ install -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/%{name} # Use /etc/sysconfig instead of /etc/default mv $RPM_BUILD_ROOT%{_sysconfdir}/{default,sysconfig} +# create /etc/tmpfiles.d entry +%if 0%{?fc15}%{?fc16} +install -d $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d +echo "d /var/run/couchdb 0755 %{couchdb_user} root" > $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf +%endif + %check make check || exit 1 @@ -144,26 +155,39 @@ 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 +%dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/local.d +%dir %{_sysconfdir}/%{name}/default.d +%config(noreplace) %attr(0644, %{couchdb_user}, root) %{_sysconfdir}/%{name}/default.ini +%config(noreplace) %attr(0644, %{couchdb_user}, root) %{_sysconfdir}/%{name}/local.ini +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%if 0%{?fc15}%{?fc16} +%{_sysconfdir}/tmpfiles.d/%{name}.conf +%endif +%{_initrddir}/%{name} +%{_bindir}/%{name} %{_bindir}/couchjs %{_libdir}/erlang/lib/couch-%{version} -%{_datadir}/couchdb -%{_mandir}/man1/couchdb.1.* +%{_datadir}/%{name} +%{_mandir}/man1/%{name}.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 +%dir %attr(0755, %{couchdb_user}, root) %{_localstatedir}/log/%{name} +%dir %attr(0755, %{couchdb_user}, root) %{_localstatedir}/run/%{name} +%dir %attr(0755, %{couchdb_user}, root) %{_localstatedir}/lib/%{name} %changelog +* Sat Jun 18 2011 Peter Lemenkov - 1.0.2-7 +- Requires ibrowse >= 2.2.0 for building +- Fixes for /var/run mounted as tmpfs (see rhbz #656565, #712681) + +* Mon May 30 2011 Peter Lemenkov - 1.0.2-6 +- Patched patch for new js-1.8.5 + +* Fri May 20 2011 Peter Lemenkov - 1.0.2-5 +- Fixed issue with ibrowse-2.2.0 + * Thu May 19 2011 Peter Lemenkov - 1.0.2-4 - Fixed issue with R14B02