Skip to content

Commit

Permalink
Add a port for clustershell
Browse files Browse the repository at this point in the history
Clustershell is a program that lets you run commands, and transfer files
to/from, many servers at the same time.  It's meant for HPC environments, but
works anywhere you have multiple machines (and can list them).

The code lives in Github, so we pull from there directly, rather than going
through pip or another repository.

ClusterShell is hard-coded to look in /etc/clustershell for system-wide
configuration, so we patch that to look in ${prefix}.
  • Loading branch information
akkornel committed Jan 9, 2024
1 parent 04c7039 commit 95722a2
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
52 changes: 52 additions & 0 deletions net/clustershell/Portfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup python 1.0
PortGroup github 1.0

github.setup cea-hpc clustershell 1.8.2 v

categories net python
platforms darwin
license LGPL-2+
maintainers kornel.us:karl openmaintainer

description Scalable cluster administration Python framework
long_description ClusterShell is an event-driven open source Python \
library, designed to run local or distant commands in \
parallel on server farms or on large Linux clusters. \
It will take care of common issues encountered on HPC \
clusters, such as operating on groups of nodes, \
running distributed commands using optimized execution \
algorithms, as well as gathering results and merging \
identical outputs, or retrieving return codes. \
ClusterShell takes advantage of existing remote shell \
facilities already installed on your systems, like SSH.
homepage http://cea-hpc.github.com/clustershell

checksums rmd160 71b101bc25fbd5ba798b439372aa6b4e72e1f898 \
sha256 8db2d159db941fc278c02302ce93c5a5c5bd4ad883ad75343164668623a4fc09 \
size 362843

# ClusterShell does not currently support Python 3.
python.versions 27 34 35 36 37
python.default_version 36

# setuptools is used for build/install; YAML is used for configuration.
depends_build-append port:py${python.version}-setuptools
depends_lib-append port:py${python.version}-yaml

# The code (in lib/ClusterShell/Defaults.py) has a hard-coded config file
# search path. We need to change this before the compile phase.
patchfiles patch-lib-ClusterShell-Defaults.py
post-patch {
reinplace "s|@MACPORTS_PREFIX@|${prefix}|g" ${worksrcpath}/lib/ClusterShell/Defaults.py
}

# The setup script creates some example config files, but does not respect
# $prefix when creating those files. I think that's because, when setup.py is
# run, it's given $destroot as the --root. We deal with this by moving the
# files ourselves, after setup.py runs.
post-destroot {
move [glob ${destroot}/etc/*] ${destroot}${prefix}/etc
}
11 changes: 11 additions & 0 deletions net/clustershell/files/patch-lib-ClusterShell-Defaults.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- lib/ClusterShell/Defaults.py 2016-11-21 12:50:40.000000000 -0800
+++ lib/ClusterShell/Defaults.py 2016-11-21 12:51:42.000000000 -0800
@@ -77,7 +77,7 @@

def config_paths(config_name):
"""Return default path list for a ClusterShell config file name."""
- return ['/etc/clustershell/%s' % config_name, # system-wide config file
+ return ['@MACPORTS_PREFIX@/etc/clustershell/%s' % config_name, # system-wide config file
# default pip --user config file
os.path.expanduser('~/.local/etc/clustershell/%s' % config_name),
# per-user config (top override)

0 comments on commit 95722a2

Please sign in to comment.