summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c85314f406673ef00c16a38a4a9b1bc84be1f4d6 (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
# Maintainer: Shalygin Konstantin <k0ste@k0ste.ru>
# Contributor: Shalygin Konstantin <k0ste@k0ste.ru>

pkgname='arcconf'
_pkgname='Arcconf'
_pkgrel='26540'
pkgver="4.17.00.${_pkgrel}"
_rpmver="4.17-${_pkgrel}"
pkgrel='1'
pkgdesc='Microsemi Adaptec command line interface utility'
arch=('x86_64' 'aarch64')
makedepends=('libarchive')
url='https://storage.microsemi.com/en-us/support'
license=('custom')
source=("https://download.adaptec.com/raid/storage_manager/${pkgname}_B${_pkgrel}.zip"
	"https://download.adaptec.com/raid/storage_manager/${pkgname}_v3_07_23980.zip")
sha256sums=('d980bce53b21c14f3d5e799c7a97638cdc13558c6944e76b23bc0fdc55dcf219'
            '27beeaff6e51f2aa8292ff3f31c3774011468ccba1483755e056f2a82db012d1')
noextract=("${source[@]##*/}")

_current_str="${pkgname}_${_pkgrel}"
_legacy_str="${pkgname}_legacy"
_archstr="$([[ "${CARCH}" == 'x86_64' ]] && \
  echo -n "${_current_str}_src/linux_x64/cmdline/linux_x64/rpm" || \
  echo -n "${_current_str}_src/linuxarm_x64/rpm")"
# The legacy is version of software for HBA1000 Adaptec controlles and older (the 'aacraid' linux driver)
# The 'current' version support HBA1100 Microsemi controllers and higher (the 'smartpqi' linux driver)
_archstr_legacy="$([[ "${CARCH}" == 'x86_64' ]] && \
  echo -n "${_legacy_str}_src/linux_x64/rpm" || \
  echo -n "${_legacy_str}_src/linux_x64/arm/rpm")"

prepare() {
  mkdir "${_current_str}_src" "${_legacy_str}_src" "${_current_str}" "${_legacy_str}"
  bsdtar xf "${pkgname}_B${_pkgrel}.zip" -C "${_current_str}_src"
  bsdtar xf "${pkgname}_v3_07_23980.zip" -C "${_legacy_str}_src"

  bsdtar xf "${_archstr}/${_pkgname}-${_rpmver}.${CARCH}.rpm" -C "${_current_str}"
  bsdtar xf "${_archstr_legacy}/${_pkgname}-3.07-23980.${CARCH}.rpm" -C "${_legacy_str}"
}

package() {
  install -Dm0755 "${_current_str}/usr/${_pkgname}/${pkgname}" -t "${pkgdir}/usr/bin"
  install -Dm0644 "${_current_str}/usr/${_pkgname}/License.txt" \
    "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
  install -Dm0755 "${_legacy_str}/usr/${_pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}-legacy"
}