Fix rdma-core package installation (#19643)

* add python-docutils dependency

* adds symlink to script for better compatibility if py-docutils installation

* Improve post_install phase of py-docutils

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* fix review of rdma-core package

* improve formating of py-docutils package

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Hervé Yviquel 2020-11-01 13:08:06 -03:00 committed by GitHub
parent ffd5f6b196
commit f62efe5e2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import * from spack import *
import os
class PyDocutils(PythonPackage): class PyDocutils(PythonPackage):
@ -39,3 +40,14 @@ class PyDocutils(PythonPackage):
depends_on('python@2.2.1:3', when='@0.6:0.9', type=('build', 'run')) depends_on('python@2.2.1:3', when='@0.6:0.9', type=('build', 'run'))
depends_on('python@2.2.1:2.8', when='@0.5.0:0.5.999', type=('build', 'run')) depends_on('python@2.2.1:2.8', when='@0.5.0:0.5.999', type=('build', 'run'))
depends_on('python@2.1:2.8', when='@:0.4', type=('build', 'run')) depends_on('python@2.1:2.8', when='@:0.4', type=('build', 'run'))
# NOTE: This creates symbolic links to be able to run docutils scripts
# without .py file extension similarly to various linux distributions to
# increase compatibility with other packages
@run_after('install')
def post_install(self):
bin_path = self.prefix.bin
for file in os.listdir(bin_path):
if file.endswith(".py"):
os.symlink(os.path.join(bin_path, file),
os.path.join(bin_path, file[:-3]))

View file

@ -26,6 +26,7 @@ class RdmaCore(CMakePackage):
version('13', sha256='e5230fd7cda610753ad1252b40a28b1e9cf836423a10d8c2525b081527760d97') version('13', sha256='e5230fd7cda610753ad1252b40a28b1e9cf836423a10d8c2525b081527760d97')
depends_on('pkgconfig', type='build') depends_on('pkgconfig', type='build')
depends_on('py-docutils', type='build')
depends_on('libnl') depends_on('libnl')
conflicts('platform=darwin', msg='rdma-core requires FreeBSD or Linux') conflicts('platform=darwin', msg='rdma-core requires FreeBSD or Linux')
conflicts('%intel', msg='rdma-core cannot be built with intel (use gcc instead)') conflicts('%intel', msg='rdma-core cannot be built with intel (use gcc instead)')