summaryrefslogtreecommitdiff
path: root/sys-cluster/slurm
diff options
context:
space:
mode:
Diffstat (limited to 'sys-cluster/slurm')
-rw-r--r--sys-cluster/slurm/Manifest16
-rw-r--r--sys-cluster/slurm/files/logrotate20
-rw-r--r--sys-cluster/slurm/files/slurm-16.05.2-disable-sview.patch69
-rw-r--r--sys-cluster/slurm/files/slurm-16.05.2-sysmacros.patch34
-rw-r--r--sys-cluster/slurm/files/slurm-17.02.6-disable-sview.patch99
-rw-r--r--sys-cluster/slurm/files/slurm-17.02.6-glibc-2.25.patch53
-rw-r--r--sys-cluster/slurm/files/slurm.confd6
-rw-r--r--sys-cluster/slurm/files/slurmctld.initd68
-rw-r--r--sys-cluster/slurm/files/slurmd.initd71
-rw-r--r--sys-cluster/slurm/files/slurmdbd.initd66
-rw-r--r--sys-cluster/slurm/metadata.xml16
-rw-r--r--sys-cluster/slurm/slurm-16.05.2.ebuild243
-rw-r--r--sys-cluster/slurm/slurm-17.02.6.ebuild236
13 files changed, 997 insertions, 0 deletions
diff --git a/sys-cluster/slurm/Manifest b/sys-cluster/slurm/Manifest
new file mode 100644
index 000000000000..c9c46b169ae7
--- /dev/null
+++ b/sys-cluster/slurm/Manifest
@@ -0,0 +1,16 @@
+AUX logrotate 360 SHA256 22a0e4bf21c9387f34245ec3cdd3a59512e377f6a0509451088b17e6c5201f89 SHA512 f6edceef15960accbe72ddd34ff34934fa46b6d647c83e0d3a512d2ddc1ae6c60352e377cfa5332fd5cd817689e23680f7384f1b27fc49677b2e671e1bfe86b9 WHIRLPOOL f210575af8ce123646e78c05980f1953b409e19e678221e4a17d97423fae6a9bd14a7ecc6cdb046102c3439d50718349063c01ef29f507500e3259f33b85e3e4
+AUX slurm-16.05.2-disable-sview.patch 2317 SHA256 adffddff2230af0bca6c0acea655852eec5613e93b168cac4faa673c3bea6bbd SHA512 d351f3293976e49971a70fdfaf18247babfff870f6d8be216ad5beee8b866157405fd30afee832b29484064535dfa64eec17c720e8c6b72042481d17ac95eaff WHIRLPOOL eade950c8c7b818a7924373d4dd43ae89ec4ee46813684ca9a3860ccb7d4e81f68ae44d883bda1986ed8b610d2820fdb354e211a13e7b91d5cfbec715e710d96
+AUX slurm-16.05.2-sysmacros.patch 983 SHA256 ecf8280d8ab2e7ac37b860fe8062c1696bd206a0dd60aa50b360ba8714718fe0 SHA512 f9c2ce668e1ec0c191b809ffe7d94d4a47623a0325b63dcc7a51cce6a95bf322e03f03c81f02f26162df20c320bf45d810bdc6f7ebbfecb1bf651a8dac88f04c WHIRLPOOL 8f6df5f9a378bf85325185d78980e458856223b3e658ad80571a4b9136746a3d2e239bee7c2d8c3daf35a12819d17e715038a580bb3f8f816d01be38d6bb1f87
+AUX slurm-17.02.6-disable-sview.patch 2831 SHA256 3cc774398903c6a167d16802449ebb7bf2d9459030a04bd5c8bf641066816782 SHA512 3ea30226b721b982ddad78d538c280da78b311d66b0be63087ef606d7f9008731c583e276504b668d8fde74c45ac8aa80babf4d693eca1d274d27dc72479d5e7 WHIRLPOOL e8db83bb3de2c9541307b761697f647d6ef241f502f5efdd4bdb170659fe57c985e584362de4a311371fe16a65b938f75f7b4ab7ad1772668621b961f5412b07
+AUX slurm-17.02.6-glibc-2.25.patch 1575 SHA256 06d6dde16eded793a1c18be2bf4f349aa402f34a93f2512835d87f7a8b1a4c47 SHA512 09bf1e74ce81d2715608d9eab1875fbdd5ac487f24e8e350dc6de765e46d18e7ffd35807d4d017cc1b4cdb0dfcb44e877663c5652252cdcd5b269505e155d7e0 WHIRLPOOL 409975fddc03782e463542e35ddb3e5ea48ad7b2cccaf02bc1ec30929ce8a5c168fe79a15e3ccdaadd06f32df134888126e909882a1944ad42147ef8c4c5765f
+AUX slurm.confd 155 SHA256 bc1b32f7b3c4a2fb5d97ae227ff15d40da16c346c0eed33a7956ed780a1a0d96 SHA512 e4d21cdb6a427f0beaef0e157202308f9e86a41dea4532ee98b274a5979b5e82ec2ca4ca2996f6cb59045fd8b01e815aaad71673e2011cead788de3d879aa11f WHIRLPOOL c836f20aae1fc4619757fe0db935f22736cc73077d51792427c8c629248af1e35d5f0f8c54342e41f45729ae6cdbb2b7dad2bf4db0f0689c46656a5cfc652564
+AUX slurmctld.initd 1833 SHA256 8adfe93adf1e8f7e5f2c442fa70cfcf4a0d55c84abbfd6bf64482ad31e2c15c6 SHA512 14246262aaf70642237f2ad13194d2bdc64f72b26e34113c2e7d340cf7661c62c79c4f939c61684c98fc5181680c08dbc55807dea0e382a3b2d1e26d0e57ce1c WHIRLPOOL 3816014acf2b45d79531fba9ed84d5592383de9e21f1222930b9512f085b08dcbdb33c8858374501a73541a3c40e3e7c832ebe8fd89aaa5a23ce799c4c585e9f
+AUX slurmd.initd 1993 SHA256 79c8a084b6125d18d88e254a8346020aa2662d99e046b1490f07758c094bd93e SHA512 f58b68c3fb5e9109b6fa261cbb816ef240f9d1465229ec418f3a2bba9a1bc47ca22bf1386d7014ea62a23d0807d73b263c4a4df86e8c354fcb760af3cc9d0250 WHIRLPOOL 93ce03deb62f54012ec6d59c1feb37543b670f5f2eba3fcb2c429aaae40e00cc859456eda90e36fd348742a57d7edbdad11887384a2dc2211a80720295caa78f
+AUX slurmdbd.initd 1709 SHA256 860a405f4b222221399e557bfcf2a169d4cb5759c6a115e6890ce8628e5e118f SHA512 323852ab3ae1cbec55c51e54f7f7acc2e60a694e46a91454638b7f167f5dc0c1ecdba8bdb82641aee9ad303558c445d7551e774a6b470da279173b5c44123911 WHIRLPOOL c93cd55891a499a9cfd72de41ca6cc7a38cd02d3795292546f753c3f367a199a828c1ae53c67bb6b9aa3785e246a7c7f909ff480c57d496ee2ef4e1691977345
+DIST slurm-16.05.2.tar.bz2 5982329 SHA256 de57ab107c98499f7184c54de8d5ac115a55657aa03d29d69cd0b7e737a42852 SHA512 8b4296481c5ad83da2bde1530937b3da9b6e32b6606ba0b0a3899e0f2f0b4fc42ca8a802d4bf346d0de28852d75839e9359e28c4ce77588cd22a08ddbd34dd21 WHIRLPOOL 925902c9432b24a2c85488d1ba6a867abed0adaaecaa94b648402e48d250d924000741b2be486b34d3b7f6890aeabb9aea6c47e2e8fd9896dda3a3ae416a4a89
+DIST slurm-17.02.6.tar.bz2 6017979 SHA256 f057127870544be5b3476594fc58b3c35727e6db3a18d84c4ea63059c2ebe4ea SHA512 e7e33ae037f8b30ccf467fa19c90786c28a527df80cf1362075634ada7072bffcd172d79d2af9ac9ad2b2206b50c0560584c7b8193bfaa9dfa1b1d2c7216e5f6 WHIRLPOOL 9dec9fae0d6def7fc0c243ceec8a2d3bf3c10ecf230f8ef5df03804ce048481279691572fb9bd83a509f344639d4b73313e7f7615bfa1d17c279010e44a2e63e
+EBUILD slurm-16.05.2.ebuild 7616 SHA256 3ddb80565765cd1011ad7fdeff6d5728a8b9b8a7eab7625266130d87572bec4b SHA512 d8b1af2cdb9d73c1bdc9dedc632ca3e3b9d267624cef96a2ed8c12a87c4029bfe0e463bdf804772cfa11cd50e52cdb0ea29dce404aa55f8cecc806c38e058fc0 WHIRLPOOL d94a0834f2344f7407b3fac0e4c95b405efdb0e5fb320287ef061a0d2409dc17fe1b9fc20a878abb6f439f231c25302c030f36b76f8d746b2747c9f3310a3123
+EBUILD slurm-17.02.6.ebuild 7074 SHA256 15964b60f52f2b047b29ee6ce1cbf65d36c18b1a2447f6b3cad63140d68b4fef SHA512 69a0fc69676909b2397d7e4c58d1b70d44fbf88306223a75336950731a22e2cf46a9777a296a5c02e6b5c2f090dedb6884036f06dfa4dcb98c69128f8c1ea4bc WHIRLPOOL c639cdc7f6202bb63d196baff05a1f732653da456f3905c7444bc0818f78461409211459ab8f5d7bcc9ec2637c83fe2bb1c59fe2b2a12b9bf70fd91a03151fcd
+MISC ChangeLog 3725 SHA256 7964056017afcbdaeea15b1ef42977054401b7cc8b464b74d59b80959b7bbedf SHA512 c1ec255817322d3b8d05391590ad9a0ea6039c29017224c33356338687a5207a9318dfeb9e5cf9fc8da991842d329a91fee0ded41a5a5c4443bdd0739c5e2a2e WHIRLPOOL 33aa9ebd54a980f8fac0541312415ede25d1b66f4a26ab3beaf5d2157fd711a2c877dbb59c98597331797603f0b0a00cb020ce627150f522794f3f1464be8835
+MISC ChangeLog-2015 5064 SHA256 1804adae45f9e76d1a30c0b82d1358989bc10051da47d81d152d3de70503b4fb SHA512 59ceea08c3ac6d518f969d459b5c9f1d3c740da5e44afdda859fb5ae5ef658dda6b444c827049e19e307ad4a832543bc6470b9ecea4c18bd13258b52578f491f WHIRLPOOL dc12bf2ac7f8a623954ff58ff2dbc12031eebc0caf1fc497d4c5826d5dddaecbaa95476cb583251fdb662ac9e1afb4a001cfe36191e0eab46d0878e81d2ed776
+MISC metadata.xml 563 SHA256 3227f64ff0a943f6ee51560a9d0f287cac5c69e898a371df441efba5a244ab0d SHA512 31d52fcdcd9526f8dc9ac00d173986943303b74ff6c554f6be30f2c059a0e1cc54330871ec132c451ab6f23ac062b3a9161293c13f3fffa13343f964d6cb959b WHIRLPOOL db656967776adccc8ce75f72a483f56a001270825096cff85674c2ada57b3c9dd5f4da059307395c31c1a4d53aa9343f24e2a52bb884d5c0deb96b7dcafd7ab5
diff --git a/sys-cluster/slurm/files/logrotate b/sys-cluster/slurm/files/logrotate
new file mode 100644
index 000000000000..978a869eb993
--- /dev/null
+++ b/sys-cluster/slurm/files/logrotate
@@ -0,0 +1,20 @@
+/var/log/slurm/*.log {
+ weekly
+ compress
+ missingok
+ nocopytruncate
+ nocreate
+ nodelaycompress
+ nomail
+ notifempty
+ noolddir
+ rotate 5
+ sharedscripts
+ size=5M
+ create 640 slurm slurm
+ postrotate
+ /etc/init.d/slurmd reload
+ /etc/init.d/slurmctld reload
+ /etc/init.d/slurmdbd reload
+ endscript
+}
diff --git a/sys-cluster/slurm/files/slurm-16.05.2-disable-sview.patch b/sys-cluster/slurm/files/slurm-16.05.2-disable-sview.patch
new file mode 100644
index 000000000000..1e4a5b4fae3a
--- /dev/null
+++ b/sys-cluster/slurm/files/slurm-16.05.2-disable-sview.patch
@@ -0,0 +1,69 @@
+diff -urN slurm-16.05.2.orig/configure.ac slurm-16.05.2/configure.ac
+--- slurm-16.05.2.orig/configure.ac 2016-07-07 02:51:37.000000000 +0300
++++ slurm-16.05.2/configure.ac 2016-07-15 20:02:41.373270765 +0300
+@@ -261,44 +261,6 @@
+ PKG_CHECK_MODULES([CHECK], [check >= 0.9.8], [ac_have_check="yes"], [ac_have_check="no"])
+ AM_CONDITIONAL(HAVE_CHECK, test "x$ac_have_check" = "xyes")
+
+-#
+-# Tests for GTK+
+-#
+-
+-# use the correct libs if running on 64bit
+-if test -d "/usr/lib64/pkgconfig"; then
+- PKG_CONFIG_PATH="/usr/lib64/pkgconfig/:$PKG_CONFIG_PATH"
+-fi
+-
+-if test -d "/opt/gnome/lib64/pkgconfig"; then
+- PKG_CONFIG_PATH="/opt/gnome/lib64/pkgconfig/:$PKG_CONFIG_PATH"
+-fi
+-
+-AM_PATH_GLIB_2_0([2.7.1], [ac_glib_test="yes"], [ac_glib_test="no"], [gthread])
+-
+-if test ${glib_config_minor_version=0} -ge 32 ; then
+- AC_DEFINE([GLIB_NEW_THREADS], 1, [Define to 1 if using glib-2.32.0 or higher])
+-fi
+-
+-AM_PATH_GTK_2_0([2.7.1], [ac_gtk_test="yes"], [ac_gtk_test="no"], [gthread])
+-if test ${gtk_config_minor_version=0} -ge 10 ; then
+- AC_DEFINE([GTK2_USE_RADIO_SET], 1, [Define to 1 if using gtk+-2.10.0 or higher])
+-fi
+-
+-if test ${gtk_config_minor_version=0} -ge 12 ; then
+- AC_DEFINE([GTK2_USE_TOOLTIP], 1, [Define to 1 if using gtk+-2.12.0 or higher])
+-fi
+-
+-if test ${gtk_config_minor_version=0} -ge 14 ; then
+- AC_DEFINE([GTK2_USE_GET_FOCUS], 1, [Define to 1 if using gtk+-2.14.0 or higher])
+-fi
+-
+-if test "x$ac_glib_test" != "xyes" -o "x$ac_gtk_test" != "xyes"; then
+- AC_MSG_WARN([cannot build sview without gtk library]);
+-fi
+-
+-AM_CONDITIONAL(BUILD_SVIEW, [test "x$ac_glib_test" = "xyes"] && [test "x$ac_gtk_test" = "xyes"])
+-
+ X_AC_DATABASES
+
+ dnl Cray ALPS/Basil support depends on mySQL
+@@ -503,7 +465,6 @@
+ src/sshare/Makefile
+ src/sstat/Makefile
+ src/strigger/Makefile
+- src/sview/Makefile
+ src/plugins/Makefile
+ src/plugins/accounting_storage/Makefile
+ src/plugins/accounting_storage/common/Makefile
+diff -urN slurm-16.05.2.orig/src/Makefile.am slurm-16.05.2/src/Makefile.am
+--- slurm-16.05.2.orig/src/Makefile.am 2016-07-07 02:51:37.000000000 +0300
++++ slurm-16.05.2/src/Makefile.am 2016-07-15 20:02:41.373270765 +0300
+@@ -27,8 +27,7 @@
+ srun_cr \
+ sshare \
+ sstat \
+- strigger \
+- sview
++ strigger
+
+ if !REAL_BG_L_P_LOADED
+ SUBDIRS += srun
diff --git a/sys-cluster/slurm/files/slurm-16.05.2-sysmacros.patch b/sys-cluster/slurm/files/slurm-16.05.2-sysmacros.patch
new file mode 100644
index 000000000000..f9d22f479f89
--- /dev/null
+++ b/sys-cluster/slurm/files/slurm-16.05.2-sysmacros.patch
@@ -0,0 +1,34 @@
+ configure.ac | 2 +-
+ src/plugins/task/cgroup/task_cgroup_devices.c | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 869a989..2936983 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -141,7 +141,7 @@ AC_CHECK_HEADERS(mcheck.h values.h socket.h sys/socket.h \
+ AC_HEADER_SYS_WAIT
+ AC_HEADER_TIME
+ AC_HEADER_STDC
+-
++AC_HEADER_MAJOR
+
+ dnl Checks for structures.
+ dnl
+diff --git a/src/plugins/task/cgroup/task_cgroup_devices.c b/src/plugins/task/cgroup/task_cgroup_devices.c
+index 554583c..9be99d8 100644
+--- a/src/plugins/task/cgroup/task_cgroup_devices.c
++++ b/src/plugins/task/cgroup/task_cgroup_devices.c
+@@ -42,6 +42,12 @@
+ #include <sched.h>
+ #include <glob.h>
+ #include <sys/types.h>
++#ifdef MAJOR_IN_MKDEV
++# include <sys/mkdev.h>
++#endif
++#ifdef MAJOR_IN_SYSMACROS
++# include <sys/sysmacros.h>
++#endif
+ #include <sys/stat.h>
+ #include <slurm/slurm.h>
+ #include <slurm/slurm_errno.h>
diff --git a/sys-cluster/slurm/files/slurm-17.02.6-disable-sview.patch b/sys-cluster/slurm/files/slurm-17.02.6-disable-sview.patch
new file mode 100644
index 000000000000..f7e2c5b26739
--- /dev/null
+++ b/sys-cluster/slurm/files/slurm-17.02.6-disable-sview.patch
@@ -0,0 +1,99 @@
+ configure.ac | 39 ---------------------------------------
+ doc/man/man1/Makefile.am | 8 --------
+ src/Makefile.am | 3 +--
+ 3 files changed, 1 insertion(+), 49 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2f177ec..ff4d69b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -238,44 +238,6 @@ AC_SUBST(HAVE_SOME_CURSES)
+ PKG_CHECK_MODULES([CHECK], [check >= 0.9.8], [ac_have_check="yes"], [ac_have_check="no"])
+ AM_CONDITIONAL(HAVE_CHECK, test "x$ac_have_check" = "xyes")
+
+-#
+-# Tests for GTK+
+-#
+-
+-# use the correct libs if running on 64bit
+-if test -d "/usr/lib64/pkgconfig"; then
+- PKG_CONFIG_PATH="/usr/lib64/pkgconfig/:$PKG_CONFIG_PATH"
+-fi
+-
+-if test -d "/opt/gnome/lib64/pkgconfig"; then
+- PKG_CONFIG_PATH="/opt/gnome/lib64/pkgconfig/:$PKG_CONFIG_PATH"
+-fi
+-
+-AM_PATH_GLIB_2_0([2.7.1], [ac_glib_test="yes"], [ac_glib_test="no"], [gthread])
+-
+-if test ${glib_config_minor_version=0} -ge 32 ; then
+- AC_DEFINE([GLIB_NEW_THREADS], 1, [Define to 1 if using glib-2.32.0 or higher])
+-fi
+-
+-AM_PATH_GTK_2_0([2.7.1], [ac_gtk_test="yes"], [ac_gtk_test="no"], [gthread])
+-if test ${gtk_config_minor_version=0} -ge 10 ; then
+- AC_DEFINE([GTK2_USE_RADIO_SET], 1, [Define to 1 if using gtk+-2.10.0 or higher])
+-fi
+-
+-if test ${gtk_config_minor_version=0} -ge 12 ; then
+- AC_DEFINE([GTK2_USE_TOOLTIP], 1, [Define to 1 if using gtk+-2.12.0 or higher])
+-fi
+-
+-if test ${gtk_config_minor_version=0} -ge 14 ; then
+- AC_DEFINE([GTK2_USE_GET_FOCUS], 1, [Define to 1 if using gtk+-2.14.0 or higher])
+-fi
+-
+-if test "x$ac_glib_test" != "xyes" -o "x$ac_gtk_test" != "xyes"; then
+- AC_MSG_WARN([cannot build sview without gtk library]);
+-fi
+-
+-AM_CONDITIONAL(BUILD_SVIEW, [test "x$ac_glib_test" = "xyes"] && [test "x$ac_gtk_test" = "xyes"])
+-
+ dnl Cray ALPS/Basil support depends on mySQL
+ X_AC_CRAY
+
+@@ -477,7 +439,6 @@ AC_CONFIG_FILES([Makefile
+ src/sshare/Makefile
+ src/sstat/Makefile
+ src/strigger/Makefile
+- src/sview/Makefile
+ src/plugins/Makefile
+ src/plugins/accounting_storage/Makefile
+ src/plugins/accounting_storage/common/Makefile
+diff --git a/doc/man/man1/Makefile.am b/doc/man/man1/Makefile.am
+index 246f16d..ba39af2 100644
+--- a/doc/man/man1/Makefile.am
++++ b/doc/man/man1/Makefile.am
+@@ -29,10 +29,6 @@ if WITH_BLCR
+ man1_MANS += srun_cr.1
+ endif
+
+-if BUILD_SVIEW
+-man1_MANS += sview.1
+-endif
+-
+ EXTRA_DIST = $(man1_MANS)
+
+ if HAVE_MAN2HTML
+@@ -65,10 +61,6 @@ if WITH_BLCR
+ html_DATA += srun_cr.html
+ endif
+
+-if BUILD_SVIEW
+-html_DATA += sview.html
+-endif
+-
+ MOSTLYCLEANFILES = ${html_DATA}
+
+ EXTRA_DIST += $(html_DATA)
+diff --git a/src/Makefile.am b/src/Makefile.am
+index bcd5aa7..a8cbf17 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -28,5 +28,4 @@ SUBDIRS = \
+ srun_cr \
+ sshare \
+ sstat \
+- strigger \
+- sview
++ strigger
diff --git a/sys-cluster/slurm/files/slurm-17.02.6-glibc-2.25.patch b/sys-cluster/slurm/files/slurm-17.02.6-glibc-2.25.patch
new file mode 100644
index 000000000000..dc48f8475c00
--- /dev/null
+++ b/sys-cluster/slurm/files/slurm-17.02.6-glibc-2.25.patch
@@ -0,0 +1,53 @@
+commit 056d9ff26b1d2ccac45da3c26a6918f182f8c559
+Author: Justin Lecher <jlec@gentoo.org>
+Date: Sun Jul 9 15:54:20 2017 +0100
+
+ Include sysmacros.h in addition for major() & minor()
+
+ Starting from glibc-2.25 [1] the macros major and minor are only available
+ from sys/sysmacros.h. This patch uses an autoconf macro to detect the
+ location and includes the header accordingly.
+
+ 1)
+ https://sourceware.org/ml/libc-alpha/2017-02/msg00079.html
+
+ Signed-off-by: Justin Lecher <jlec@gentoo.org>
+
+diff --git a/configure.ac b/configure.ac
+index 44699ae095..66d4350d44 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -124,7 +124,7 @@ AC_CHECK_HEADERS(mcheck.h values.h socket.h sys/socket.h \
+ AC_HEADER_SYS_WAIT
+ AC_HEADER_TIME
+ AC_HEADER_STDC
+-
++AC_HEADER_MAJOR
+
+ dnl Checks for structures.
+ dnl
+diff --git a/src/plugins/task/cgroup/task_cgroup_devices.c b/src/plugins/task/cgroup/task_cgroup_devices.c
+index 6a09b3d52a..63c0a11c9e 100644
+--- a/src/plugins/task/cgroup/task_cgroup_devices.c
++++ b/src/plugins/task/cgroup/task_cgroup_devices.c
+@@ -34,12 +34,20 @@
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ \*****************************************************************************/
+
++#include "config.h"
++
+ #define _GNU_SOURCE
+ #include <glob.h>
+ #include <limits.h>
+ #include <sched.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#ifdef MAJOR_IN_MKDEV
++# include <sys/mkdev.h>
++#endif
++#ifdef MAJOR_IN_SYSMACROS
++# include <sys/sysmacros.h>
++#endif
+
+ #include "slurm/slurm.h"
+ #include "slurm/slurm_errno.h"
diff --git a/sys-cluster/slurm/files/slurm.confd b/sys-cluster/slurm/files/slurm.confd
new file mode 100644
index 000000000000..c406dc3f2a2c
--- /dev/null
+++ b/sys-cluster/slurm/files/slurm.confd
@@ -0,0 +1,6 @@
+# /etc/conf.d/slurm: config file for /etc/init.d/slurm*
+SLURMCTLD_OPTIONS=""
+SLURMDBD_OPTIONS=""
+SLURMD_OPTIONS=""
+SLURM_USE_MUNGE="0"
+SLURM_USE_YPBIND="0" \ No newline at end of file
diff --git a/sys-cluster/slurm/files/slurmctld.initd b/sys-cluster/slurm/files/slurmctld.initd
new file mode 100644
index 000000000000..e87dfdb83ad3
--- /dev/null
+++ b/sys-cluster/slurm/files/slurmctld.initd
@@ -0,0 +1,68 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="reload"
+
+[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm
+
+depend() {
+ local _need
+ [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged"
+ [[ ${SLURM_USE_YPBIND} -ne 0 ]] && _need="${_need} ypbind"
+ after logger slurmdbd
+ need ${_need}
+}
+
+create_folder_and_set_permission() {
+ folder=${1}
+ # Fix permissions (/tmp is wiped at boot)
+ if [[ "${folder}" == "/tmp" ]]; then
+ eerror "SLURM: folder == ${folder} == /tmp"
+ exit
+ fi
+ if [[ "${folder}" == "/var/tmp" ]]; then
+ eerror "SLURM: folder == ${folder} == /var/tmp"
+ exit
+ fi
+ checkpath -d -o slurm:slurm ${folder}
+}
+
+checkconfig() {
+ if [ ! -e "/etc/slurm/slurm.conf" ]; then
+ eerror "Missing config /etc/slurm/slurm.conf"
+ eerror "Customize sample one or generate new by configurator.html"
+ eerror "in slurm doc directory"
+ return 1
+ fi
+
+ # Make sure folders exists
+ . /etc/slurm/slurm.conf
+ folders=(${SlurmdSpoolDir} `dirname ${SlurmctldLogFile}` `dirname ${SlurmctldPidFile}` `dirname ${SlurmdLogFile}` `dirname ${SlurmdPidFile}` ${SlurmdSpoolDir} ${StateSaveLocation})
+ for folder in ${folders[*]}; do
+ create_folder_and_set_permission ${folder}
+ done
+}
+
+start() {
+ ebegin "Starting slurm control daemon"
+ checkconfig
+ start-stop-daemon --start --quiet --background \
+ --pidfile /var/run/slurm/slurmctld.pid \
+ --user slurm \
+ --group slurm \
+ --exec /usr/sbin/slurmctld -- ${SLURMCTLD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping slurm control daemon"
+ start-stop-daemon --stop --pidfile /var/run/slurm/slurmctld.pid
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading slurm daemon configuration"
+ start-stop-daemon --signal HUP --pidfile /var/run/slurm/slurmctld.pid
+ eend $?
+}
diff --git a/sys-cluster/slurm/files/slurmd.initd b/sys-cluster/slurm/files/slurmd.initd
new file mode 100644
index 000000000000..a4a165be87d3
--- /dev/null
+++ b/sys-cluster/slurm/files/slurmd.initd
@@ -0,0 +1,71 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="reload"
+
+[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm
+
+depend() {
+ local _need
+ [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged"
+ [[ ${SLURM_USE_YPBIND} -ne 0 ]] && _need="${_need} ypbind"
+ after logger
+ need ${_need}
+}
+
+create_folder_and_set_permission() {
+ folder=${1}
+ # Fix permissions (/tmp is wiped at boot)
+ if [[ "${folder}" == "/tmp" ]]; then
+ eerror "SLURM: folder == ${folder} == /tmp"
+ exit
+ fi
+ if [[ "${folder}" == "/var/tmp" ]]; then
+ eerror "SLURM: folder == ${folder} == /var/tmp"
+ exit
+ fi
+ checkpath -d -o slurm:slurm ${folder}
+}
+
+checkconfig() {
+ if [ ! -e "/etc/slurm/slurm.conf" ]; then
+ eerror "Missing config /etc/slurm/slurm.conf"
+ eerror "Customize sample one or generate new by configurator.html"
+ eerror "in slurm doc directory"
+ return 1
+ fi
+ # Make sure folders exists
+ . /etc/slurm/slurm.conf
+ folders=(${SlurmdSpoolDir} `dirname ${SlurmctldLogFile}` `dirname ${SlurmctldPidFile}` `dirname ${SlurmdLogFile}` `dirname ${SlurmdPidFile}` ${SlurmdSpoolDir} ${StateSaveLocation})
+ for folder in ${folders[*]}; do
+ create_folder_and_set_permission ${folder}
+ done
+}
+
+start() {
+ ebegin "Starting slurm daemon"
+ checkconfig
+ # Slurm does not propagate limits, which can brakes InfiniBand
+ # See http://www.open-mpi.org/faq/?category=openfabrics
+ # and https://computing.llnl.gov/linux/slurm/faq.html#rlimit
+ ulimit -l unlimited
+ start-stop-daemon --start --quiet --background \
+ --pidfile /var/run/slurm/slurmd.pid \
+ --user root \
+ --group root \
+ --exec /usr/sbin/slurmd -- ${SLURMD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping slurm daemon"
+ start-stop-daemon --stop --pidfile /var/run/slurm/slurmd.pid
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading slurm daemon configuration"
+ start-stop-daemon --signal HUP --pidfile /var/run/slurm/slurmd.pid
+ eend $?
+}
diff --git a/sys-cluster/slurm/files/slurmdbd.initd b/sys-cluster/slurm/files/slurmdbd.initd
new file mode 100644
index 000000000000..296afaf9421c
--- /dev/null
+++ b/sys-cluster/slurm/files/slurmdbd.initd
@@ -0,0 +1,66 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="reload"
+
+[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm
+
+depend() {
+ local _need
+ [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged"
+ [[ ${SLURM_USE_YPBIND} -ne 0 ]] && _need="${_need} ypbind"
+ after logger
+ need ${_need}
+}
+
+create_folder_and_set_permission() {
+ folder=${1}
+ # Fix permissions (/tmp is wiped at boot)
+ if [[ "${folder}" == "/tmp" ]]; then
+ eerror "SLURM: folder == ${folder} == /tmp"
+ exit
+ fi
+ if [[ "${folder}" == "/var/tmp" ]]; then
+ eerror "SLURM: folder == ${folder} == /var/tmp"
+ exit
+ fi
+ checkpath -d -o slurm:slurm ${folder}
+}
+
+checkconfig() {
+ if [ ! -e "/etc/slurm/slurmdbd.conf" ]; then
+ eerror "Missing config /etc/slurm/slurmdbd.conf"
+ return 1
+ fi
+
+ # Make sure folders exists
+ . /etc/slurm/slurm.conf
+ folders=(${SlurmdSpoolDir} `dirname ${SlurmctldLogFile}` `dirname ${SlurmctldPidFile}` `dirname ${SlurmdLogFile}` `dirname ${SlurmdPidFile}` ${SlurmdSpoolDir} ${StateSaveLocation})
+ for folder in ${folders[*]}; do
+ create_folder_and_set_permission ${folder}
+ done
+}
+
+start() {
+ ebegin "Starting slurmdb daemon"
+ checkconfig
+ start-stop-daemon --start --quiet --background \
+ --pidfile /var/run/slurm/slurmdbd.pid \
+ --user slurm \
+ --group slurm \
+ --exec /usr/sbin/slurmdbd -- ${SLURMD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping slurmdb daemon"
+ start-stop-daemon --stop --pidfile /var/run/slurm/slurmdbd.pid
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading slurmdb daemon configuration"
+ start-stop-daemon --signal HUP --pidfile /var/run/slurm/slurmdbd.pid
+ eend $?
+}
diff --git a/sys-cluster/slurm/metadata.xml b/sys-cluster/slurm/metadata.xml
new file mode 100644
index 000000000000..3ea81217548b
--- /dev/null
+++ b/sys-cluster/slurm/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>alexxy@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>cluster@gentoo.org</email>
+ <name>Gentoo Cluster Project</name>
+ </maintainer>
+ <use>
+ <flag name="munge">Enable authentication via munge</flag>
+ <flag name="multiple-slurmd">Allow multiple slurmd to run</flag>
+ <flag name="torque">Enable perl scripts that emulates pbs (qstat, qsub etc.)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-cluster/slurm/slurm-16.05.2.ebuild b/sys-cluster/slurm/slurm-16.05.2.ebuild
new file mode 100644
index 000000000000..956fa3e12514
--- /dev/null
+++ b/sys-cluster/slurm/slurm-16.05.2.ebuild
@@ -0,0 +1,243 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} == *9999* ]]; then
+ EGIT_REPO_URI="https://github.com/SchedMD/slurm.git"
+ INHERIT_GIT="git-r3"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ inherit versionator
+ if [[ ${PV} == *pre* || ${PV} == *rc* ]]; then
+ MY_PV=$(replace_version_separator 3 '-0.') # pre-releases or release-candidate
+ else
+ MY_PV=$(replace_version_separator 3 '-') # stable releases
+ fi
+ MY_P="${PN}-${MY_PV}"
+ INHERIT_GIT=""
+ SRC_URI="https://www.schedmd.com/download/latest/${MY_P}.tar.bz2"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+inherit autotools eutils pam perl-module user prefix ${INHERIT_GIT}
+
+DESCRIPTION="SLURM: A Highly Scalable Resource Manager"
+HOMEPAGE="https://www.schedmd.com"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="lua multiple-slurmd +munge mysql pam perl ssl static-libs torque"
+
+DEPEND="
+ !sys-cluster/torque
+ !net-analyzer/slurm
+ !net-analyzer/sinfo
+ mysql? ( virtual/mysql )
+ munge? ( sys-auth/munge )
+ pam? ( virtual/pam )
+ ssl? ( dev-libs/openssl:0= )
+ lua? ( dev-lang/lua:0= )
+ !lua? ( !dev-lang/lua )
+ >=sys-apps/hwloc-1.1.1-r1"
+RDEPEND="${DEPEND}
+ dev-libs/libcgroup"
+
+REQUIRED_USE="torque? ( perl )"
+
+LIBSLURM_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurm/perl"
+LIBSLURMDB_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurmdb/perl"
+
+RESTRICT="primaryuri"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-disable-sview.patch
+ "${FILESDIR}"/${P}-sysmacros.patch
+)
+
+src_unpack() {
+ if [[ ${PV} == *9999* ]]; then
+ git-2_src_unpack
+ else
+ default
+ fi
+}
+
+pkg_setup() {
+ enewgroup slurm 500
+ enewuser slurm 500 -1 /var/spool/slurm slurm
+}
+
+src_prepare() {
+ if [ ${#PATCHES[0]} -ne 0 ]; then
+ epatch "${PATCHES[@]}"
+ fi
+ eapply_user
+ # pids should go to /var/run/slurm
+ sed -e "s:/var/run/slurmctld.pid:${EPREFIX}/var/run/slurm/slurmctld.pid:g" \
+ -e "s:/var/run/slurmd.pid:${EPREFIX}/var/run/slurm/slurmd.pid:g" \
+ -i "${S}/etc/slurm.conf.example" \
+ || die "Can't sed for /var/run/slurmctld.pid"
+ # also state dirs are in /var/spool/slurm
+ sed -e "s:StateSaveLocation=*.:StateSaveLocation=${EPREFIX}/var/spool/slurm:g" \
+ -e "s:SlurmdSpoolDir=*.:SlurmdSpoolDir=${EPREFIX}/var/spool/slurm/slurmd:g" \
+ -i "${S}/etc/slurm.conf.example" \
+ || die "Can't sed ${S}/etc/slurm.conf.example for StateSaveLocation=*. or SlurmdSpoolDir=*"
+ # and tmp should go to /var/tmp/slurm
+ sed -e 's:/tmp:/var/tmp:g' \
+ -i "${S}/etc/slurm.conf.example" \
+ || die "Can't sed for StateSaveLocation=*./tmp"
+
+ hprefixify auxdir/{ax_check_zlib,x_ac_{lz4,ofed,munge}}.m4
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=(
+ --sysconfdir="${EPREFIX}/etc/${PN}"
+ --with-hwloc="${EPREFIX}/usr"
+ --docdir="${EPREFIX}/usr/share/doc/${P}"
+ --htmldir="${EPREFIX}/usr/share/doc/${P}"
+ )
+ use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) )
+ use mysql || myconf+=( --without-mysql_config )
+ econf "${myconf[@]}" \
+ $(use_enable pam) \
+ $(use_with ssl) \
+ $(use_with munge) \
+ $(use_enable static-libs static) \
+ $(use_enable multiple-slurmd)
+
+ # --htmldir does not seems to propagate... Documentations are installed
+ # in /usr/share/doc/slurm-2.3.0/html
+ # instead of /usr/share/doc/slurm-2.3.0.2/html
+ sed -e "s|htmldir = .*/html|htmldir = \${prefix}/share/doc/slurm-${PVR}/html|g" -i doc/html/Makefile || die
+ if use perl ; then
+ # small hack to make it compile
+ mkdir -p "${S}/src/api/.libs"
+ mkdir -p "${S}/src/db_api/.libs"
+ touch "${S}/src/api/.libs/libslurm.so"
+ touch "${S}/src/db_api/.libs/libslurmdb.so"
+ cd "${LIBSLURM_PERL_S}"
+ S="${LIBSLURM_PERL_S}" SRC_PREP="no" perl-module_src_configure
+ cd "${LIBSLURMDB_PERL_S}"
+ S="${LIBSLURMDB_PERL_S}" SRC_PREP="no" perl-module_src_configure
+ cd "${S}"
+ rm -rf "${S}/src/api/.libs" "${S}/src/db_api/.libs"
+ fi
+}
+
+src_compile() {
+ default
+ use pam && emake -C contribs/pam
+ if use perl ; then
+ cd "${LIBSLURM_PERL_S}"
+ S="${LIBSLURM_PERL_S}" perl-module_src_compile
+ cd "${LIBSLURMDB_PERL_S}"
+ S="${LIBSLURMDB_PERL_S}" perl-module_src_compile
+ cd "${S}"
+ fi
+ if use torque ; then
+ emake -C contribs/torque
+ fi
+}
+
+src_install() {
+ default
+ use pam && emake DESTDIR="${D}" -C contribs/pam install
+ if use perl; then
+ cd "${LIBSLURM_PERL_S}"
+ S="${LIBSLURM_PERL_S}" perl-module_src_install
+ cd "${LIBSLURMDB_PERL_S}"
+ S="${LIBSLURMDB_PERL_S}" perl-module_src_install
+ cd "${S}"
+ fi
+ if use torque; then
+ emake DESTDIR="${D}" -C contribs/torque
+ rm -f "${ED}/usr/bin/mpiexec" || die
+ fi
+ use static-libs || find "${ED}" -name '*.la' -exec rm {} +
+ # install sample configs
+ keepdir /etc/slurm
+ insinto /etc/slurm
+ doins etc/bluegene.conf.example
+ doins etc/cgroup.conf.example
+ doins etc/cgroup_allowed_devices_file.conf.example
+ doins etc/slurm.conf.example
+ doins etc/slurmdbd.conf.example
+ exeinto /etc/slurm
+ doexe etc/cgroup.release_common.example
+ doexe etc/slurm.epilog.clean
+ # install init.d files
+ newinitd "$(prefixify_ro "${FILESDIR}/slurmd.initd")" slurmd
+ newinitd "$(prefixify_ro "${FILESDIR}/slurmctld.initd")" slurmctld
+ newinitd "$(prefixify_ro "${FILESDIR}/slurmdbd.initd")" slurmdbd
+ # install conf.d files
+ newconfd "${FILESDIR}/slurm.confd" slurm
+ # Install logrotate file
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate" slurm
+ # cgroups support
+ exeinto /etc/slurm/cgroup
+ doexe etc/cgroup.release_common.example
+ mv "${ED}"/etc/slurm/cgroup/{cgroup.release_common.example,release_common} || die "Can't move cgroup.release_common.example"
+ ln -s release_common "${ED}"/etc/slurm/cgroup/release_cpuset || die "Can't create symbolic link release_cpuset"
+ ln -s release_common "${ED}"/etc/slurm/cgroup/release_devices || die "Can't create symbolic link release_devices"
+ ln -s release_common "${ED}"/etc/slurm/cgroup/release_freezer || die "Can't create symbolic link release_freezer"
+}
+
+pkg_preinst() {
+ if use munge; then
+ sed -i 's,\(SLURM_USE_MUNGE=\).*,\11,' "${ED}"etc/conf.d/slurm || die
+ fi
+}
+
+create_folders_and_fix_permissions() {
+ einfo "Fixing permissions in ${@}"
+ mkdir -p ${@}
+ chown -R ${PN}:${PN} ${@}
+}
+
+pkg_postinst() {
+ paths=(
+ "${EROOT}"var/${PN}/checkpoint
+ "${EROOT}"var/${PN}
+ "${EROOT}"var/spool/${PN}/slurmd
+ "${EROOT}"var/spool/${PN}
+ "${EROOT}"var/run/${PN}
+ "${EROOT}"var/log/${PN}
+ /var/tmp/${PN}/${PN}d
+ /var/tmp/${PN}
+ )
+ for folder_path in ${paths[@]}; do
+ create_folders_and_fix_permissions $folder_path
+ done
+ einfo
+
+ elog "Please visit the file '/usr/share/doc/${P}/html/configurator.html"
+ elog "through a (javascript enabled) browser to create a configureation file."
+ elog "Copy that file to /etc/slurm/slurm.conf on all nodes (including the headnode) of your cluster."
+ einfo
+ elog "For cgroup support, please see https://www.schedmd.com/slurmdocs/cgroup.conf.html"
+ elog "Your kernel must be compiled with the wanted cgroup feature:"
+ elog " General setup --->"
+ elog " [*] Control Group support --->"
+ elog " [*] Freezer cgroup subsystem"
+ elog " [*] Device controller for cgroups"
+ elog " [*] Cpuset support"
+ elog " [*] Simple CPU accounting cgroup subsystem"
+ elog " [*] Resource counters"
+ elog " [*] Memory Resource Controller for Control Groups"
+ elog " [*] Group CPU scheduler --->"
+ elog " [*] Group scheduling for SCHED_OTHER"
+ elog "Then, set these options in /etc/slurm/slurm.conf:"
+ elog " ProctrackType=proctrack/cgroup"
+ elog " TaskPlugin=task/cgroup"
+ einfo
+ ewarn "Paths were created for slurm. Please use these paths in /etc/slurm/slurm.conf:"
+ for folder_path in ${paths[@]}; do
+ ewarn " ${folder_path}"
+ done
+}
diff --git a/sys-cluster/slurm/slurm-17.02.6.ebuild b/sys-cluster/slurm/slurm-17.02.6.ebuild
new file mode 100644
index 000000000000..72d5cafc9948
--- /dev/null
+++ b/sys-cluster/slurm/slurm-17.02.6.ebuild
@@ -0,0 +1,236 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} == *9999* ]]; then
+ EGIT_REPO_URI="https://github.com/SchedMD/slurm.git"
+ INHERIT_GIT="git-r3"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ inherit versionator
+ if [[ ${PV} == *pre* || ${PV} == *rc* ]]; then
+ MY_PV=$(replace_version_separator 3 '-0.') # pre-releases or release-candidate
+ else
+ MY_PV=$(replace_version_separator 3 '-') # stable releases
+ fi
+ MY_P="${PN}-${MY_PV}"
+ INHERIT_GIT=""
+ SRC_URI="https://www.schedmd.com/download/latest/${MY_P}.tar.bz2"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+inherit autotools eutils pam perl-module user prefix ${INHERIT_GIT}
+
+DESCRIPTION="A Highly Scalable Resource Manager"
+HOMEPAGE="https://www.schedmd.com"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug lua multiple-slurmd +munge mysql pam perl ssl static-libs torque"
+
+DEPEND="
+ !sys-cluster/torque
+ !net-analyzer/slurm
+ !net-analyzer/sinfo
+ mysql? ( virtual/mysql )
+ munge? ( sys-auth/munge )
+ pam? ( virtual/pam )
+ ssl? ( dev-libs/openssl:0= )
+ lua? ( dev-lang/lua:0= )
+ !lua? ( !dev-lang/lua )
+ >=sys-apps/hwloc-1.1.1-r1"
+RDEPEND="${DEPEND}
+ dev-libs/libcgroup"
+
+REQUIRED_USE="torque? ( perl )"
+
+LIBSLURM_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurm/perl"
+LIBSLURMDB_PERL_S="${WORKDIR}/${P}/contribs/perlapi/libslurmdb/perl"
+
+RESTRICT="primaryuri"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-disable-sview.patch
+ "${FILESDIR}"/${P}-glibc-2.25.patch
+)
+
+src_unpack() {
+ if [[ ${PV} == *9999* ]]; then
+ git-2_src_unpack
+ else
+ default
+ fi
+}
+
+pkg_setup() {
+ enewgroup slurm 500
+ enewuser slurm 500 -1 /var/spool/slurm slurm
+}
+
+src_prepare() {
+ default
+
+ # pids should go to /var/run/slurm
+ sed -e "s:/var/run/slurmctld.pid:${EPREFIX}/var/run/slurm/slurmctld.pid:g" \
+ -e "s:/var/run/slurmd.pid:${EPREFIX}/var/run/slurm/slurmd.pid:g" \
+ -i "${S}/etc/slurm.conf.example" \
+ || die "Can't sed for /var/run/slurmctld.pid"
+ # also state dirs are in /var/spool/slurm
+ sed -e "s:StateSaveLocation=*.:StateSaveLocation=${EPREFIX}/var/spool/slurm:g" \
+ -e "s:SlurmdSpoolDir=*.:SlurmdSpoolDir=${EPREFIX}/var/spool/slurm/slurmd:g" \
+ -i "${S}/etc/slurm.conf.example" \
+ || die "Can't sed ${S}/etc/slurm.conf.example for StateSaveLocation=*. or SlurmdSpoolDir=*"
+ # and tmp should go to /var/tmp/slurm
+ sed -e 's:/tmp:/var/tmp:g' \
+ -i "${S}/etc/slurm.conf.example" \
+ || die "Can't sed for StateSaveLocation=*./tmp"
+
+ hprefixify auxdir/{ax_check_zlib,x_ac_{lz4,ofed,munge}}.m4
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=(
+ --sysconfdir="${EPREFIX}/etc/${PN}"
+ --with-hwloc="${EPREFIX}/usr"
+ --docdir="${EPREFIX}/usr/share/doc/${P}"
+ --htmldir="${EPREFIX}/usr/share/doc/${P}"
+ )
+ use debug || myconf+=( --disable-debug )
+ use pam && myconf+=( --with-pam_dir=$(getpam_mod_dir) )
+ use mysql || myconf+=( --without-mysql_config )
+ econf "${myconf[@]}" \
+ $(use_enable pam) \
+ $(use_with ssl) \
+ $(use_with munge) \
+ $(use_enable static-libs static) \
+ $(use_enable multiple-slurmd)
+
+ # --htmldir does not seems to propagate... Documentations are installed
+ # in /usr/share/doc/slurm-2.3.0/html
+ # instead of /usr/share/doc/slurm-2.3.0.2/html
+ sed \
+ -e "s|htmldir = .*/html|htmldir = \${prefix}/share/doc/slurm-${PVR}/html|g" \
+ -i doc/html/Makefile || die
+ if use perl ; then
+ # small hack to make it compile
+ mkdir -p "${S}/src/api/.libs" || die
+ mkdir -p "${S}/src/db_api/.libs" || die
+ touch "${S}/src/api/.libs/libslurm.so" || die
+ touch "${S}/src/db_api/.libs/libslurmdb.so" || die
+ cd "${LIBSLURM_PERL_S}" || die
+ S="${LIBSLURM_PERL_S}" SRC_PREP="no" perl-module_src_configure
+ cd "${LIBSLURMDB_PERL_S}" || die
+ S="${LIBSLURMDB_PERL_S}" SRC_PREP="no" perl-module_src_configure
+ cd "${S}" || die
+ rm -rf "${S}/src/api/.libs" "${S}/src/db_api/.libs" || die
+ fi
+}
+
+src_compile() {
+ default
+ use pam && emake -C contribs/pam
+ if use perl ; then
+ cd "${LIBSLURM_PERL_S}" || die
+ S="${LIBSLURM_PERL_S}" perl-module_src_compile
+ cd "${LIBSLURMDB_PERL_S}" || die
+ S="${LIBSLURMDB_PERL_S}" perl-module_src_compile
+ cd "${S}" || die
+ fi
+ use torque && emake -C contribs/torque
+}
+
+src_install() {
+ default
+ use pam && emake DESTDIR="${D}" -C contribs/pam install
+ if use perl; then
+ cd "${LIBSLURM_PERL_S}" || die
+ S="${LIBSLURM_PERL_S}" perl-module_src_install
+ cd "${LIBSLURMDB_PERL_S}" || die
+ S="${LIBSLURMDB_PERL_S}" perl-module_src_install
+ cd "${S}" || die
+ fi
+ if use torque; then
+ emake DESTDIR="${D}" -C contribs/torque
+ rm -f "${ED}/usr/bin/mpiexec" || die
+ fi
+ use static-libs || find "${ED}" -name '*.la' -exec rm {} +
+ # install sample configs
+ keepdir /etc/slurm
+ insinto /etc/slurm
+ doins \
+ etc/bluegene.conf.example \
+ etc/cgroup.conf.example \
+ etc/cgroup_allowed_devices_file.conf.example \
+ etc/slurm.conf.example \
+ etc/slurmdbd.conf.example
+ exeinto /etc/slurm
+ doexe \
+ etc/slurm.epilog.clean
+ # install init.d files
+ newinitd "$(prefixify_ro ${FILESDIR}/slurmd.initd)" slurmd
+ newinitd "$(prefixify_ro ${FILESDIR}/slurmctld.initd)" slurmctld
+ newinitd "$(prefixify_ro ${FILESDIR}/slurmdbd.initd)" slurmdbd
+ # install conf.d files
+ newconfd "${FILESDIR}/slurm.confd" slurm
+ # Install logrotate file
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate" slurm
+}
+
+pkg_preinst() {
+ if use munge; then
+ sed -i 's,\(SLURM_USE_MUNGE=\).*,\11,' "${ED}"etc/conf.d/slurm || die
+ fi
+}
+
+create_folders_and_fix_permissions() {
+ einfo "Fixing permissions in ${@}"
+ mkdir -p ${@}
+ chown -R ${PN}:${PN} ${@}
+}
+
+pkg_postinst() {
+ paths=(
+ "${EROOT}"var/${PN}/checkpoint
+ "${EROOT}"var/${PN}
+ "${EROOT}"var/spool/${PN}/slurmd
+ "${EROOT}"var/spool/${PN}
+ "${EROOT}"var/run/${PN}
+ "${EROOT}"var/log/${PN}
+ /var/tmp/${PN}/${PN}d
+ /var/tmp/${PN}
+ )
+ for folder_path in ${paths[@]}; do
+ create_folders_and_fix_permissions $folder_path
+ done
+ echo
+
+ elog "Please visit the file '/usr/share/doc/${P}/html/configurator.html"
+ elog "through a (javascript enabled) browser to create a configureation file."
+ elog "Copy that file to /etc/slurm/slurm.conf on all nodes (including the headnode) of your cluster."
+ echo
+ elog "For cgroup support, please see https://www.schedmd.com/slurmdocs/cgroup.conf.html"
+ elog "Your kernel must be compiled with the wanted cgroup feature:"
+ elog " General setup --->"
+ elog " [*] Control Group support --->"
+ elog " [*] Freezer cgroup subsystem"
+ elog " [*] Device controller for cgroups"
+ elog " [*] Cpuset support"
+ elog " [*] Simple CPU accounting cgroup subsystem"
+ elog " [*] Resource counters"
+ elog " [*] Memory Resource Controller for Control Groups"
+ elog " [*] Group CPU scheduler --->"
+ elog " [*] Group scheduling for SCHED_OTHER"
+ elog "Then, set these options in /etc/slurm/slurm.conf:"
+ elog " ProctrackType=proctrack/cgroup"
+ elog " TaskPlugin=task/cgroup"
+ einfo
+ ewarn "Paths were created for slurm. Please use these paths in /etc/slurm/slurm.conf:"
+ for folder_path in ${paths[@]}; do
+ ewarn " ${folder_path}"
+ done
+}