summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d6a62940fa89f2a788173496536dc230bdacd329 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Maintainer: Jaryl Chng <mrciku@gmail.com>
pkgname=dff-git
pkgver=20160519.d40d46b
pkgrel=1
pkgdesc='A Forensics Framework coming with command line and graphical interfaces.'
arch=('any')
url='https://github.com/arxsys/dff'
license=('GPL')
provides=('dff-git')
conflicts=('dff')
groups=()
depends=('qt4' 'python-pyqt4' 'python2-pyqt4' 'python2-magic' 'python2-apsw' 'python2-pillow' 'poppler-qt4' 'python2-poppler-qt4' 'ffmpeg' 'libbfio-git' 'libbde-git' 'libewf-git' 'libpff-git' 'libvshadow-git' 'fuse')
makedepends=('autoconf' 'automake' 'libtool' 'gettext' 'pkg-config' 'bison' 'flex' 'swig' 'tre' 'pkg-config' 'libbfio-git' 'libbde-git' 'libewf-git' 'libpff-git' 'libvshadow-git' 'git' 'cmake')
optdepends=(
  'python2-pefile: PE files support'
  'reglookup: registry hives support'
  'volatility: volatile memory support'
  'libreoffice-fresh: documents support'
)
options=()
source=(
  'git+https://github.com/arxsys/dff.git'
  'fixes.patch'
)
sha256sums=(
  'SKIP'
  '0c2b4a3380287042fc915b81148cb900224de4a41231d30e489944be3fb4546a'
)

_gitname="dff"

pkgver() {
  cd "$srcdir/$_gitname"
  git log -1 --format='%cd.%h' --date=short | tr -d -
}

prepare() {
  cd "$_gitname"

  # patching to python2
  sed -i 's/\/python/\/python2/g' 'dff.py'
  sed -i 's/\/python/\/python2/g' 'dff-gui.py'
  sed -i 's/dff -g/dff-gui/g' 'ressources/dff.desktop'

  # pull submodules
  git submodule update --init --remote
  git submodule foreach git checkout develop

  # patching FindICU.cmake and EWF.cpp for compatibility.
  patch -Np1 -i "${srcdir}/fixes.patch"
}

build() {
  cd "$_gitname"

  # create build folder
  rm -rf build
  mkdir -p build && cd build

  # python2 temporary alias
  mkdir -p bin
  cp /usr/bin/python2 bin/python

  # build process
  PATH=./bin:$PATH cmake \
    -Wno-dev \
    -DCMAKE_INSTALL_PREFIX:FILEPATH=/usr \
    ..
  PATH=./bin:$PATH make
}

package() {
  cd "$_gitname/build"
  PATH=./bin:$PATH make INSTALL_ROOT="$pkgdir" DESTDIR="$pkgdir/" install

  mv $pkgdir/usr/bin/dff $pkgdir/usr/bin/dff-cli
  cp -r $pkgdir/usr/lib/python2.7/site-packages/dff $pkgdir/usr/bin/
}