mirror of
https://github.com/gwebu-team/profile.d.git
synced 2025-12-11 12:15:47 +00:00
General rework of the build process (distribution source and rpm).
This commit is contained in:
parent
e68638230a
commit
5b8a75b75c
6 changed files with 55 additions and 21 deletions
24
Makefile
24
Makefile
|
|
@ -1,5 +1,8 @@
|
|||
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- | cut -d - -f 1)
|
||||
ver:=$(shell git describe --dirty --long --match='v[0-9]*.[0-9]*' | cut -c 2- | cut -d - -f 1,2,4)
|
||||
rpm_ver:=$(firstword $(subst -, ,$(ver)))
|
||||
rpm_rev:=$(subst $(rpm_ver)-,,$(ver))
|
||||
rpm_rev:=$(subst -,_,$(rpm_rev))
|
||||
|
||||
|
||||
help:
|
||||
|
|
@ -10,17 +13,25 @@ help:
|
|||
@echo "Available targets:"
|
||||
@echo " dist: create source distribution package in dist/"
|
||||
@echo " rpm: create an RPM package"
|
||||
@echo " changelog: Add a changelog entry to gwebu-profile.spec.in"
|
||||
@echo
|
||||
@echo " clean: clean all generated files"
|
||||
@echo
|
||||
@echo "Version $(ver)."
|
||||
@echo "Version $(ver), rpm_ver=$(rpm_ver), rpm_rev=$(rpm_rev)."
|
||||
.PHONY: help
|
||||
|
||||
|
||||
.PHONY: dist
|
||||
dist:
|
||||
dist: dist/profile.d-$(ver).tar.xz
|
||||
|
||||
|
||||
dist/profile.d-$(ver).tar.xz:
|
||||
test -d dist || mkdir dist
|
||||
git archive --prefix="profile.d-$(ver)/" HEAD | xz -9v > "dist/profile.d-$(ver).tar.xz"
|
||||
sed 's/^Version: .*/Version: $(rpm_ver)/' < gwebu-profile.spec.in \
|
||||
| sed 's/^Release: .*/Release: $(rpm_rev)/' \
|
||||
> gwebu-profile.spec
|
||||
git archive --prefix="profile.d-$(ver)/" --add-file=gwebu-profile.spec HEAD | xz -9 > "$@"
|
||||
rm gwebu-profile.spec
|
||||
|
||||
|
||||
.PHONY: rpm
|
||||
|
|
@ -28,6 +39,11 @@ rpm: dist
|
|||
rpmbuild -ta "dist/profile.d-$(ver).tar.xz"
|
||||
|
||||
|
||||
.PHONY: changelog
|
||||
changelog:
|
||||
./changelog.sh
|
||||
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf dist
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue