2018-06-18 18:56:22 +00:00
|
|
|
NAME=lorax-templates-rhel
|
|
|
|
# RHEL version these templates are designed for
|
2021-05-10 14:52:28 +00:00
|
|
|
RHELVER=10.0
|
2024-02-21 19:21:08 +00:00
|
|
|
RHPKG=centpkg --release=c10s
|
2022-04-05 17:07:56 +00:00
|
|
|
|
2024-06-05 22:08:07 +00:00
|
|
|
# Previous release, override this when new commits are already on c10s
|
|
|
|
PREV ?= origin/c10s
|
|
|
|
|
2022-04-05 17:07:56 +00:00
|
|
|
# git user.email and user.name must be setup
|
|
|
|
GITEMAIL := $(shell git config user.email)
|
|
|
|
GITNAME := $(shell git config user.name)
|
|
|
|
|
2018-06-18 18:56:22 +00:00
|
|
|
# Serial number for this release
|
|
|
|
SERIAL=$(shell [ -f SERIAL ] && cat SERIAL || echo 0)
|
|
|
|
|
|
|
|
SPEC=${NAME}.spec
|
|
|
|
TARBALL=${NAME}-${RHELVER}-${SERIAL}.tar.gz
|
|
|
|
|
|
|
|
tar: ${TARBALL}
|
|
|
|
|
|
|
|
${TARBALL}: 80-rhel
|
|
|
|
git archive --prefix='${NAME}-${RHELVER}/' HEAD $</ | gzip -c9 > $@
|
|
|
|
|
|
|
|
bump: bump-serial
|
|
|
|
|
|
|
|
bump-serial:
|
|
|
|
echo $$((${SERIAL}+1)) > SERIAL
|
|
|
|
git add SERIAL
|
|
|
|
|
2022-04-05 17:07:56 +00:00
|
|
|
update-spec: clog
|
2018-06-18 18:56:22 +00:00
|
|
|
sed -r -i \
|
|
|
|
-e 's/^(Release:\s+)[^%]+(%.*)$$/\1${SERIAL}\2/' \
|
|
|
|
-e 's/^(Version:\s+).*$$/\1${RHELVER}/' \
|
|
|
|
-e 's/^(Source0:\s+).*$$/\1${TARBALL}/' \
|
2022-04-05 17:07:56 +00:00
|
|
|
-e '/%changelog/ r clog-spec' \
|
2018-06-18 18:56:22 +00:00
|
|
|
${SPEC}
|
|
|
|
|
2022-04-05 17:07:56 +00:00
|
|
|
clog:
|
|
|
|
@echo "* $(shell date '+%a %b %d %Y') ${GITNAME} <${GITEMAIL}> - ${RHELVER}-${SERIAL}" > clog-spec
|
2024-06-05 22:08:07 +00:00
|
|
|
./tools/git-changelog -t ${PREV} > clog
|
2022-04-05 17:07:56 +00:00
|
|
|
cat clog >> clog-spec
|
|
|
|
|
|
|
|
# These need to rerun make to pick up the bumped serial number
|
|
|
|
release:
|
|
|
|
$(MAKE) bump-serial && $(MAKE) tar && $(MAKE) update-spec && $(MAKE) commit
|
|
|
|
|
2022-04-07 14:45:10 +00:00
|
|
|
release-merge:
|
|
|
|
$(MAKE) bump-serial && $(MAKE) tar && $(MAKE) update-spec && $(MAKE) amend
|
|
|
|
|
|
|
|
|
2022-04-05 17:07:56 +00:00
|
|
|
commit:
|
|
|
|
$(RHPKG) new-sources ${TARBALL}
|
|
|
|
git add -u
|
|
|
|
git commit -F clog
|
2018-06-18 18:56:22 +00:00
|
|
|
|
2022-04-07 14:45:10 +00:00
|
|
|
amend:
|
|
|
|
$(RHPKG) new-sources ${TARBALL}
|
|
|
|
git add -u
|
|
|
|
git commit --amend
|
|
|
|
|
|
|
|
|
2022-04-05 17:07:56 +00:00
|
|
|
.PHONY: tar ${TARBALL} bump-serial update-spec release clog commit
|