# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: William Rea <sillywilly@gmail.com>

pkgname=splint
pkgver=3.1.2.git20180129
pkgrel=3
_commit=3fb908d0d8a4daa26dc770e1f2aa133f93100503
pkgdesc="A tool for statically checking C programs for security vulnerabilities and coding mistakes"
arch=('x86_64')
url="https://repo.or.cz/splint-patched.git"
license=('GPL')
depends=('flex')
makedepends=('git')
options=('!makeflags')
source=("git+https://repo.or.cz/splint-patched.git#commit=${_commit}"
	'splint.sh')
sha256sums=('SKIP'
            'ea90b733037ef1ad25a0a5f39cbb33ca747dabd3b2bfd9d087f3981bc6990b61')

prepare() {
  cd "${srcdir}"/splint-patched
  autoreconf -fi
}

build() {
  cd "${srcdir}"/splint-patched
  ./configure --prefix=/usr --mandir=/usr/share/man
  make -j1
}

package() {
  cd "${srcdir}"/splint-patched
  make DESTDIR="${pkgdir}" install
  install -D -m755 "${srcdir}"/splint.sh "${pkgdir}"/etc/profile.d/splint.sh
}
