# Maintainer (Arch): Giancarlo Bianchi <giancarlobianchi76@gmail.com>
# Maintainer: André Silva <emulatorman@parabola.nu>

pkgname=realtimeconfigquickscan-git
pkgver=r16.c362fbb
pkgrel=1
pkgdesc="Inspect a GNU/Linux system configuration and make suggestions for improving realtime performance"
arch=('any')
url="https://github.com/raboof/realtimeconfigquickscan"
license=('GPL')
depends=('jack' 'perl' 'perl-tk')
makedepends=('git')
conflicts=('realtimeconfigquickscan' 'realtimeconfigquickscan-hg')
source=(git+https://github.com/raboof/realtimeconfigquickscan.git)
md5sums=('SKIP')

pkgver() {
  cd realtimeconfigquickscan
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  cd realtimeconfigquickscan

  install -dm 0755 "$pkgdir/usr/share/$pkgname"
  install -dm 0755 "$pkgdir/usr/bin/"

  # Data files
  for i in *; do
    install -m 0644 "$i" "$pkgdir/usr/share/$pkgname/$i"
  done

  # Bin1
  cat << EOF > "$pkgdir/usr/bin/realTimeConfigQuickScan"
#!/bin/bash
set -e
cd /usr/share/$pkgname
exec perl realTimeConfigQuickScan.pl
EOF
  chmod 755 "$pkgdir/usr/bin/realTimeConfigQuickScan"

  # Bin2
  cat << EOF > "$pkgdir/usr/bin/QuickScan"
#!/bin/bash
set -e
cd /usr/share/$pkgname
exec perl QuickScan.pl
EOF
  chmod 755 "$pkgdir/usr/bin/QuickScan"

}