summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 51150c986077d15ea59559dfdb0bd4ba92a7dd2b (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
49
50
51
52
53
54
55
# Contributor: James P. Harvey <jamespharvey20 at gmail dot com>
# Contributor: Konstantin Shalygin <k0ste@k0ste.ru>

pkgname=mstflint3
pkgver=3.8.0.27
_pkgver=3.8.0-1.27.gf3d39b6
pkgrel=2
pkgdesc='OpenFabrics Alliance firmware burning application (old version) for Mellanox ConnectX-2'
arch=('x86_64' 'i686')
url='https://www.openfabrics.org/index.php/overview.html'
license=('GPL2' 'custom:"OpenIB.org BSD"')
depends=('python' 'sqlite')
source=("https://www.openfabrics.org/downloads/mstflint/mstflint-$_pkgver.tar.gz")
sha256sums=('SKIP')

prepare() {
  cd mstflint-3.8.0
  sed -i '/^CFLAGS=/ s/-Werror//' configure.ac
  sed -i '/^CXXFLAGS=/ s/-Werror/-std=gnu++98 -Wno-c++11-compat/' configure.ac
  ./autogen.sh
}

build() {
  cd mstflint-3.8.0
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --libexecdir=/usr/lib \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --mandir=/usr/share/man \
    --disable-inband
  make
}

package() {
  cd mstflint-3.8.0
  make DESTDIR="${pkgdir}" install
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 README "${pkgdir}/usr/share/doc/${pkgname}/README"

  # Remove files that might conflict with latest mstflint
  rm -rvf "${pkgdir}/usr/bin/hca_self_test.ofed"
  rm -rvf "${pkgdir}/usr/include"
  rm -rvf "${pkgdir}/usr/lib"
  rm -rvf "${pkgdir}/usr/share/mstflint"

  # Rename all mst* binaries to mst*3
  for bin in mst{config,flint,mcra,mread,mtserver,mwrite,regdump,vpd}; do
    mv -v "${pkgdir}/usr/bin/${bin}" \
          "${pkgdir}/usr/bin/${bin}3"
  done
  mv -v "${pkgdir}/usr/share/man/man1/mstflint.1" \
        "${pkgdir}/usr/share/man/man1/mstflint3.1"
}