tokei-bin/PKGBUILD
2023-03-24 14:28:44 -06:00

95 lines
4.5 KiB
Bash

# vim: ft=sh syntax=sh softtabstop=2 tabstop=2 shiftwidth=2 fenc=utf-8 expandtab
# Maintainer: Jonathan Apodaca <jrapodaca@gmail.com>
_github_repo="XAMPPRocky/tokei"
_pkgname="$(basename "${_github_repo}")"
pkgname="${_pkgname}-bin"
pkgver="12.1.2"
pkgrel=1
pkgdesc="Count your code, quickly."
arch=('i686' 'amd64' 'aarch64' 'arm' 'armv7h')
provides=("${_pkgname}" "${_pkgname}-bin")
conflicts=("${_pkgname}" "${_pkgname}-git" "${_pkgname}-bin")
url="https://github.com/${_github_repo}"
license=("MIT" "apache")
source_i686=(
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/README.md"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-APACHE"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-MIT"
"${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-musl.tar.gz"
)
source_amd64=(
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/README.md"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-APACHE"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-MIT"
"${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-musl.tar.gz"
)
source_aarch64=(
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/README.md"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-APACHE"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-MIT"
"${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-gnu.tar.gz"
)
source_arm=(
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/README.md"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-APACHE"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-MIT"
"${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-gnueabi.tar.gz"
)
source_armv7h=(
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/README.md"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-APACHE"
"https://raw.githubusercontent.com/${_github_repo}/v${pkgver}/LICENCE-MIT"
"${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-gnueabihf.tar.gz"
)
sha512sums_i686=(
SKIP
SKIP
SKIP
"e1184beaf8d53beec016e3332012faf05334c2dd98ad6240cd5f652538bc77f5e3fa86befb51cf5a51d1707de9e0de2d09e069d9a6d8a79e17a5d7522dc0b5e0"
)
sha512sums_amd64=(
SKIP
SKIP
SKIP
"29132f3fbb473eaddb1068f5077af85c30c99cb086ad3b645f154f02115006897af2f8e0b75d0d1a55e610bb930daaf5bf831e282db590727e889269eda2b97e"
)
sha512sums_aarch64=(
SKIP
SKIP
SKIP
"e9ed8da02d2a457a025afa041f5fa5ac39619dd940b583e6c642a600be5c525fda75b752719e2d6467300a755129ef92453820d4b77a868855a773ecdcf6f89c"
)
sha512sums_arm=(
SKIP
SKIP
SKIP
"eff843773788b3d43a26388b0a59d52355d38e86226dd35d6df4f4b997a945c3ceef57112fc974be6573628f47f84f35fad7a549ae5fc76a7d47599aed22e99a"
)
sha512sums_armv7h=(
SKIP
SKIP
SKIP
"064edf9e470cc9394ac4ef3f988cd5334036c596fc7b69e57e7ceec121eed2d676133057520a6ec7b06632e1cc719f1bbeb30d7c93815f371c3e6b9b154e4953"
)
options=(!strip)
check() {
[ "$("${srcdir}/${_pkgname}" --version | grep -Po '\d+(.\d+)*')" != "${pkgver}" ] \
&& return 1 \
|| return 0
}
package() {
# ─── BINARY ─────────────────────────────────────────────────────────────────────
install -Dm755 "${srcdir}/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
# ─── README AND MAN PAGES ───────────────────────────────────────────────────────
install -Dm644 "${srcdir}/README.md" "${pkgdir}/usr/share/doc/${_pkgname}/README.md"
# ─── LICENSES ───────────────────────────────────────────────────────────────────
# [ NOTE ] => since there are two Licences, decided to choose MIT for the 'copyright' file.
install -Dm644 "${srcdir}/LICENCE-MIT" "${pkgdir}/usr/share/doc/${_pkgname}/copyright"
install -Dm644 "${srcdir}/LICENCE-MIT" "${pkgdir}/usr/share/doc/${_pkgname}/LICENCE-MIT"
install -Dm644 "${srcdir}/LICENCE-APACHE" "${pkgdir}/usr/share/doc/${_pkgname}/LICENCE-APACHE"
}