/
PKGBUILD
47 lines (35 loc) · 1.21 KB
/
PKGBUILD
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
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.
pkgname=kh2hc
_gemname=$pkgname
pkgver=0.0.1.r49.g50e4e5e
pkgrel=1
pkgdesc='Convert OpenSSH known_hosts file hashed with HashKnownHosts to hashes crackable by Hashcat.'
arch=('any')
groups=('blackarch' 'blackarch-crypto' 'blackarch-misc')
url='https://github.com/noraj/kh2hc'
license=('MIT')
depends=('ruby' 'ruby-docopt' 'ctf-party')
makedepends=('git')
options=(!emptydirs)
source=("git+https://github.com/noraj/$_gemname.git")
sha512sums=('SKIP')
pkgver() {
cd $_gemname
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
build() {
cd $_gemname
gem build $_gemname.gemspec
}
package() {
cd $_gemname
_gemdir="$(ruby -e'puts Gem.default_dir')"
_release=$(gem build $_gemname.gemspec | grep Version | cut -d' ' -f4)
gem install --ignore-dependencies --no-user-install --no-document \
-i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" "$_gemname-$_release.gem"
rm "$pkgdir/$_gemdir/cache/$_gemname-$_release.gem"
find "$pkgdir/$_gemdir/extensions/" -name *.so -delete
install -Dm 644 "$pkgdir/$_gemdir/gems/$_gemname-$_release/LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}