36 lines
1.3 KiB
Makefile
36 lines
1.3 KiB
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 $(DESTDIR)$(RPM_SYSCONFDIR)/certbot $(DESTDIR)$(RPM_UNITDIR) $(DESTDIR)$(RPM_SBINDIR)
|
|
install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/nginx/conf.d conf/nginx/0_security.conf conf/nginx/default.conf
|
|
install --mode=600 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/certbot conf/certbot/ovh.ini
|
|
install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR) conf/systemd/certbot-renew.service conf/systemd/certbot-renew.timer
|
|
install --mode=755 --target-directory=$(DESTDIR)$(RPM_SBINDIR) conf/sbin/certbot_renew
|