[erlang-riak_control] Initial commit (see rhbz #823105)

Peter Lemenkov peter at fedoraproject.org
Sat Jul 28 19:36:17 UTC 2012


commit eba9308801f8ae0b7ae3b8c9c2d8a8d51de121d4
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Sat Jul 28 23:36:09 2012 +0400

    Initial commit (see rhbz #823105)
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 .gitignore                                         |    1 +
 ...po-fix-no-such-function-gen_server-cast-3.patch |   26 ++++++
 ...xport-admin_ring-node_ring_details-2-back.patch |   41 +++++++++
 erlang-riak_control-0003-Fix-includes.patch        |   96 ++++++++++++++++++++
 ...edora-specific-remove-rebar-explicit-deps.patch |   28 ++++++
 erlang-riak_control.spec                           |   93 +++++++++++++++++++
 sources                                            |    1 +
 7 files changed, 286 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..36efd72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/basho-riak_control-0.1.2-0-gc7fd3a9.tar.gz
diff --git a/erlang-riak_control-0001-Typo-fix-no-such-function-gen_server-cast-3.patch b/erlang-riak_control-0001-Typo-fix-no-such-function-gen_server-cast-3.patch
new file mode 100644
index 0000000..2502957
--- /dev/null
+++ b/erlang-riak_control-0001-Typo-fix-no-such-function-gen_server-cast-3.patch
@@ -0,0 +1,26 @@
+From 413559fccf140da7e68cc0ebd79c4a296f814006 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Fri, 29 Jun 2012 16:05:10 +0400
+Subject: [PATCH 1/4] Typo fix (no such function - gen_server:cast/3)
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ src/riak_control_session.erl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/riak_control_session.erl b/src/riak_control_session.erl
+index 4df63df..6b288a1 100644
+--- a/src/riak_control_session.erl
++++ b/src/riak_control_session.erl
+@@ -84,7 +84,7 @@ get_partitions () ->
+     gen_server:call(?MODULE,get_partitions,infinity).
+ 
+ force_update () ->
+-    gen_server:cast(?MODULE,update_ring,infinity).
++    gen_server:cast(?MODULE,update_ring).
+ 
+ %% ===================================================================
+ %% gen_server callbacks
+-- 
+1.7.11.2
+
diff --git a/erlang-riak_control-0002-Re-export-admin_ring-node_ring_details-2-back.patch b/erlang-riak_control-0002-Re-export-admin_ring-node_ring_details-2-back.patch
new file mode 100644
index 0000000..afa4556
--- /dev/null
+++ b/erlang-riak_control-0002-Re-export-admin_ring-node_ring_details-2-back.patch
@@ -0,0 +1,41 @@
+From 59852eec8c72d2d9daacc3829548e35362d3c3de Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Fri, 29 Jun 2012 16:13:42 +0400
+Subject: [PATCH 2/4] Re-export admin_ring:node_ring_details/2 back
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ src/admin_node.erl | 2 +-
+ src/admin_ring.erl | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/admin_node.erl b/src/admin_node.erl
+index 9eabfca..4023562 100644
+--- a/src/admin_node.erl
++++ b/src/admin_node.erl
+@@ -87,7 +87,7 @@ get_node_details (Req,C) ->
+     Node=target_node(Req),
+     {ok,Ring}=riak_core_ring_manager:get_my_ring(),
+     Indices=rpc:call(Node,riak_core_ring,my_indices,[Ring]),
+-    PS=[{struct,admin_ring:node_ring_details(Ring,{P,Node})} || P <- Indices],
++    PS=[{struct,admin_ring:node_ring_details(P,Node)} || P <- Indices],
+     {mochijson2:encode(PS),Req,C}.
+ 
+ %% remote to the target node, perform the action, and return
+diff --git a/src/admin_ring.erl b/src/admin_ring.erl
+index af06251..9b519db 100644
+--- a/src/admin_ring.erl
++++ b/src/admin_ring.erl
+@@ -24,7 +24,8 @@
+          content_types_provided/2,
+          to_json/2,
+          is_authorized/2,
+-         service_available/2
++         service_available/2,
++         node_ring_details/2
+         ]).
+ 
+ %% riak_control and webmachine dependencies
+-- 
+1.7.11.2
+
diff --git a/erlang-riak_control-0003-Fix-includes.patch b/erlang-riak_control-0003-Fix-includes.patch
new file mode 100644
index 0000000..27fba05
--- /dev/null
+++ b/erlang-riak_control-0003-Fix-includes.patch
@@ -0,0 +1,96 @@
+From 3bfffd98433d72171856b0bdc31a7e88059f12f4 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Thu, 26 Jul 2012 23:51:32 +0400
+Subject: [PATCH 3/4] Fix includes
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ src/admin_cluster.erl        | 2 +-
+ src/admin_gui.erl            | 2 +-
+ src/admin_node.erl           | 2 +-
+ src/admin_overview.erl       | 2 +-
+ src/admin_ring.erl           | 2 +-
+ src/riak_control_session.erl | 2 +-
+ 6 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/admin_cluster.erl b/src/admin_cluster.erl
+index 9fa4752..b3d18e9 100644
+--- a/src/admin_cluster.erl
++++ b/src/admin_cluster.erl
+@@ -28,7 +28,7 @@
+         ]).
+ 
+ %% riak_control and webmachine dependencies
+--include_lib("riak_control/include/riak_control.hrl").
++-include("../include/riak_control.hrl").
+ -include_lib("webmachine/include/webmachine.hrl").
+ 
+ %% mappings to the various content types supported for this resource
+diff --git a/src/admin_gui.erl b/src/admin_gui.erl
+index eb2a534..aaef756 100644
+--- a/src/admin_gui.erl
++++ b/src/admin_gui.erl
+@@ -31,7 +31,7 @@
+         ]).
+ 
+ %% riak_control and webmachine dependencies
+--include_lib("riak_control/include/riak_control.hrl").
++-include("../include/riak_control.hrl").
+ -include_lib("webmachine/include/webmachine.hrl").
+ 
+ %% mappings to the various content types supported for this resource
+diff --git a/src/admin_node.erl b/src/admin_node.erl
+index 4023562..f453262 100644
+--- a/src/admin_node.erl
++++ b/src/admin_node.erl
+@@ -28,7 +28,7 @@
+         ]).
+ 
+ %% riak_control and webmachine dependencies
+--include_lib("riak_control/include/riak_control.hrl").
++-include("../include/riak_control.hrl").
+ -include_lib("webmachine/include/webmachine.hrl").
+ 
+ %% mappings to the various content types supported for this resource
+diff --git a/src/admin_overview.erl b/src/admin_overview.erl
+index a658bc6..2f32143 100644
+--- a/src/admin_overview.erl
++++ b/src/admin_overview.erl
+@@ -28,7 +28,7 @@
+         ]).
+ 
+ %% riak_control and webmachine dependencies
+--include_lib("riak_control/include/riak_control.hrl").
++-include("../include/riak_control.hrl").
+ -include_lib("webmachine/include/webmachine.hrl").
+ 
+ %% mappings to the various content types supported for this resource
+diff --git a/src/admin_ring.erl b/src/admin_ring.erl
+index 9b519db..fb5664f 100644
+--- a/src/admin_ring.erl
++++ b/src/admin_ring.erl
+@@ -29,7 +29,7 @@
+         ]).
+ 
+ %% riak_control and webmachine dependencies
+--include_lib("riak_control/include/riak_control.hrl").
++-include("../include/riak_control.hrl").
+ -include_lib("webmachine/include/webmachine.hrl").
+ 
+ %% mappings to the various content types supported for this resource
+diff --git a/src/riak_control_session.erl b/src/riak_control_session.erl
+index 6b288a1..8e75e65 100644
+--- a/src/riak_control_session.erl
++++ b/src/riak_control_session.erl
+@@ -44,7 +44,7 @@
+ -export([get_my_info/0]).
+ 
+ %% record definitions
+--include_lib("riak_control/include/riak_control.hrl").
++-include("../include/riak_control.hrl").
+ 
+ -record(state,
+         { vsn         :: version(),
+-- 
+1.7.11.2
+
diff --git a/erlang-riak_control-0004-Fedora-specific-remove-rebar-explicit-deps.patch b/erlang-riak_control-0004-Fedora-specific-remove-rebar-explicit-deps.patch
new file mode 100644
index 0000000..9c99ce1
--- /dev/null
+++ b/erlang-riak_control-0004-Fedora-specific-remove-rebar-explicit-deps.patch
@@ -0,0 +1,28 @@
+From 9f702d5da7aeb2de4a488598eef53c204dc1a0ab Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Sat, 28 Jul 2012 22:32:58 +0400
+Subject: [PATCH 4/4] Fedora-specific: remove rebar explicit deps
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ rebar.config | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/rebar.config b/rebar.config
+index 834f2c8..5b46ea0 100644
+--- a/rebar.config
++++ b/rebar.config
+@@ -2,10 +2,3 @@
+ {erl_opts, [warnings_as_errors, debug_info]}.
+ {edoc_opts, [{preprocess, true}]}.
+ {cover_enabled, true}.
+-{deps, [
+-       {webmachine, "1.9.1",
+-        {git, "git://github.com/basho/webmachine", {tag, "1.9.1"}}},
+-       {riak_core, "1.1.2",
+-        {git, "git://github.com/basho/riak_core", {tag, "1.1.2"}}}
+-       ]}.
+-
+-- 
+1.7.11.2
+
diff --git a/erlang-riak_control.spec b/erlang-riak_control.spec
new file mode 100644
index 0000000..320dcec
--- /dev/null
+++ b/erlang-riak_control.spec
@@ -0,0 +1,93 @@
+%global realname riak_control
+%global upstream basho
+%global debug_package %{nil}
+%global git_tag c7fd3a9
+%global patchnumber 0
+
+
+Name:		erlang-%{realname}
+Version:	0.1.2
+Release:	2%{?dist}
+Summary:	Admin UI for Riak
+Group:		Development/Languages
+License:	ASL 2.0
+URL:		https://github.com/basho/riak_control
+# wget --content-disposition https://github.com/basho/riak_control/tarball/0.1.2
+Source0:	%{upstream}-%{realname}-%{version}-%{patchnumber}-g%{git_tag}.tar.gz
+# Sent upstream - https://github.com/basho/riak_control/pull/26
+Patch1:		%{name}-0001-Typo-fix-no-such-function-gen_server-cast-3.patch
+# Sent upstream - https://github.com/basho/riak_control/pull/27
+Patch2:		%{name}-0002-Re-export-admin_ring-node_ring_details-2-back.patch
+# Will be proposed for upstream.
+Patch3:		%{name}-0003-Fix-includes.patch
+# Fedora/EPEL-specific - remove rebar dependency checks
+Patch4:		%{name}-0004-Fedora-specific-remove-rebar-explicit-deps.patch
+BuildRequires:	erlang-rebar
+BuildRequires:	erlang-riak_core
+BuildRequires:	erlang-webmachine
+# Error:erlang(erlang:max/2) in R12B and below
+# Error:erlang(erlang:min/2) in R12B and below
+# Error:erlang(lists:keyfind/3) in R12B and below
+Requires:	erlang-erts%{?_isa} >= R13B
+Requires:	erlang-kernel%{?_isa}
+Requires:	erlang-mochiweb%{?_isa}
+Requires:	erlang-os_mon%{?_isa}
+Requires:	erlang-riak_core%{?_isa}
+Requires:	erlang-stdlib%{?_isa}
+Requires:	erlang-webmachine%{?_isa}
+
+
+%description
+Riak Control is a set of webmachine resources, all accessible via the
+/admin/* paths, allow you to inspect your running cluster, and manipulate
+it in various ways.
+
+
+%prep
+%setup -q -n %{upstream}-%{realname}-d5f714a
+chmod 644 priv/admin/fonts/rokkitt-bold.woff
+chmod 644 priv/admin/fonts/rokkitt.woff
+%patch1 -p1 -b .typo
+%patch2 -p1 -b .reexport
+%patch3 -p1 -b .includes
+%patch4 -p1 -b .nodeps
+# remove bundled rebar copy - just to be absolutely sure
+rm -f ./rebar
+
+
+%build
+rebar -v compile
+
+
+%install
+mkdir -p %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/{ebin,include,priv}
+install -p -m 0644 ebin/%{realname}.app %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin/%{realname}.app
+install -p -m 0644 ebin/*.beam %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin
+install -p -m 0644 include/%{realname}.hrl %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/include/
+cp -ar priv/* %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/priv
+
+
+%check
+# No tests are provided as for ver. 0.1.2
+#rebar eunit -v
+
+
+%files
+%doc LICENSE README.org
+%dir %{_libdir}/erlang/lib/%{realname}-%{version}/
+%dir %{_libdir}/erlang/lib/%{realname}-%{version}/ebin/
+%dir %{_libdir}/erlang/lib/%{realname}-%{version}/include/
+%dir %{_libdir}/erlang/lib/%{realname}-%{version}/priv/
+%{_libdir}/erlang/lib/%{realname}-%{version}/ebin/%{realname}.app
+%{_libdir}/erlang/lib/%{realname}-%{version}/ebin/*.beam
+%{_libdir}/erlang/lib/%{realname}-%{version}/include/%{realname}.hrl
+%{_libdir}/erlang/lib/%{realname}-%{version}/priv/*
+
+
+%changelog
+* Thu Jul 26 2012 Peter Lemenkov <lemenkov at gmail.com> - 0.1.2-2
+- Fixed mixed macro usage in spec (mostly cosmetic change)
+- Dropped remaining stuff required by EL5
+
+* Thu May 17 2012 Peter Lemenkov <lemenkov at gmail.com> - 0.1.2-1
+- Initial package
diff --git a/sources b/sources
index e69de29..10ac1e3 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+798797f3ee9f413183d3a227f4051070  basho-riak_control-0.1.2-0-gc7fd3a9.tar.gz


More information about the scm-commits mailing list