summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2125f0c5f9d4e0b99292fe0ac61fcd61246b4e8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: James Harvey <jamespharvey20@gmail.com>
# * OpenFabrics Alliance InfiniBand subnet manager (SM) and subnet administrator (SA)
#    * One subnet manager is required to run each InfiniBand subnet, before initializing InfiniBand hardware
# * No Namcap warnings or errors
# Up to date with fedora's opensm-3.3.17-5.fc23.src.rpm

pkgname=opensm
pkgver=3.3.21
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:"Open Fabrics Alliance BSD"')
depends=('libibumad' 'rdma')
source=("https://github.com/linux-rdma/opensm/archive/${pkgver}.tar.gz"
        'opensm.service'
        'opensm.launch')
md5sums=('7149ad46987749ae80a00124dd1e3f9d'
         'f1155dd8fb07ce56c427bceb7ce3fffb'
         '7cd151f96d46ba1bc651fce0e2b7e8dc')

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
  # If ${pkgdir}/etc is empty (it should be, since /etc/init.d/ was removed) remove it
  if ! [ "$(ls -A ${pkgdir}/etc)" ]; then
     rm -rf ${pkgdir}/etc/
  fi

  install -Dm644 "${srcdir}/opensm.service" "${pkgdir}/usr/lib/systemd/system/opensm.service"
  install -Dm755 "${srcdir}/opensm.launch" "${pkgdir}/usr/bin/opensm.launch"
}