Skip to content

Commit

Permalink
create apparmor abstractions for openSUSE
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Goll <[email protected]>
  • Loading branch information
mslacken committed Feb 4, 2025
1 parent 36c82c4 commit 3aebab6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions components/admin/lmod/SPECS/lmod.spec
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ BuildRequires: lua53-devel
BuildRequires: procps
Requires: lua53-luafilesystem
Requires: lua53-luaposix
Requires: (lua-lmod-apparmor-abstractions%{PROJ_DELIM} if apparmor-abstractions)
Conflicts: Modules
%endif

Expand All @@ -58,6 +59,18 @@ Patch2: lmod.site.patch
Lmod: An Environment Module System based on Lua, Reads TCL Modules,
Supports a Software Hierarchy

%if 0%{?sle_version}
%package apparmor-abstractions%{PROJ_DELIM}
Summary: Apparmor bash Abstraction for Lmod
BuildRequires: apparmor-abstractions
BuildRequires: apparmor-rpm-macros
Requires: apparmor-abstractions
BuildArch: noarch

%description apparmor-abstractions%{PROJ_DELIM}
Profile for shell source scripts for lua-lmod
%endif

%prep
%setup -q -n Lmod-%{version}

Expand Down Expand Up @@ -172,6 +185,16 @@ EOF

%{__ln_s} %{OHPC_ADMIN}/lmod/lmod/libexec/lmod %{buildroot}/%{_bindir}/modulecmd

%if 0%{sle_version}
install -d -m755 %{buildroot}%{_sysconfdir}/apparmor.d/abstractions/bash.d
cat <<EOF > %{buildroot}%{_sysconfdir}/apparmor.d/abstractions/bash.d/lmod
abi <abi/3.0>,

%_datadir/lmod/%{version}/init/* r,
%_datadir/lmod/%{version}/libexec/addto ix,
EOF
%endif

%files
%dir %{OHPC_HOME}
%dir %{OHPC_ADMIN}
Expand All @@ -181,3 +204,9 @@ EOF
%{OHPC_PUB}
%doc License README.md README_lua_modulefiles.txt INSTALL
%{_bindir}/modulecmd

%if 0%{sle_version}
%files apparmor-abstractions%{PROJ_DELIM}
%dir %{_sysconfdir}/apparmor.d/abstractions/bash.d
%{_sysconfdir}/apparmor.d/abstractions/bash.d/lmod
%endif

0 comments on commit 3aebab6

Please sign in to comment.