forked from hpc2n/spank-private-tmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
slurm-spank-private-tmpdir.spec
56 lines (48 loc) · 1.73 KB
/
slurm-spank-private-tmpdir.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%define _use_internal_dependency_generator 0
%define __find_requires %{_builddir}/find-requires
Summary: Slurm SPANK plugin for job private tmpdir
Name: slurm-spank-private-tmpdir
Version: 0.0.2
Release: 1b%{?_slurm}
License: GPL
Group: System Environment/Base
URL: https://github.com/juanlufont/spank-private-tmp
Source0: https://github.com/juanlufont/spank-private-tmp/archive/refs/tags/%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: slurm-devel
Requires: slurm
%description
Slurm SPANK plugin that uses file system namespaces to create private
temporary directories for each job.
%prep
%setup -n spank-private-tmp-%{version} -q
# Dummy file used to get a RPM dependency on libslurm.so
echo 'int main(){}' > %{_builddir}/libslurm_dummy.c
cat <<EOF > %{_builddir}/find-requires
#!/bin/sh
# Add dummy to list of files sent to the regular find-requires
{ echo %{_builddir}/libslurm_dummy; cat; } | \
/usr/lib/rpm/redhat/find-requires
EOF
chmod +x %{_builddir}/find-requires
%build
make all
gcc -lslurm -o %{_builddir}/libslurm_dummy %{_builddir}/libslurm_dummy.c
%install
install -d %{buildroot}%{_libdir}/slurm
install -d %{buildroot}%{_sysconfdir}/slurm/plugstack.conf.d
install -m 755 private-tmpdir.so %{buildroot}%{_libdir}/slurm/
install -m 644 plugstack.conf \
%{buildroot}%{_sysconfdir}/slurm/plugstack.conf.d/private-tmpdir.conf
%clean
rm -rf %{buildroot}
%files
%doc README LICENSE
%defattr(-,root,root,-)
%{_libdir}/slurm/private-tmpdir.so
%config %{_sysconfdir}/slurm/plugstack.conf.d/private-tmpdir.conf
%changelog
* Thu Feb 02 2017 Pär Lindfors <[email protected]> - 0.0.2-1
- Support multiple base parameters
* Mon Feb 16 2015 Pär Lindfors <[email protected]> - 0.0.1-1
- Initial RPM packaging