From ca1942ce71884ade26e688155d536a14d6e55ce8 Mon Sep 17 00:00:00 2001 From: dadevel Date: Mon, 24 Jun 2024 11:07:06 +0200 Subject: [PATCH] add typo3scan Closes #44. --- typo3scan/PKGBUILD | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 typo3scan/PKGBUILD diff --git a/typo3scan/PKGBUILD b/typo3scan/PKGBUILD new file mode 100644 index 00000000..7b9a3192 --- /dev/null +++ b/typo3scan/PKGBUILD @@ -0,0 +1,32 @@ +pkgname=typo3scan +pkgver=latest +pkgrel=1 +url="https://github.com/whoot/${pkgname}.git" +arch=(any) +license=(GPL2) +depends=(python) +source=("git+${url}") +sha256sums=(SKIP) + +package() { + cd "${srcdir}/${pkgname}" + mkdir -p "${pkgdir}"/opt/archpkgs/bin "${pkgdir}/opt/archpkgs/${pkgname}" + python -m venv "${pkgdir}/opt/archpkgs/${pkgname}" + declare -x VIRTUAL_ENV="${pkgdir}/opt/archpkgs/${pkgname}" PYTHONPATH="${pkgdir}/opt/archpkgs/${pkgname}" PATH="${pkgdir}/opt/archpkgs/${pkgname}/bin:$PATH" + pip install -r ./requirements.txt + python ./typo3scan.py --update + mkdir -p "${pkgdir}/opt/archpkgs/${pkgname}/${pkgname}" + cp -r ./typo3scan.py ./lib "${pkgdir}/opt/archpkgs/${pkgname}/${pkgname}" + cat << EOF > "${pkgdir}/opt/archpkgs/bin/${pkgname}" +#!/bin/sh +set -eu +export VIRTUAL_ENV=/opt/archpkgs/${pkgname} PYTHONPATH=/opt/archpkgs/${pkgname} PATH="/opt/archpkgs/${pkgname}/bin:\$PATH" +exec python /opt/archpkgs/${pkgname}/${pkgname}/typo3scan.py "\$@" +EOF + chmod +x "${pkgdir}/opt/archpkgs/bin/${pkgname}" +} + +pkgver() { + cd "${srcdir}/${pkgname}" + echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)" +}