diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2018-05-19 16:35:48 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2018-05-19 16:35:48 +0000 |
commit | 6e56b5136d0e9d435b0b878fe6ebd94b99810cb3 (patch) | |
tree | bfa35e1f7c150e3acf5272bcb65f35a18c529ffa /net-mgmt/crmsh | |
parent | 52d7b0d3f1416d9e90e9b34ffd5d20345fd3a2ff (diff) | |
download | ports-6e56b5136d0e9d435b0b878fe6ebd94b99810cb3.tar.gz ports-6e56b5136d0e9d435b0b878fe6ebd94b99810cb3.zip |
Notes
Diffstat (limited to 'net-mgmt/crmsh')
-rw-r--r-- | net-mgmt/crmsh/Makefile | 82 | ||||
-rw-r--r-- | net-mgmt/crmsh/distinfo | 6 | ||||
-rw-r--r-- | net-mgmt/crmsh/files/patch-crmsh_corosync.py | 11 | ||||
-rw-r--r-- | net-mgmt/crmsh/files/patch-crmsh_utils.py | 29 | ||||
-rw-r--r-- | net-mgmt/crmsh/files/patch-hb__report_hb__report.in | 52 | ||||
-rw-r--r-- | net-mgmt/crmsh/files/patch-hb__report_openais__conf__support.sh | 13 | ||||
-rw-r--r-- | net-mgmt/crmsh/files/patch-hb__report_utillib.sh | 20 | ||||
-rw-r--r-- | net-mgmt/crmsh/files/patch-scripts_health_collect.py | 11 | ||||
-rw-r--r-- | net-mgmt/crmsh/files/patch-utils_crm__init.py | 20 | ||||
-rw-r--r-- | net-mgmt/crmsh/pkg-plist | 10 |
10 files changed, 210 insertions, 44 deletions
diff --git a/net-mgmt/crmsh/Makefile b/net-mgmt/crmsh/Makefile index 1da94eb9e7a0..d228d719ce3b 100644 --- a/net-mgmt/crmsh/Makefile +++ b/net-mgmt/crmsh/Makefile @@ -1,52 +1,62 @@ -# Created by: dpejesh@yahoo.com +# Created by: David Shane Holden <dpejesh@yahoo.com> # $FreeBSD$ -PORTNAME= crmsh -PORTVERSION= 3.0.0 -PORTREVISION= 1 -CATEGORIES= net-mgmt python +PORTNAME= crmsh +PORTVERSION= 3.0.1 +CATEGORIES= net-mgmt python -MAINTAINER= dpejesh@yahoo.com -COMMENT= Command-line interface for High-Availability cluster management +MAINTAINER= dpejesh@yahoo.com +COMMENT= Command-line interface for High-Availability cluster management -LICENSE= GPLv2 -LICENSE_FILE= ${WRKSRC}/COPYING +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING # Set the build/run depends on setuptools instead of adding distutils to USE_PYTHON # because the crmsh build uses autotools which then calls setup.py. -BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${FLAVOR} -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}lxml>0:devel/py-lxml@${FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${FLAVOR} - -USE_GITHUB= yes -GH_ACCOUNT= ClusterLabs - -USES= autoreconf gmake python:2.7 shebangfix -USE_PYTHON= flavors -GNU_CONFIGURE= yes -CONFIGURE_ARGS= --with-ocf-root=${PREFIX}/lib/ocf -NO_ARCH= yes - -SHEBANG_FILES= bin/crm \ - scripts/*/*.py \ - test/cib-tests.sh \ - test/evaltest.sh \ - test/list-undocumented-commands.py \ - utils/crm_clean.py \ - utils/crm_pkg.py \ - utils/crm_rpmcheck.py - -OPTIONS_DEFINE= DOCS MANPAGES -OPTIONS_DEFAULT=MANPAGES -OPTIONS_SUB= yes +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}dateutil>0:devel/py-dateutil@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}lxml>0:devel/py-lxml@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}parallax>0:devel/py-parallax@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR} + +USES= autoreconf gmake python:2.7 shebangfix +USE_GITHUB= yes +GH_ACCOUNT= ClusterLabs +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --with-ocf-root=${PREFIX}/lib/ocf +USE_GITHUB= yes +GH_ACCOUNT= ClusterLabs + +NO_ARCH= yes + +SHEBANG_FILES= bin/crm \ + scripts/*/*.py \ + test/cib-tests.sh \ + test/evaltest.sh \ + test/list-undocumented-commands.py \ + utils/crm_clean.py \ + utils/crm_pkg.py \ + utils/crm_rpmcheck.py + +OPTIONS_DEFINE= DOCS MANPAGES +OPTIONS_DEFAULT= MANPAGES +OPTIONS_SUB= yes DOCS_BUILD_DEPENDS= asciidoc:textproc/asciidoc MANPAGES_BUILD_DEPENDS= ${DOCS_BUILD_DEPENDS} post-patch: - ${REINPLACE_CMD} 's,%%DATADIR%%,${DATADIR},' ${WRKSRC}/setup.py + @${REINPLACE_CMD} 's,%%DATADIR%%,${DATADIR},g' ${WRKSRC}/setup.py + @${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/crmsh/corosync.py + @${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/crmsh/utils.py + @${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/hb_report/hb_report.in + @${REINPLACE_CMD} 's,%%PYTHON_CMD%%,${PYTHON_CMD},g' ${WRKSRC}/hb_report/hb_report.in + @${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/hb_report/openais_conf_support.sh + @${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/hb_report/utillib.sh + @${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/scripts/health/collect.py + @${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/utils/crm_init.py post-install: ${MV} ${STAGEDIR}${PREFIX}/etc/crm/crm.conf \ diff --git a/net-mgmt/crmsh/distinfo b/net-mgmt/crmsh/distinfo index 56dd026984bb..9c624347cca1 100644 --- a/net-mgmt/crmsh/distinfo +++ b/net-mgmt/crmsh/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1495219830 -SHA256 (ClusterLabs-crmsh-3.0.0_GH0.tar.gz) = eb3d99999b7f1e31fef28de90fa5b038f316a02a35c47a1286d374eb7a569168 -SIZE (ClusterLabs-crmsh-3.0.0_GH0.tar.gz) = 943585 +TIMESTAMP = 1523916691 +SHA256 (ClusterLabs-crmsh-3.0.1_GH0.tar.gz) = de10df384d3a5b5700cce96b9e907c2e5c17bffc376bc65503f50219d9812b15 +SIZE (ClusterLabs-crmsh-3.0.1_GH0.tar.gz) = 947261 diff --git a/net-mgmt/crmsh/files/patch-crmsh_corosync.py b/net-mgmt/crmsh/files/patch-crmsh_corosync.py new file mode 100644 index 000000000000..28b5d0a0e737 --- /dev/null +++ b/net-mgmt/crmsh/files/patch-crmsh_corosync.py @@ -0,0 +1,11 @@ +--- crmsh/corosync.py.orig 2018-04-19 03:47:12 UTC ++++ crmsh/corosync.py +@@ -14,7 +14,7 @@ from .msg import err_buf, common_debug + + + def conf(): +- return os.getenv('COROSYNC_MAIN_CONFIG_FILE', '/etc/corosync/corosync.conf') ++ return os.getenv('COROSYNC_MAIN_CONFIG_FILE', '%%PREFIX%%/etc/corosync/corosync.conf') + + + def is_corosync_stack(): diff --git a/net-mgmt/crmsh/files/patch-crmsh_utils.py b/net-mgmt/crmsh/files/patch-crmsh_utils.py new file mode 100644 index 000000000000..455f6f522d52 --- /dev/null +++ b/net-mgmt/crmsh/files/patch-crmsh_utils.py @@ -0,0 +1,29 @@ +--- crmsh/utils.py.orig 2018-04-19 03:54:07 UTC ++++ crmsh/utils.py +@@ -989,7 +989,7 @@ def cluster_stack(): + return "heartbeat" + elif is_process("[a]isexec"): + return "openais" +- elif os.path.exists("/etc/corosync/corosync.conf") or is_program('corosync-cfgtool'): ++ elif os.path.exists("%%PREFIX%%/etc/corosync/corosync.conf") or is_program('corosync-cfgtool'): + return "corosync" + return "" + +@@ -1551,7 +1551,7 @@ def list_corosync_node_names(): + in corosync.conf + ''' + try: +- cfg = os.getenv('COROSYNC_MAIN_CONFIG_FILE', '/etc/corosync/corosync.conf') ++ cfg = os.getenv('COROSYNC_MAIN_CONFIG_FILE', '%%PREFIX%%/etc/corosync/corosync.conf') + lines = open(cfg).read().split('\n') + name_re = re.compile(r'\s*name:\s+(.*)') + names = [] +@@ -1570,7 +1570,7 @@ def list_corosync_nodes(): + in corosync.conf + ''' + try: +- cfg = os.getenv('COROSYNC_MAIN_CONFIG_FILE', '/etc/corosync/corosync.conf') ++ cfg = os.getenv('COROSYNC_MAIN_CONFIG_FILE', '%%PREFIX%%/etc/corosync/corosync.conf') + lines = open(cfg).read().split('\n') + addr_re = re.compile(r'\s*ring0_addr:\s+(.*)') + nodes = [] diff --git a/net-mgmt/crmsh/files/patch-hb__report_hb__report.in b/net-mgmt/crmsh/files/patch-hb__report_hb__report.in new file mode 100644 index 000000000000..7880f274039c --- /dev/null +++ b/net-mgmt/crmsh/files/patch-hb__report_hb__report.in @@ -0,0 +1,52 @@ +--- hb_report/hb_report.in.orig 2017-07-21 09:17:13 UTC ++++ hb_report/hb_report.in +@@ -203,11 +203,11 @@ time2str() { + } + # try to figure out where pacemaker ... etc + get_pe_state_dir() { +- PE_STATE_DIR=`python -c "import crmsh.config; print crmsh.config.path.pe_state_dir"` ++ PE_STATE_DIR=`%%PYTHON_CMD%% -c "import crmsh.config; print(crmsh.config.path.pe_state_dir)"` + test -d "$PE_STATE_DIR" + } + get_cib_dir() { +- CIB_DIR=`python -c "import crmsh.config; print crmsh.config.path.crm_config"` ++ CIB_DIR=`%%PYTHON_CMD%% -c "import crmsh.config; print(crmsh.config.path.crm_config)"` + test -d "$CIB_DIR" + } + get_pe_state_dir2() { +@@ -357,7 +357,7 @@ is_our_log() { + local cat + cat=`find_decompressor $logf` + local first_time="`$cat $logf | head -10 | find_first_ts`" +- local last_time="`$cat $logf | tail -10 | tac | find_first_ts`" ++ local last_time="`$cat $logf | tail -10 | tail -r | find_first_ts`" + if [ x = "x$first_time" -o x = "x$last_time" ]; then + return 0 # skip (empty log?) + fi +@@ -467,7 +467,7 @@ loginfo() { + local logf=$1 + local fake=$2 + local nextpos +- nextpos=`python -c "f=open('$logf');f.seek(0,2);print f.tell()+1"` ++ nextpos=`%%PYTHON_CMD%% -c "f=open('$logf');f.seek(0,2);print f.tell()+1"` + if [ "$fake" ]; then + echo "synthetic:$logf $nextpos" + else +@@ -1206,7 +1206,7 @@ which which >/dev/null 2>&1 || + fatal "please install the which(1) program" + + WE=`uname -n` # who am i? +-tmpdir=`mktemp -t -d .hb_report.workdir.XXXXXX` || ++tmpdir=`mktemp -d` || + fatal "disk full" + add_tmpfiles $tmpdir + WORKDIR=$tmpdir +@@ -1322,7 +1322,7 @@ glibc + " + case "$CLUSTER_TYPE" in + openais) +- CONF=/etc/corosync/corosync.conf # corosync? ++ CONF=%%PREFIX%%/etc/corosync/corosync.conf # corosync? + if test -f $CONF; then + CORES_DIRS="$CORES_DIRS /var/lib/corosync" + else diff --git a/net-mgmt/crmsh/files/patch-hb__report_openais__conf__support.sh b/net-mgmt/crmsh/files/patch-hb__report_openais__conf__support.sh new file mode 100644 index 000000000000..960979b99d6e --- /dev/null +++ b/net-mgmt/crmsh/files/patch-hb__report_openais__conf__support.sh @@ -0,0 +1,13 @@ +--- hb_report/openais_conf_support.sh.orig 2018-04-19 04:02:39 UTC ++++ hb_report/openais_conf_support.sh +@@ -70,8 +70,8 @@ getlogvars() { + } + cluster_info() { + : echo "openais version: how?" +- if [ "$CONF" = /etc/corosync/corosync.conf ]; then +- /usr/sbin/corosync -v ++ if [ "$CONF" = %%PREFIX%%/etc/corosync/corosync.conf ]; then ++ %%PREFIX%%/sbin/corosync -v + fi + } + essential_files() { diff --git a/net-mgmt/crmsh/files/patch-hb__report_utillib.sh b/net-mgmt/crmsh/files/patch-hb__report_utillib.sh new file mode 100644 index 000000000000..4d18aa4bead1 --- /dev/null +++ b/net-mgmt/crmsh/files/patch-hb__report_utillib.sh @@ -0,0 +1,20 @@ +--- hb_report/utillib.sh.orig 2017-07-21 09:17:13 UTC ++++ hb_report/utillib.sh +@@ -8,7 +8,7 @@ + get_cluster_type() { + if ps -ef | egrep -qs '[a]isexec|[c]orosync' || + [ -f /etc/ais/openais.conf -a ! -f "$HA_CF" ] || +- [ -f /etc/corosync/corosync.conf -a ! -f "$HA_CF" ] ++ [ -f %%PREFIX%%/etc/corosync/corosync.conf -a ! -f "$HA_CF" ] + then + debug "this is OpenAIS cluster stack" + echo "openais" +@@ -525,7 +525,7 @@ crmconfig() { + CIB_file=$1/$CIB_F crm configure show >$1/$CIB_TXT_F 2>&1 + } + get_crm_nodes() { +- /usr/sbin/crm node server ++ %%PREFIX%%/bin/crm node server + } + get_live_nodes() { + if [ `id -u` = 0 ] && which fping >/dev/null 2>&1; then diff --git a/net-mgmt/crmsh/files/patch-scripts_health_collect.py b/net-mgmt/crmsh/files/patch-scripts_health_collect.py new file mode 100644 index 000000000000..dc96e598a7fb --- /dev/null +++ b/net-mgmt/crmsh/files/patch-scripts_health_collect.py @@ -0,0 +1,11 @@ +--- scripts/health/collect.py.orig 2018-04-19 04:04:24 UTC ++++ scripts/health/collect.py +@@ -67,7 +67,7 @@ def disk_info(): + FILES = [ + '/etc/csync2/key_hagroup', + '/etc/csync2/csync2.cfg', +- '/etc/corosync/corosync.conf', ++ '%%PREFIX%%/etc/corosync/corosync.conf', + '/etc/sysconfig/sbd', + '/etc/sysconfig/SuSEfirewall2', + '/etc/sysconfig/SuSEfirewall2.d/services/cluster' diff --git a/net-mgmt/crmsh/files/patch-utils_crm__init.py b/net-mgmt/crmsh/files/patch-utils_crm__init.py new file mode 100644 index 000000000000..9b756fad9c49 --- /dev/null +++ b/net-mgmt/crmsh/files/patch-utils_crm__init.py @@ -0,0 +1,20 @@ +--- utils/crm_init.py.orig 2018-04-19 04:05:44 UTC ++++ utils/crm_init.py +@@ -13,7 +13,7 @@ SERVICES = ['sshd', 'ntp', 'corosync', ' + SSH_KEY = os.path.expanduser('~/.ssh/id_rsa') + CSYNC2_KEY = '/etc/csync2/key_hagroup' + CSYNC2_CFG = '/etc/csync2/csync2.cfg' +-COROSYNC_CONF = '/etc/corosync/corosync.conf' ++COROSYNC_CONF = '%%PREFIX%%/etc/corosync/corosync.conf' + SYSCONFIG_SBD = '/etc/sysconfig/sbd' + SYSCONFIG_FW = '/etc/sysconfig/SuSEfirewall2' + SYSCONFIG_FW_CLUSTER = '/etc/sysconfig/SuSEfirewall2.d/services/cluster' +@@ -107,7 +107,7 @@ def files_info(): + + def logrotate_info(): + rc, _, _ = crm_script.call( +- 'grep -r corosync.conf /etc/logrotate.d', ++ 'grep -r corosync.conf %%PREFIX%%/etc/logrotate.d', + shell=True) + return {'corosync.conf': rc == 0} + diff --git a/net-mgmt/crmsh/pkg-plist b/net-mgmt/crmsh/pkg-plist index 05a75317458a..3d287ae4e436 100644 --- a/net-mgmt/crmsh/pkg-plist +++ b/net-mgmt/crmsh/pkg-plist @@ -1,9 +1,9 @@ @sample etc/crm/crm.conf.sample -%%PYTHON_SITELIBDIR%%/crmsh-3.0.0-py%%PYTHON_VER%%.egg-info/PKG-INFO -%%PYTHON_SITELIBDIR%%/crmsh-3.0.0-py%%PYTHON_VER%%.egg-info/SOURCES.txt -%%PYTHON_SITELIBDIR%%/crmsh-3.0.0-py%%PYTHON_VER%%.egg-info/dependency_links.txt -%%PYTHON_SITELIBDIR%%/crmsh-3.0.0-py%%PYTHON_VER%%.egg-info/requires.txt -%%PYTHON_SITELIBDIR%%/crmsh-3.0.0-py%%PYTHON_VER%%.egg-info/top_level.txt +%%PYTHON_SITELIBDIR%%/crmsh-3.0.1-py%%PYTHON_VER%%.egg-info/PKG-INFO +%%PYTHON_SITELIBDIR%%/crmsh-3.0.1-py%%PYTHON_VER%%.egg-info/SOURCES.txt +%%PYTHON_SITELIBDIR%%/crmsh-3.0.1-py%%PYTHON_VER%%.egg-info/dependency_links.txt +%%PYTHON_SITELIBDIR%%/crmsh-3.0.1-py%%PYTHON_VER%%.egg-info/requires.txt +%%PYTHON_SITELIBDIR%%/crmsh-3.0.1-py%%PYTHON_VER%%.egg-info/top_level.txt %%PYTHON_SITELIBDIR%%/crmsh/__init__.py %%PYTHON_SITELIBDIR%%/crmsh/__init__.pyc %%PYTHON_SITELIBDIR%%/crmsh/bootstrap.py |