Blob Blame History Raw
From acf0985e22e8ce49513bdbfa504dd132fe1a8624 Mon Sep 17 00:00:00 2001
From: Jan Zeleny <>
Date: Thu, 11 Dec 2014 13:17:18 +0100
Subject: [PATCH 1/2] Add support for %nfsmountable macro

If the macro is set in the collection, the layout of the collection changes:
- the configuration is moved out of /opt to /etc/opt
- the data are moved from /opt to /var/opt

Along with this change, another one is necessary. For the sake of conformance
with FHS, let's not make the _scl_base configurable. Having collections
anywhere outside /opt would not make much sense and more importantly, it would
likely cause troubles (having /etc/usr/lib instead of /etc/opt and similar).
 macros.scl | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/macros.scl b/macros.scl
index 094bde95d390640fb070424b50d31b0a495c732c..aaa7a809ab33f266f915554275a4566abf3505e3 100644
--- a/macros.scl
+++ b/macros.scl
@@ -42,7 +42,7 @@ package or when debugging this package.
 %global pkg_name		%1
 %global scl_name		%{scl}
 %global scl_runtime		%{scl}-runtime
-%{!?scl_basedir:		%global scl_basedir /opt}
+%global scl_basedir		/opt
 %{!?scl_vendor:			%global scl_vendor rh}
 %{!?_scl_prefix:		%global _scl_prefix %{scl_basedir}/%{scl_vendor}}
 %global _scl_scripts		%{_scl_prefix}/%{scl}
@@ -67,9 +67,12 @@ package or when debugging this package.
 %global _sbindir		%{_exec_prefix}/sbin
 %global _libexecdir		%{_exec_prefix}/libexec
 %global _datadir		%{_prefix}/share
-%global _sysconfdir		%{_root_sysconfdir}/opt/%{scl_vendor}/scls/%{scl}
-%global _sharedstatedir		%{_root_localstatedir}/opt/%{scl_vendor}/scls/%{scl}/lib
-%global _localstatedir		%{_root_localstatedir}/opt/%{scl_vendor}/scls/%{scl}
+%global _sysconfdir		%{_scl_root}/etc
+%{?nfsmountable:		%global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/scls/%{scl}}
+%global _sharedstatedir		%{_scl_root}/var/lib
+%{?nfsmountable:		%global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}/lib}
+%global _localstatedir		%{_scl_root}/var
+%{?nfsmountable:		%global _localstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}}
 %global _libdir			%{_exec_prefix}/%{_lib}
 %global _includedir		%{_prefix}/include
 %global _infodir		%{_datadir}/info