add Makefile and update PKGBUILD
This commit is contained in:
parent
3a1873a747
commit
11c3a3d536
31
Makefile
Normal file
31
Makefile
Normal file
@ -0,0 +1,31 @@
|
||||
.PHONY: all build install clean uninstall
|
||||
|
||||
BINARY_NAME=gogofetch
|
||||
PREFIX?=/usr
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
@echo "Building $(BINARY_NAME)..."
|
||||
@go build -ldflags="-s -w" -o $(BINARY_NAME) ./src
|
||||
@echo "Build completed successfully."
|
||||
|
||||
install:
|
||||
@if [ "$$(id -u)" -ne 0 ] && [ -z "$(DESTDIR)" ]; then \
|
||||
echo "Error: root privileges required. Run with sudo."; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "Installing $(BINARY_NAME) to $(PREFIX)/bin..."
|
||||
install -Dm755 $(BINARY_NAME) $(DESTDIR)$(PREFIX)/bin/$(BINARY_NAME)
|
||||
install -d $(DESTDIR)$(PREFIX)/share/gogofetch/logos
|
||||
cp -v logos/*.png $(DESTDIR)$(PREFIX)/share/gogofetch/logos/
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/share/gogofetch/logos
|
||||
chmod 644 $(DESTDIR)$(PREFIX)/share/gogofetch/logos/*.png
|
||||
|
||||
clean:
|
||||
rm -f $(BINARY_NAME)
|
||||
|
||||
uninstall:
|
||||
@echo "Uninstalling $(BINARY_NAME) from $(PREFIX)/bin..."
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/$(BINARY_NAME)
|
||||
rm -rf $(DESTDIR)$(PREFIX)/share/gogofetch
|
||||
31
PKGBUILD
31
PKGBUILD
@ -1,15 +1,13 @@
|
||||
# Maintainer: Mykhailo Aleksieiev <nekohepott@larpdhq.org>
|
||||
# Maintainer: Mykhailo Aleksieiev <mishanya.bigimot@gmail.com>
|
||||
pkgname=gogofetch-git
|
||||
pkgver=r72.51d32b6
|
||||
pkgrel=1
|
||||
pkgdesc="Fetch written in Go with image support"
|
||||
arch=('x86_64')
|
||||
url="https://codeberg.org/nekohepott/goGoFetch.git"
|
||||
url="https://codeberg.org/nekohepott/goGoFetch"
|
||||
license=('MIT')
|
||||
depends=('glibc' 'chafa')
|
||||
makedepends=('git' 'go')
|
||||
checkdepends=()
|
||||
optdepends=()
|
||||
provides=("gogofetch")
|
||||
conflicts=("gogofetch")
|
||||
source=("git+https://codeberg.org/nekohepott/goGoFetch.git")
|
||||
@ -17,33 +15,16 @@ sha256sums=('SKIP')
|
||||
|
||||
pkgver() {
|
||||
cd "goGoFetch"
|
||||
# мелви я твой рот ебал ты ж сто проц увидишь что я навайбкодил пкгбилд потом начнёшь клеветать меня в чате💀💀💀
|
||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "goGoFetch"
|
||||
git describe --long --tags | sed 's/\([^-]*-\)g/r\1/;s/-/./g'
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "goGoFetch"
|
||||
go build -o "gogofetch" ./src
|
||||
export GOPATH="$srcdir/gopath"
|
||||
make build
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/goGoFetch"
|
||||
|
||||
install -Dm755 "gogofetch" "$pkgdir/usr/bin/gogofetch"
|
||||
|
||||
install -d "$pkgdir/usr/share/gogofetch/logos"
|
||||
|
||||
cp -v logos/*.png "$pkgdir/usr/share/gogofetch/logos/"
|
||||
|
||||
chmod 755 "$pkgdir/usr/share/gogofetch/logos"
|
||||
chmod 644 "$pkgdir/usr/share/gogofetch/logos/"*.png
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
echo "! It is recommended to run 'gogofetch --reset-config' after upgrading gogofetch-git to get the latest config."
|
||||
cd "goGoFetch"
|
||||
make DESTDIR="$pkgdir" PREFIX="/usr" install
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user