35 lines
1014 B
Makefile
35 lines
1014 B
Makefile
NAME = $(shell basename $(PWD))
|
|
VERSION = $(shell git describe | sed 's/-/./g')
|
|
BRANCH = $(shell git branch --show-current)
|
|
|
|
RPM_SBINDIR = $(shell rpm --eval '%{_sbindir}')
|
|
RPM_SOURCEDIR = $(shell rpm --eval '%{_sourcedir}')
|
|
RPM_SYSCONFDIR = $(shell rpm --eval '%{_sysconfdir}')
|
|
RPM_UNITDIR = $(shell rpm --eval '%{_unitdir}')
|
|
RPM_TARBALL_PATH = $(RPM_SOURCEDIR)/$(NAME)-$(VERSION).tar.gz
|
|
|
|
.PHONY: name
|
|
name:
|
|
@echo "$(NAME)"
|
|
|
|
.PHONY: version
|
|
version:
|
|
@echo "$(VERSION)"
|
|
|
|
$(RPM_TARBALL_PATH): *
|
|
git archive --format=tar.gz \
|
|
--output="$@" \
|
|
--prefix="$(NAME)-$(VERSION)/" \
|
|
--verbose \
|
|
"$(BRANCH)"
|
|
|
|
.PHONY: tarball
|
|
tarball: $(RPM_TARBALL_PATH)
|
|
|
|
.PHONY: install
|
|
install:
|
|
install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d
|
|
install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d/ conf/security.conf
|
|
install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/certbot
|
|
install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/certbot/ conf/ovh.ini.tpl
|