Add a Makefile (dist, rpm, clean).

This commit is contained in:
Doncho N. Gunchev 2024-02-21 13:49:59 +02:00
parent 6d196f9627
commit 82b91c2bf0
Signed by: dgunchev
GPG key ID: D30FD19F37E002A9

33
Makefile Normal file
View file

@ -0,0 +1,33 @@
SHELL:=/bin/bash # Use bash syntax, mitigates dash's printf on Debian
ver:=$(shell git describe --tags --always --match='v[0-9]*.[0-9]*' | cut -c 2-)
help:
@echo
@echo "▍Help"
@echo "▀▀▀▀▀▀"
@echo
@echo "Available targets:"
@echo " dist: create source distribution package in dist/"
@echo " rpm: create an RPM package"
@echo
@echo " clean: clean all generated files"
@echo
@echo "Version $(ver)."
.PHONY: help
.PHONY: dist
dist:
test -d dist || mkdir dist
git archive --prefix="profile.d-$(ver)/" HEAD | xz -9v > "dist/profile.d-$(ver).tar.xz"
.PHONY: rpm
rpm: dist
rpmbuild -ta "dist/profile.d-$(ver).tar.xz"
.PHONY: clean
clean:
rm -rf dist