makedeb


tokei-bin 12.1.2-1


Count your code, quickly.

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for tokei-bin.

# vim: ft=sh syntax=sh softtabstop=2 tabstop=2 shiftwidth=2 fenc=utf-8 expandtab
# Maintainer: alfador <the.alfador@pm.me>

_github_repo="XAMPPRocky/tokei"
_pkgname="$(basename "${_github_repo}")"

pkgname="${_pkgname}-bin"
# shellcheck disable=SC2034
pkgver="12.1.2"
# shellcheck disable=SC2034
pkgrel=1
# shellcheck disable=SC2034
pkgdesc="Count your code, quickly."
# shellcheck disable=SC2034
arch=('i686' 'x86_64' 'aarch64' 'arm' 'armv7h')
# shellcheck disable=SC2034
provides=("${_pkgname}" "${_pkgname}-bin")
# shellcheck disable=SC2034
conflicts=("${_pkgname}" "${_pkgname}-git" "${_pkgname}-bin")
# shellcheck disable=SC2034
url="https://github.com/${_github_repo}"
# shellcheck disable=SC2034
license=("MIT" "apache")
# shellcheck disable=SC2034
makedepends=("curl" "jq")
# shellcheck disable=SC2034
source=("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")
# shellcheck disable=SC2034
source_i686=("${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-musl.tar.gz")
# shellcheck disable=SC2034
source_x86_64=("${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-musl.tar.gz")
# shellcheck disable=SC2034
source_aarch64=("${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-gnu.tar.gz")
# shellcheck disable=SC2034
source_arm=("${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-gnueabi.tar.gz")
# shellcheck disable=SC2034
source_armv7h=("${pkgname}-${pkgver}.tar.gz::${url}/releases/download/v${pkgver}/${_pkgname}-${CARCH}-unknown-linux-gnueabihf.tar.gz")

# shellcheck disable=SC2034
sha512sums=("fc85b0fa18b3cc56e542b2d0901f37f5c4a2307e282c516f7a71bf8d557fa82ca1b8a09a8f9e0c043f9ddd3ed0553e731a93663a8a7148e8dc1ea90e9b5b7d02"
            "f0dc1210dee46c500d53ffad7e24534bb5f3904fb64c7d060b3e88a3a54ee6e4ca044bdc916110f933d2c5e91833c7b5e6263dff021ffc3d618146159a6807f0"
            "cba0ebe473f525dfd065cd3a5df3935bf5cb74f5140aa26b058cb3b21aa2e05e834eaafb185f6ae7e0d4f9de8bd1f467fc52b49f7109cee954bedd74fdb66e6b")
# shellcheck disable=SC2034
sha512sums_i686=("e1184beaf8d53beec016e3332012faf05334c2dd98ad6240cd5f652538bc77f5e3fa86befb51cf5a51d1707de9e0de2d09e069d9a6d8a79e17a5d7522dc0b5e0")
# shellcheck disable=SC2034
sha512sums_x86_64=("29132f3fbb473eaddb1068f5077af85c30c99cb086ad3b645f154f02115006897af2f8e0b75d0d1a55e610bb930daaf5bf831e282db590727e889269eda2b97e")
# shellcheck disable=SC2034
sha512sums_aarch64=("e9ed8da02d2a457a025afa041f5fa5ac39619dd940b583e6c642a600be5c525fda75b752719e2d6467300a755129ef92453820d4b77a868855a773ecdcf6f89c")
# shellcheck disable=SC2034
sha512sums_arm=("eff843773788b3d43a26388b0a59d52355d38e86226dd35d6df4f4b997a945c3ceef57112fc974be6573628f47f84f35fad7a549ae5fc76a7d47599aed22e99a")
# shellcheck disable=SC2034
sha512sums_armv7h=("064edf9e470cc9394ac4ef3f988cd5334036c596fc7b69e57e7ceec121eed2d676133057520a6ec7b06632e1cc719f1bbeb30d7c93815f371c3e6b9b154e4953")
# shellcheck disable=SC2034
options=(!strip)
pkgver() {
  curl \
    -sL "https://api.github.com/repos/${_github_repo}/releases/latest" |
    jq -r '.tag_name' |
    sed -e 's/v//g'
}
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"
}