summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e92511aa94833dc4e77c54ba1160cf81545edcbc (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
# Maintainer: Oleksandr Knyshuk <kigen745 at gmail dot com>

_pkgname=Havoc
pkgname=havoc-c2-git
pkgver=r619.f163210
pkgrel=1
pkgdesc="Modern and malleable post-exploitation command and control framework"
arch=('x86_64')
url="https://havocframework.com/"
license=('GPL3')
depends=('openssl' 'qt5-base' 'qt5-websockets' 'python3' 'fontconfig' 'gtest'
		 'spdlog' 'boost' 'boost-libs' 'ncurses' 'gdbm' 'readline' 'libffi'
		 'sqlite' 'bzip2' 'nasm' 'mingw-w64-gcc' 'go' 'mesa' 'glu')
makedepends=('git' 'base-devel' 'cmake')
optdepends=('qt5-wayland: wayland support')
source=('git+https://github.com/HavocFramework/Havoc.git#branch=dev')
install='havoc-c2-git.install'
sha256sums=('SKIP')

pkgver() {
	cd $_pkgname
	(	set -o pipefail
		git describe --long --abbrev=7 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
		printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
	)
}

prepare() {
	cd "$_pkgname/client"
	if [ -d "Modules" ]; then echo "Modules installed"; else git clone https://github.com/HavocFramework/Modules; fi
	cd ../teamserver
	go mod download golang.org/x/sys
	go mod download github.com/ugorji/go
}

build() {
	cd $_pkgname
	sed -i '/sudo/d' makefile && sed -i '/apt/d' teamserver/Install.sh
	make all
}

package() {
	install -d "$pkgdir"/{opt,usr/bin,usr/share/licenses}
	cp -r $_pkgname "$pkgdir"/opt/
	rm -rf "$pkgdir"/opt/"$_pkgname"/assets
	install -Dm755 ../havoc_runner.sh "${pkgdir}"/usr/bin/havoc
	install -Dm644 "$_pkgname"/LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
}