Skip to content
Browse files

Fix `platform_lib_dir` definition in packages to compare with devrel …

…settings

In devrel and source builds, `platform_lib_dir` gets set to the `lib` directory
that is created by reltool.  In all packages though, this directory is copied
along with the `releases` and `erts-*` directories into the system lib
directory.  So in all packages `platform_lib_dir` gets defined as a
top level directory containing `lib`, `releases`, and `erts-*`.  The `riak`
script attempts to set the load paths based on this `platform_lib_dir`
setting so source builds act differently than package builds.  This change
fixes that inconsistency and defines a new variable `platform_base_dir`
as the new system lib directory.  `platform_lib_dir` is then defined
as `platform_base_dir/lib` to match up with devrel/source builds.

See: basho/riak#126
  • Loading branch information...
1 parent ec86ce8 commit 8a201d73ed5b6d2b7b89d74f244e7df225902800 @jaredmorrow jaredmorrow committed
Showing with 18 additions and 12 deletions.
  1. +3 −2 package/deb/vars.config
  2. +3 −2 package/freebsd/vars.config
  3. +9 −6 package/rpm/SPECS/riak.spec
  4. +3 −2 package/smartos/vars.config
View
5 package/deb/vars.config
@@ -5,7 +5,8 @@
{platform_bin_dir, "/usr/sbin"}.
{platform_data_dir, "/var/lib/riak"}.
{platform_etc_dir, "/etc/riak"}.
-{platform_lib_dir, "/usr/lib/riak"}.
+{platform_base_dir, "/usr/lib/riak"}.
+{platform_lib_dir, "{{platform_base_dir}}/lib"}.
{platform_log_dir, "/var/log/riak"}.
%%
@@ -41,7 +42,7 @@
%% bin/riak
%%
{runner_script_dir, "/usr/sbin"}.
-{runner_base_dir, "{{platform_lib_dir}}"}.
+{runner_base_dir, "{{platform_base_dir}}"}.
{runner_etc_dir, "{{platform_etc_dir}}"}.
{runner_log_dir, "{{platform_log_dir}}"}.
{pipe_dir, "/tmp/riak/"}.
View
5 package/freebsd/vars.config
@@ -5,7 +5,8 @@
{platform_bin_dir, "/usr/local/sbin"}.
{platform_data_dir, "/var/db/riak"}.
{platform_etc_dir, "/usr/local/etc/riak"}.
-{platform_lib_dir, "/usr/local/lib/riak"}.
+{platform_base_dir, "/usr/local/lib/riak"}.
+{platform_lib_dir, "{{platform_base_dir}}/lib"}.
{platform_log_dir, "/var/log/riak"}.
%%
@@ -41,7 +42,7 @@
%% bin/riak
%%
{runner_script_dir, "{{platform_bin_dir}}"}.
-{runner_base_dir, "{{platform_lib_dir}}"}.
+{runner_base_dir, "{{platform_base_dir}}"}.
{runner_etc_dir, "{{platform_etc_dir}}"}.
{runner_log_dir, "{{platform_log_dir}}"}.
{pipe_dir, "/tmp/riak/"}.
View
15 package/rpm/SPECS/riak.spec
@@ -31,7 +31,8 @@ Riak is a highly scalable, fault-tolerant distributed database
%define platform_bin_dir %{_sbindir}
%define platform_data_dir %{_localstatedir}/lib/%{name}
%define platform_etc_dir %{_sysconfdir}/%{name}
-%define platform_lib_dir %{riak_lib}
+%define platform_base_dir %{riak_lib}
+%define platform_lib_dir %{platform_base_dir}/lib
%define platform_log_dir %{_localstatedir}/log/%{name}
%prep
@@ -43,6 +44,7 @@ cat > rel/vars.config <<EOF
{platform_bin_dir, "%{platform_bin_dir}"}.
{platform_data_dir, "%{platform_data_dir}"}.
{platform_etc_dir, "%{platform_etc_dir}"}.
+{platform_base_dir, "%{platform_base_dir}"}.
{platform_lib_dir, "%{platform_lib_dir}"}.
{platform_log_dir, "%{platform_log_dir}"}.
@@ -79,7 +81,7 @@ cat > rel/vars.config <<EOF
%% bin/riak
%%
{runner_script_dir, "%{platform_bin_dir}"}.
-{runner_base_dir, "%{platform_lib_dir}"}.
+{runner_base_dir, "%{platform_base_dir}"}.
{runner_etc_dir, "%{platform_etc_dir}"}.
{runner_log_dir, "%{platform_log_dir}"}.
{pipe_dir, "/tmp/%{name}/"}.
@@ -96,6 +98,7 @@ make rel
%install
mkdir -p %{buildroot}%{platform_etc_dir}
+mkdir -p %{buildroot}%{platform_base_dir}
mkdir -p %{buildroot}%{platform_lib_dir}
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{platform_data_dir}/dets
@@ -109,11 +112,11 @@ mkdir -p %{buildroot}%{_localstatedir}/run/%{name}
mkdir -p %{buildroot}%{platform_data_dir}/mr_queue
#Copy all necessary lib files etc.
-cp -r $RPM_BUILD_DIR/%{name}-%{_revision}/rel/%{name}/lib %{buildroot}%{platform_lib_dir}
+cp -r $RPM_BUILD_DIR/%{name}-%{_revision}/rel/%{name}/lib %{buildroot}%{platform_base_dir}
cp -r $RPM_BUILD_DIR/%{name}-%{_revision}/rel/%{name}/erts-* \
- %{buildroot}%{platform_lib_dir}
+ %{buildroot}%{platform_base_dir}
cp -r $RPM_BUILD_DIR/%{name}-%{_revision}/rel/%{name}/releases \
- %{buildroot}%{platform_lib_dir}
+ %{buildroot}%{platform_base_dir}
cp -r $RPM_BUILD_DIR/%{name}-%{_revision}/doc/man/man1/*.gz \
%{buildroot}%{_mandir}/man1
install -p -D -m 0644 \
@@ -152,7 +155,7 @@ fi
%post
# Fixup perms for SELinux
-find %{platform_lib_dir} -name "*.so" -exec chcon -t textrel_shlib_t {} \;
+find %{platform_base_dir} -name "*.so" -exec chcon -t textrel_shlib_t {} \;
%files
%defattr(-,root,root)
View
5 package/smartos/vars.config
@@ -5,7 +5,8 @@
{platform_bin_dir, "/opt/local/sbin"}.
{platform_data_dir, "/var/db/riak"}.
{platform_etc_dir, "/opt/local/etc/riak"}.
-{platform_lib_dir, "/opt/local/lib/riak"}.
+{platform_base_dir, "/opt/local/lib/riak"}.
+{platform_lib_dir, "{{platform_base_dir}}/lib"}.
{platform_log_dir, "/var/log/riak"}.
@@ -42,7 +43,7 @@
%% bin/riak
%%
{runner_script_dir, "{{platform_bin_dir}}"}.
-{runner_base_dir, "{{platform_lib_dir}}"}.
+{runner_base_dir, "{{platform_base_dir}}"}.
{runner_etc_dir, "{{platform_etc_dir}}"}.
{runner_log_dir, "{{platform_log_dir}}"}.
{pipe_dir, "/tmp/riak/"}.

0 comments on commit 8a201d7

Please sign in to comment.
Something went wrong with that request. Please try again.