Compare commits

8 Commits

Author SHA1 Message Date
ba6e4c9e38 Add --force to cerbot link 2025-12-31 16:54:10 +01:00
2161cac791 Fix makefile typo 2025-12-31 16:48:37 +01:00
41afd81c9b Add missing directory on install 2025-12-31 16:47:49 +01:00
51d17d5f25 Fix typo 2025-12-31 16:45:30 +01:00
8c6f87c3b8 Fix Makefile typo 2025-12-31 16:42:54 +01:00
bfc50470cd Fix makefile fuction 2025-12-31 16:37:13 +01:00
abc10cd4b8 Fix makefile function typo 2025-12-31 16:34:15 +01:00
d65e94be20 Fix makefile variables 2025-12-31 16:32:04 +01:00
2 changed files with 12 additions and 10 deletions

View File

@@ -2,9 +2,10 @@ NAME = $(shell basename $(PWD))
VERSION = $(shell git describe | sed 's/-/./g') VERSION = $(shell git describe | sed 's/-/./g')
BRANCH = $(shell git branch --show-current) BRANCH = $(shell git branch --show-current)
define rpm_eval RPM_SOURCEDIR = $(shell rpm --eval '%{_sourcedir}')
shell rpm --eval '%{$(1)}' RPM_SYSCONFDIR = $(shell rpm --eval '%{_sysconfdir}')
endef RPM_UNITDIR = $(shell rpm --eval '%{_unitdir}')
RPM_TARBALL_PATH = $(RPM_SOURCEDIR)/$(NAME)-$(VERSION).tar.gz
.PHONY: name .PHONY: name
name: name:
@@ -14,7 +15,7 @@ name:
version: version:
@echo "$(VERSION)" @echo "$(VERSION)"
$(RPM_SOURCEDIR)/$(NAME)-%.tar.gz: * $(RPM_TARBALL_PATH): *
git archive --format=tar.gz \ git archive --format=tar.gz \
--output="$@" \ --output="$@" \
--prefix="$(NAME)-$(VERSION)/" \ --prefix="$(NAME)-$(VERSION)/" \
@@ -22,11 +23,12 @@ $(RPM_SOURCEDIR)/$(NAME)-%.tar.gz: *
"$(BRANCH)" "$(BRANCH)"
.PHONY: tarball .PHONY: tarball
tarball: $(RPM_SOURCEDIR)/$(NAME)-$(VERSION).tar.gz tarball: $(RPM_TARBALL_PATH)
.PHONY: install .PHONY: install
install: install:
install --directory $(DESTDIR)$(call rpm_eval _sysconfdir)/netoik-rp install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/netoik-rp
install --target-directory=$(DESTDIR)$(call rpm_eval _sysconfdir)/netoik-rp/ conf/neotik-rp.conf install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/netoik-rp/ conf/netoik-rp.conf
install --target-directory=$(DESTDIR)$(call rpm_eval _sysconfdir)/netoik-rp/ conf/ovh.ini install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/netoik-rp/ conf/ovh.ini
install --target-directory=$(DESTDIR)$(call rpm_eval _unitdir)/ services/netoik-rp.service install --directory $(DESTDIR)$(RPM_UNITDIR)
install --target-directory=$(DESTDIR)$(RPM_UNITDIR)/ services/netoik-rp.service

View File

@@ -30,7 +30,7 @@ if [ $1 == 1 ]; then
# Create virutal env with certbot cli # Create virutal env with certbot cli
%{_bindir}/env python3 -m venv /opt/certbot %{_bindir}/env python3 -m venv /opt/certbot
/opt/certbot/bin/pip install --upgrade pip certbot certbot-dns-ovh /opt/certbot/bin/pip install --upgrade pip certbot certbot-dns-ovh
%{_bindir}/env ln --symbolic --target-directory %{_sbindir} /opt/certbot/bin/certbot %{_bindir}/env ln --symbolic --force -q-target-directory %{_sbindir} /opt/certbot/bin/certbot
%{_bindir}/env certbot certonly --dns-ovh --dns-ovh-credentials "%{_sysconfdir}/%{name}/ovh.ini" -d "*.netoik.io" -d "*.samuel-campos.fr" %{_bindir}/env certbot certonly --dns-ovh --dns-ovh-credentials "%{_sysconfdir}/%{name}/ovh.ini" -d "*.netoik.io" -d "*.samuel-campos.fr"
%{_bindir}/env printf "\nAutomatic certbot renew\n0 12 * * * root sleep $((RANDOM % 3600)) && certbot renew -q\n" >> %{_sysconfdir}/crontab %{_bindir}/env printf "\nAutomatic certbot renew\n0 12 * * * root sleep $((RANDOM % 3600)) && certbot renew -q\n" >> %{_sysconfdir}/crontab
fi fi