makedeb


rsfetch-git 16c2e1db2021.01.21-2


Fast 5ms execution time and somewhat minimal fetch program written in Rust

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for rsfetch-git.

# Maintainer: only_vip <onlyme_vip@protonmail.com>
pkgname=rsfetch-git
pkgver=16c2e1db2021.01.21
pkgrel=2
pkgdesc="Fast 5ms execution time and somewhat minimal fetch program written in Rust"
url="https://github.com/rsfetch/rsfetch"
license=('MIT')
depends=()
provides=('rsfetch')
conflicts=('rsfetch')
makedepends=('rustc' 'cargo' 'libssl-dev')
arch=("amd64")
source=("${pkgname}::git+https://github.com/rsfetch/rsfetch#branch=master")
sha512sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"
    _always=$(git describe --always | sed -e 's:-:.:g' -e 's:v::') # always is mobile, and switches between numbers and letters, can't use it for versioning
    _commits=$(git rev-list --count HEAD | sed 's:-:.:g') # total commits is the most sane way of getting incremental pkgver
    _date=$(git log -1 --date=short --pretty=format:%cd)
    printf "%s%s%s\n" "${_commits}" "${_always}" "${_date}" | sed -e 's:-:.:g'  -e 's:_:.:g'
}

package() {
	cd "${srcdir}/${pkgname}"
    make  build
	mkdir -p ${pkgdir}/usr/bin
	mkdir -p ${pkgdir}/usr/share/licenses/${pkgname}
	install -Dm 755 ${srcdir}/${pkgname}/target/release/rsfetch ${pkgdir}/usr/bin/rsfetch
	install -Dm 644 ${srcdir}/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}