29 lines
707 B
Makefile
29 lines
707 B
Makefile
NAME = "$(shell basename $PWD)"
|
|
VERSION = "$(shell git describe | sed 's/-/./g' || echo '0.1.0')"
|
|
BRANCH = "$(shell git branch --show-current)"
|
|
|
|
RPM_SOURCEDIR = "$(shell rpm --eval '%{_sourcedir}')
|
|
RPM_SYSCONFDIR = "$(shell rpm --eval '%{_sysconfdir}')"
|
|
|
|
.PHONY: name
|
|
name:
|
|
@echo "$(NAME)"
|
|
|
|
.PHONY: version
|
|
version:
|
|
@echo "$(VERSION)"
|
|
|
|
$(RPMSOURCE_DIR)/$(NAME)-%.tar.gz: *
|
|
git archive --format=tar.gz \
|
|
--output="$@" \
|
|
--prefix="$(NAME)-$(VERSION)/" \
|
|
--verbose \
|
|
"$(BRANCH)"
|
|
|
|
.PHONY: tarball
|
|
tarball: $(RPM_SOURCEDIR)/$(NAME)-$(VERSION).tar.gz
|
|
|
|
.PHONY: install
|
|
install:
|
|
install -m 644 --target-directory=$(DESTDIR)/$(RPM_SYSCONFDIR)/nginx nginx.conf
|