summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ef5cbe3c946725c6485d47ca2140e9668d2cba9b (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
# Maintainer: Hao Long <aur@esd.cc>

pkgname=htrace.sh
pkgver=1.1.7
pkgrel=3
pkgdesc="A shell script for http/https troubleshooting and profiling"
arch=('any')
url="https://github.com/trimstray/htrace.sh"
license=('MIT')
provides=('htrace.sh')
conflicts=('htrace.sh')
depends=('bind-tools'
         'mmdblookup'
         'bc'
         'jq'
         'testssl.sh'
         'observatory-cli'
         'ssllabs-scan'
         'mixed-content-scan'
         'nmap'
         'subfinder'
         'wafw00f'
         'nghttp2')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/trimstray/htrace.sh/archive/v${pkgver}.tar.gz"
        "01-rename-testssl.patch"
        "02-relocation-tmp-and-log-folder.patch")
sha256sums=('bc8ed23f247d7ae45dd65bdc844c4681215d27016f4b90957493ecbac9e2b743'
            '76ea3e6c1271089f8773c0da066a1b4678082b196b9bab51c24fcd3e73c96035'
            '8feae39f2f3a4fb2b0c24734bdfdd778aa8b12848b4f2d7c81fe3a04eb7553ff')

prepare() {
  cd $pkgname-$pkgver
  # Package testssl.sh is in [Community]
  # The script is located in /usr/bin/testssl
  patch -Np1 -i ${srcdir}/01-rename-testssl.patch
  # This package will be installed to /usr/share/htrace.sh
  # And this folder will be owned by root
  # So I am relocation the folder that the normal user will read/write
  # tmp => $(mktemp -d)
  # log => /tmp/htrace.sh-log
  patch -Np1 -i ${srcdir}/02-relocation-tmp-and-log-folder.patch
}

package() {
  cd $pkgname-$pkgver
  install -Dm644 config "${pkgdir}/usr/share/${pkgname}/config"
  cp -r bin/ "${pkgdir}/usr/share/${pkgname}"
  cp -r lib/ "${pkgdir}/usr/share/${pkgname}"
  cp -r src/ "${pkgdir}/usr/share/${pkgname}"
  install -d -m755 "${pkgdir}/usr/bin"
  ln -sr "${pkgdir}/usr/share/${pkgname}/bin/htrace.sh" "${pkgdir}/usr/bin/htrace.sh"
  install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 static/man8/htrace.sh.8 "$pkgdir/usr/share/man/man8/htrace.sh.8"
}