summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e781c011eced952bdeecafefa15eb85e19c6cff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: Oliwier <szerwigi14@gmail.com>
pkgname=brokefetch-git
pkgver=2025.09.14.rc40647b
pkgrel=1
pkgdesc="brokefetch is the only system info tool that doesn't pretend your life is okay. (git version)"
arch=('any')
url="https://github.com/Szerwigi1410/brokefetch"
license=('MIT')
depends=('bash')
source=("$pkgname::git+$url")
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/$pkgname"
    local hash date
    hash=$(git rev-parse --short HEAD)
    date=$(git log -1 --format=%cd --date=format:'%Y.%m.%d')
    echo "${date}.r${hash}"
}

prepare() {
    echo "๐Ÿงน Preparing brokefetch script..."
    cp "$srcdir/$pkgname/brokefetch.sh" "$srcdir/"
}

package() {
    echo "๐Ÿ“ฆ Installing brokefetch..."
    install -Dm755 "$srcdir/brokefetch.sh" "$pkgdir/usr/bin/brokefetch"
}

clean() {
    echo "๐Ÿ’ฃ Nuking old build artifacts..."
    rm -f "$PWD"/*.pkg.tar.* "$PWD"/*.log
}

post_install() {
    echo "โ™ป๏ธ Removing any old system binary..."
    if [[ -f /usr/bin/brokefetch ]]; then
        rm -f /usr/bin/brokefetch
    fi
}

post_upgrade() {
    echo "๐Ÿ”„ Updating... removing outdated brokefetch..."
    if [[ -f /usr/bin/brokefetch ]]; then
        rm -f /usr/bin/brokefetch
    fi
}