diff options
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | 01-rename-testssl.patch | 26 | ||||
-rw-r--r-- | 02-relocation-tmp-and-log-folder.patch | 15 | ||||
-rw-r--r-- | PKGBUILD | 54 |
4 files changed, 125 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d47b56a47430 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,30 @@ +pkgbase = htrace.sh + pkgdesc = A shell script for http/https troubleshooting and profiling + pkgver = 1.1.7 + pkgrel = 1 + url = https://github.com/trimstray/htrace.sh + arch = any + license = MIT + depends = bind-tools + depends = mmdblookup + depends = bc + depends = jq + depends = testssl.sh + depends = nodejs-observatory-cli + depends = ssllabs-scan + depends = mixed-content-scan + depends = nmap + depends = subfinder + depends = wafw00f + depends = nghttp2 + provides = htrace.sh + conflicts = htrace.sh + source = https://github.com/trimstray/htrace.sh/archive/v1.1.7.tar.gz + source = 01-rename-testssl.patch + source = 02-relocation-tmp-and-log-folder.patch + sha256sums = 727b684361d2cb88c605471f9d030e0f132d9d8bde7fb2734d8753b4e7cf73bc + sha256sums = dd15bd186d5e32dc1d87997bde068d07fa32c61385466aeee0896c300d32071a + sha256sums = 8feae39f2f3a4fb2b0c24734bdfdd778aa8b12848b4f2d7c81fe3a04eb7553ff + +pkgname = htrace.sh + diff --git a/01-rename-testssl.patch b/01-rename-testssl.patch new file mode 100644 index 000000000000..f9b0ef45ae48 --- /dev/null +++ b/01-rename-testssl.patch @@ -0,0 +1,26 @@ +diff --git a/lib/DomainScanTestssl b/lib/DomainScanTestssl +index 04bb1a0..609f11b 100644 +--- a/lib/DomainScanTestssl ++++ b/lib/DomainScanTestssl +@@ -32,7 +32,7 @@ function DomainScanTestssl() { + local _testssl_desc="Test ssl protocols and ciphers:" + _testssl_desc+="https://testssl.sh/" + +- local _testssl_cmd="eval testssl.sh $TESTSSL_OPT \"$_host\"" ++ local _testssl_cmd="eval testssl $TESTSSL_OPT \"$_host\"" + + _msg_args+=(\ + "$_testssl_desc") +diff --git a/src/__init__ b/src/__init__ +index 68029f8..96e5311 100644 +--- a/src/__init__ ++++ b/src/__init__ +@@ -320,7 +320,7 @@ function __main__() { + # unnecessarily run. + readonly commands=(basename dirname stat ps date grep cut sed awk chown \ + chmod mkdir curl openssl dig mmdblookup bc jq fmt \ +- testssl.sh observatory ssllabs-scan \ ++ testssl observatory ssllabs-scan \ + mixed-content-scan nmap wafw00f subfinder) + + # If you intend to specify the full path to the command we do it like: diff --git a/02-relocation-tmp-and-log-folder.patch b/02-relocation-tmp-and-log-folder.patch new file mode 100644 index 000000000000..153d8e5bb58f --- /dev/null +++ b/02-relocation-tmp-and-log-folder.patch @@ -0,0 +1,15 @@ +diff --git a/bin/htrace.sh b/bin/htrace.sh +index 125f078..549bdc5 100755 +--- a/bin/htrace.sh ++++ b/bin/htrace.sh +@@ -74,8 +74,8 @@ readonly _rel="${_init_directory}/.." + # shellcheck disable=SC2154 + readonly _src="${_rel}/src" + readonly _lib="${_rel}/lib" +-readonly _tmp="${_rel}/tmp" +-readonly _log="${_rel}/log" ++readonly _tmp="$(mktemp -d)" ++readonly _log="/tmp/htrace.sh-log" + + # shellcheck disable=SC1090 + source "${_src}/../config" diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b7985e4b63bf --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,54 @@ +# Maintainer: Hao Long <aur@esd.cc> + +pkgname=htrace.sh +pkgver=1.1.7 +pkgrel=1 +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' + 'nodejs-observatory-cli' + 'ssllabs-scan' + 'mixed-content-scan' + 'nmap' + 'subfinder' + 'wafw00f' + 'nghttp2') +source=("https://github.com/trimstray/htrace.sh/archive/v${pkgver}.tar.gz" + "01-rename-testssl.patch" + "02-relocation-tmp-and-log-folder.patch") +sha256sums=('727b684361d2cb88c605471f9d030e0f132d9d8bde7fb2734d8753b4e7cf73bc' + 'dd15bd186d5e32dc1d87997bde068d07fa32c61385466aeee0896c300d32071a' + '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" +} |