Add potentially functional feature to Makefile allowing me to create pkgbuilds with a single command

This commit is contained in:
speedie 2023-03-07 20:33:24 +01:00
parent 7b5f582902
commit 27b9ca1cd8
2 changed files with 14 additions and 4 deletions

View file

@ -66,6 +66,7 @@ help:
@echo clean: Removes objects and tarballs.
@echo man: Generate man page for spmenu
@echo compat: Installs compatibility with dmenu. WARNING: This will overwrite dmenu and dmenu_run
@echo pkg_arch: Creates an Arch package based on the PKGBUILD
@echo help: Displays this help sheet.
man:
@ -74,4 +75,14 @@ man:
pandoc --standalone --to man .man.md -o spmenu.1
rm -f .man.md
.PHONY: all options clean dist install uninstall help man
pkg_arch: dist
command -v makepkg > /dev/null || exit 1
[ -f PKGBUILD ] && mkdir -p source && cp PKGBUILD *.tar.gz source/ || exit 1
cd source/
@SUM=$$(md5sum *.tar.gz | awk '{ print $1 }')
sed -i "s/VERSION/$(VERSION)/g; s/MD5SUM/$${SUM}/g" PKGBUILD
makepkg -sfr --sign && cp *zst* ../
cd ..
rm -rf source/
.PHONY: all options clean dist install uninstall pkg_arch help man

View file

@ -1,7 +1,7 @@
# Maintainer: speedie <speedie.alt@gmail.com>
pkgname=spmenu
pkgver=0.2.1
pkgver=VERSION
pkgrel=1
pkgdesc="speedie's fork of suckless dmenu with color support and more"
url="https://git.speedie/gq/spmenu"
@ -13,10 +13,9 @@ provides=($pkgname)
conflicts=($pkgname)
source=(
"$pkgname-$pkgver.tar.gz"
#"https://ls.speedie.gq/releases/$pkgname/$pkgname-$pkgver.tar.gz"
)
md5sums=(98fa925eaa64a2096ab892a8216f5334)
md5sums=(MD5SUM)
build(){
cd $pkgname-$pkgver