diff --git a/src/ibutils/PKGBUILD b/src/ibutils/PKGBUILD new file mode 100644 index 0000000..8c97cfb --- /dev/null +++ b/src/ibutils/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: James P. Harvey + +pkgname=ibutils +pkgver=1.5.7 +_pkgver_subver=0.2 +_pkgver_commit=gbd7e502 +pkgrel=2 +pkgdesc='OpenFabrics Alliance InfiniBand network diagnostic and testing utilities' +arch=('x86_64' 'i686') +url='https://www.openfabrics.org/index.php/overview.html' +license=('GPL2' 'custom:"OpenIB.org BSD"') +depends=('opensm' 'tk' 'perl') +source=("https://www.openfabrics.org/downloads/${pkgname}/${pkgname}-${pkgver}-${_pkgver_subver}.${_pkgver_commit}.tar.gz" + 'ibis-drop-multiple-definition-of-IbisObj.patch') +sha256sums=('67a3b417c8d0820400045dd7143674824086c6793a40ded333be50e498d9a703' + '4fafa1e2e26e79ba5c826263f691380839b28631eb1ed4fe3a4700167bec4d92') + +prepare() { + cd "${srcdir}/${pkgname}-${pkgver}" + patch -p1 < "${srcdir}/ibis-drop-multiple-definition-of-IbisObj.patch" +} + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + ./configure --prefix=/usr \ + --sbindir=/usr/bin \ + --libexecdir=/usr/lib \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --with-tk-lib=/usr/lib/libtk8.6 + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING" + + # No reason this should be going into /usr/bin + rm -f "${pkgdir}/usr/bin/git_version.tcl" +} diff --git a/src/ibutils/ibis-drop-multiple-definition-of-IbisObj.patch b/src/ibutils/ibis-drop-multiple-definition-of-IbisObj.patch new file mode 100644 index 0000000..019595b --- /dev/null +++ b/src/ibutils/ibis-drop-multiple-definition-of-IbisObj.patch @@ -0,0 +1,46 @@ +commit 62998956cb17538f925f76ce6c4193f415f7cc01 +Author: Nicolas Morey-Chaisemartin +Date: Sun Jun 7 14:56:55 2020 +0200 + + ibis drop multiple definition of IbisObj + + Drop multiple global definition of IbisObj that breaks with GCC10 + + Signed-off-by: Nicolas Morey-Chaisemartin + +diff --git ibis/src/ibis.i ibis/src/ibis.i +index 28a0912dd848..e66d84e7bb80 100644 +--- a/ibis/src/ibis.i ++++ b/ibis/src/ibis.i +@@ -180,7 +180,6 @@ ibisp_is_debug(void) + + %{ + /* globals */ +- ibis_t IbisObj; + static ibis_opt_t *ibis_opt_p; + ibis_opt_t IbisOpts; + +diff --git ibis/src/ibis_wrap.c ibis/src/ibis_wrap.c +index ee9760127577..7efadea896ab 100644 +--- a/ibis/src/ibis_wrap.c ++++ b/ibis/src/ibis_wrap.c +@@ -3004,7 +3004,6 @@ typedef struct { + + + /* globals */ +- ibis_t IbisObj; + static ibis_opt_t *ibis_opt_p; + ibis_opt_t IbisOpts; + +diff --git ibis/src/ibissh_wrap.cpp ibis/src/ibissh_wrap.cpp +index 917904fe382a..2f69c4018e71 100644 +--- a/ibis/src/ibissh_wrap.cpp ++++ b/ibis/src/ibissh_wrap.cpp +@@ -3004,7 +3004,6 @@ typedef struct { + + + /* globals */ +- ibis_t IbisObj; + static ibis_opt_t *ibis_opt_p; + ibis_opt_t IbisOpts; + diff --git a/src/mstflint/PKGBUILD b/src/mstflint/PKGBUILD new file mode 100644 index 0000000..8118d36 --- /dev/null +++ b/src/mstflint/PKGBUILD @@ -0,0 +1,45 @@ +# Maintainer: James P. Harvey + +pkgname=mstflint +pkgver=4.13.1.1 +_pkgver=4.13.1-1 +pkgrel=1 +pkgdesc='OpenFabrics Alliance firmware burning application for Mellanox HCA/NIC cards (without inband support)' +arch=('x86_64' 'i686') +url='https://www.openfabrics.org/index.php/overview.html' +license=('GPL2' 'custom:"OpenIB.org BSD"') +depends=('python' 'sqlite') +makedepends=('git') +source=("git+https://github.com/Mellanox/${pkgname}#tag=v${_pkgver}") +sha256sums=('SKIP') + +#The release tarballs cannot be used cleanly on Arch +#Reported upstream: https://github.com/Mellanox/mstflint/issues/6 +#https://github.com/Mellanox/${pkgname}/archive/v${_pkgver}.tar.gz +# autogen.sh (through gitversion.sh) assumes it's running from a git tree, not a source tarball +# so, it fails to write common/gitversion.h which causes a compilation failure +# (if you run this from within a different git tree (i.e. AUR repo) it will proceed with wrong sha +#https://github.com/Mellanox/${pkgname}/releases/download/v${_pkgver}/${pkgname}-${_pkgver}.tar.gz +# has files created upstream by autogen.sh, which is hard-coded to run with aclocal-1.13 +# and arch has aclocal-1.16 + +build() { + cd "${srcdir}/${pkgname}" + + ./autogen.sh + ./configure --prefix=/usr \ + --sbindir=/usr/bin \ + --libexecdir=/usr/lib \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --disable-inband + make +} + +package() { + cd "${srcdir}/${pkgname}" + make DESTDIR="${pkgdir}" install + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm644 README "${pkgdir}/usr/share/docs/${pkgname}/README" +} diff --git a/src/opensm/PKGBUILD b/src/opensm/PKGBUILD new file mode 100644 index 0000000..1756417 --- /dev/null +++ b/src/opensm/PKGBUILD @@ -0,0 +1,45 @@ +# Maintainer: James P. Harvey + +pkgname=opensm +pkgver=3.3.22 +pkgrel=1 +pkgdesc='OpenFabrics Alliance InfiniBand Subnet Manager and Administrator' +arch=('x86_64' 'i686') +url='https://www.openfabrics.org/index.php/overview.html' +license=('GPL2' 'custom:"OpenIB.org BSD"') +depends=('rdma-core' 'bash') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/linux-rdma/${pkgname}/archive/${pkgver}.tar.gz" + 'opensm.service' + 'opensm.launch') +sha256sums=('1e0dc56a5cf5f8e5cd68bd534591405a5f5f1975ace40509f61a43cc2fe74ca7' + 'a40c8a556cb170d84ffb49791fb82aabb21dc4afd22865e8f264a93c1f304788' + '6fe01543d11d9fe0b4d3eeb9a6c6abf42c60da2e90c2dea829452a3bcfa6b3ce') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + ./autogen.sh + ./configure --prefix=/usr \ + --sbindir=/usr/bin \ + --libexecdir=/usr/lib \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/share/man + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING" + + # Convert from init.d to systemd + rm -rf "${pkgdir}/etc/init.d" + # ${pkgdir}/etc should now be empty + rmdir "${pkgdir}/etc/" > /dev/null + + install -Dm644 "${srcdir}/opensm.service" "${pkgdir}/usr/lib/systemd/system/opensm.service" + install -Dm755 "${srcdir}/opensm.launch" "${pkgdir}/usr/bin/opensm.launch" + + mkdir --parents "${pkgdir}/usr/share/docs/${pkgname}" + cp doc/* "${pkgdir}/usr/share/docs/${pkgname}" +} diff --git a/src/opensm/opensm.launch b/src/opensm/opensm.launch new file mode 100644 index 0000000..6d2d9c6 --- /dev/null +++ b/src/opensm/opensm.launch @@ -0,0 +1,14 @@ +#!/bin/bash +# Upstream doesn't provide a systemd .service file +# There is a timing bug that intermittently causes signal 15 failures on start +# Fedora's workaround is to use a separate script +# Copied from Fedora's opensm-3.3.17-4.fc22.x86_64.rpm +# Following Arch's philosophy of deviating from upstream as little as possible, +# modified to just launch opensm. +# If you need simultaneous multiple interfaces, instead check out the AUR package +# opensm-systemd-multiple-interfaces +# +# Launch the necessary OpenSM daemons for systemd + +(while true; do /usr/bin/opensm; sleep 30; done) & +exit 0 diff --git a/src/opensm/opensm.service b/src/opensm/opensm.service new file mode 100644 index 0000000..2ceb7b0 --- /dev/null +++ b/src/opensm/opensm.service @@ -0,0 +1,20 @@ +# Upstream doesn't provide a systemd .service file +# Copied from Fedora's opensm-3.3.17-4.fc22.x86_64.rpm +# Modified to follow Arch layout + +[Unit] +Description=Starts the OpenSM InfiniBand fabric Subnet Manager +Documentation=man:opensm +DefaultDependencies=false +Before=network.target remote-fs-pre.target +Requires=rdma.service +After=rdma.service + +[Service] +Type=forking +# There is a timing bug that intermittently causes signal 15 failures on start +# Fedora's workaround is to use a separate script +ExecStart=/usr/bin/opensm.launch + +[Install] +WantedBy=network.target diff --git a/src/rdma-core/PKGBUILD b/src/rdma-core/PKGBUILD new file mode 100644 index 0000000..10a9b33 --- /dev/null +++ b/src/rdma-core/PKGBUILD @@ -0,0 +1,79 @@ +#!/usr/bin/bash +# shellcheck disable=SC2034,SC2154,SC2164 +pkgname=('rdma-core') +_srcname='rdma-core' +pkgdesc='RDMA core userspace libraries and daemons' +pkgver='30.0' +_tag="v${pkgver}" +pkgrel='1' +arch=('x86_64') +url="https://github.com/linux-rdma/${_srcname}" +license=('GPL2' 'custom:OpenIB.org BSD (MIT variant)') + +depends=('libnl' 'ethtool') +makedepends=('git' 'cmake' 'gcc' 'libsystemd' 'systemd' 'pkg-config' 'ninja' 'bash' 'pandoc' 'python' 'python-docutils') +_provides=('rdma' 'ibacm' 'libiwpm' 'libibcm' 'libibumad' 'libibverbs' + 'librdmacm' 'libcxgb3' 'libcxgb4' 'libmlx4' 'libmlx5' 'libmthca' 'libnes' 'libocrdma' + 'srptools' 'infiniband-diags' 'libibmad') +provides=("${_provides[@]}") +conflicts=("${_provides[@]}") +replaces=("${_provides[@]}") +backup=('etc/rdma/'{'rmda.conf','mlx4.conf','sriov-vfs'}) + +source=("${_srcname}::git+${url}.git#tag=${_tag}?signed") +sha512sums=('SKIP') +validpgpkeys=('921AFFAF83A9D7FD38CAA681E4637B88367258A7' # leon@leon.nu + '42D25385C1A1C02B8B1B1C6F801BDDB825988F64') # nicolas@morey-chaisemartin.com + +prepare() { + cd "${srcdir}/${_srcname}" + + find redhat -type f -exec sed --in-place \ + --expression='s|/usr/libexec|/usr/lib/rdma|g' \ + --expression='s|/usr/sbin|/usr/bin|g' \ + --expression='s|/sbin|/usr/bin|g' \ + '{}' '+' +} + +build() { + cd "${srcdir}/${_srcname}" + + mkdir build + cd build + cmake \ + -GNinja \ + -DENABLE_VALGRIND=0 \ + -DCMAKE_BUILD_TYPE='Release' \ + -DCMAKE_INSTALL_PREFIX='/usr' \ + -DCMAKE_INSTALL_RUNDIR='/run' \ + -DCMAKE_INSTALL_SBINDIR='/usr/bin' \ + -DCMAKE_INSTALL_LIBDIR='/usr/lib' \ + -DCMAKE_INSTALL_LIBEXECDIR='/usr/lib/rdma' \ + -DCMAKE_INSTALL_SYSCONFDIR='/etc' \ + -DCMAKE_INSTALL_PERLDIR='/usr/share/perl5/vendor_perl' \ + .. + ninja +} + +package() { + cd "${srcdir}/${_srcname}/build" + export DESTDIR="${pkgdir}" + ninja install + + rm --recursive "${pkgdir}/etc/init.d" + + cd "${srcdir}/${_srcname}/redhat" + install -D --mode=0644 rdma.conf "${pkgdir}/etc/rdma/rdma.conf" + install -D --mode=0755 rdma.kernel-init "${pkgdir}/usr/lib/rdma/rdma-init-kernel" + install -D --mode=0755 rdma.mlx4-setup.sh "${pkgdir}/usr/lib/rdma/mlx4-setup.sh" + install -D --mode=0644 rdma.mlx4.conf "${pkgdir}/etc/rdma/mlx4.conf" + install -D --mode=0644 rdma.mlx4.sys.modprobe "${pkgdir}/usr/lib/modprobe.d/libmlx4.conf" + install -D --mode=0755 rdma.modules-setup.sh "${pkgdir}/usr/lib/dracut/modules.d/05rdma/module-setup.sh" + install -D --mode=0644 rdma.service "${pkgdir}/usr/lib/systemd/system/rdma.service" + install -D --mode=0755 rdma.sriov-init "${pkgdir}/usr/lib/rdma/rdma-set-sriov-vf" + install -D --mode=0644 rdma.sriov-vfs "${pkgdir}/etc/rdma/sriov-vfs" + install -D --mode=0644 rdma.udev-rules "${pkgdir}/usr/lib/udev/rules.d/98-rdma.rules" + + cd "${srcdir}/${_srcname}" + install -D --mode=0644 COPYING.BSD_MIT "${pkgdir}/usr/share/licenses/${pkgname[0]%-git}/COPYING.BSD_MIT" +}