# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Limao Luo <luolimao+AUR@gmail.com>
# Contributor: Wes Brown <wesbrown18@gmail.com>

pkgname=volatility
pkgver=2.6.1
pkgrel=1
pkgdesc='Advanced memory forensics framework'
url='https://github.com/volatilityfoundation/volatility/wiki'
arch=('any')
license=('GPL2')
depends=('python2-distorm' 'python2-crypto' 'python2-ujson')
optdepends=(
  'python2-yara: classify malware support'
  'python2-pillow: screenshots plugin support'
  'python2-pytz: timezone conversion support'
  'ipython2: enhanced volshell support'
  'python2-libforensic1394: firewire live analysis support'
  'libraw1394: alternative firewire live analysis support'
  'python2-openpyxl: Excel xlsx/xlsm files support'
)
makedepends=('python2-setuptools')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/volatilityfoundation/${pkgname}/archive/${pkgver}.tar.gz)
sha512sums=('64d49de21a87fb6152ad430126466bf66bca06457f3fa2d54cee29b0e4a2eee53ab658570b6cbc782e85ca558f45fac5cf6e6625ebd85aa3ffc9f69768cfa844')

prepare() {
  cd ${pkgname}-${pkgver}
  sed -e 's/env python$/env python2/g' -i tools/vtype_diff.py tools/mac/convert.py
}

package() {
  cd ${pkgname}-${pkgver}

  python2 setup.py install -O1 --prefix=/usr --root="${pkgdir}"
  ln -s /usr/bin/vol.py "${pkgdir}/usr/bin/${pkgname}"

  install -d "${pkgdir}/usr/share/${pkgname}"
  mv "${pkgdir}/usr/tools" "${pkgdir}/usr/share/${pkgname}"
  mv "${pkgdir}/usr/contrib" "${pkgdir}/usr/share/${pkgname}"
  install -Dm 644 README.txt "${pkgdir}/usr/share/doc/${pkgname}/README"
}

# vim: ts=2 sw=2 et:
