78 lines
2.6 KiB
Makefile
78 lines
2.6 KiB
Makefile
# petrified - a bash client to update dynamic DNS at freedns.afraid.org
|
|
|
|
VERSION := $(shell grep '^\#\# Version:' petrified | cut -d' ' -f3)
|
|
|
|
PREFIX ?= /usr/local
|
|
BINPREFIX ?= $(PREFIX)/bin
|
|
LIBPREFIX ?= $(PREFIX)/lib
|
|
MANPREFIX ?= $(PREFIX)/share/man
|
|
DOCPREFIX ?= $(PREFIX)/share/doc
|
|
ETCPREFIX ?= /etc
|
|
VARPREFIX ?= /var
|
|
DESTDIR ?=
|
|
|
|
MANPAGES = \
|
|
petrified.1
|
|
|
|
all: doc
|
|
|
|
doc: $(MANPAGES)
|
|
petrified.1: README.pod
|
|
pod2man -s 1 -c "Petrified Manual" -n "PETRIFIED" \
|
|
-r "petrified $(VERSION)" $< $@
|
|
|
|
install: all install-main install-doc
|
|
uninstall: uninstall-main uninstall-doc
|
|
|
|
install-main:
|
|
install -Dm0755 petrified "$(DESTDIR)$(BINPREFIX)/petrified"
|
|
install -Dm0644 petrified.1 "$(DESTDIR)$(MANPREFIX)/man1/petrified.1"
|
|
install -Dm0600 petrified.conf "$(DESTDIR)$(ETCPREFIX)/petrified.conf"
|
|
install -dm0755 "$(DESTDIR)$(VARPREFIX)/cache/petrified"
|
|
|
|
install-doc:
|
|
install -dm0755 "$(DESTDIR)$(DOCPREFIX)/petrified/extra"
|
|
install -Dm0644 README.pod LICENSE "$(DESTDIR)$(DOCPREFIX)/petrified"
|
|
install -Dm0644 extra/petrified.crontab extra/petrified.dispatch \
|
|
extra/petrified.logrotate "$(DESTDIR)$(DOCPREFIX)/petrified/extra"
|
|
|
|
install-systemd:
|
|
install -dm0755 "$(DESTDIR)$(LIBPREFIX)/systemd/system"
|
|
install -Dm0644 systemd/system/petrified.target \
|
|
systemd/system/petrified.timer \
|
|
systemd/system/petrified.service \
|
|
"$(DESTDIR)$(LIBPREFIX)/systemd/system"
|
|
install -dm0755 "$(DESTDIR)$(LIBPREFIX)/systemd/user"
|
|
install -Dm0644 systemd/user/petrified.target \
|
|
systemd/user/petrified.timer \
|
|
systemd/user/petrified.service \
|
|
"$(DESTDIR)$(LIBPREFIX)/systemd/user"
|
|
|
|
uninstall-main:
|
|
$(RM) "$(DESTDIR)$(BINPREFIX)/petrified" \
|
|
"$(DESTDIR)$(MANPREFIX)/man1/petrified.1" \
|
|
"$(DESTDIR)$(ETCPREFIX)/petrified.conf"
|
|
rmdir "$(DESTDIR)$(VARPREFIX)/cache/petrified"
|
|
|
|
uninstall-doc:
|
|
$(RM) "$(DESTDIR)$(DOCPREFIX)/petrified/README.pod" \
|
|
"$(DESTDIR)$(DOCPREFIX)/petrified/LICENSE" \
|
|
"$(DESTDIR)$(DOCPREFIX)/petrified/extra/petrified.crontab" \
|
|
"$(DESTDIR)$(DOCPREFIX)/petrified/extra/petrified.dispatch" \
|
|
"$(DESTDIR)$(DOCPREFIX)/petrified/extra/petrified.logrotate"
|
|
rmdir "$(DESTDIR)$(DOCPREFIX)/petrified/extra" \
|
|
"$(DESTDIR)$(DOCPREFIX)/petrified" \
|
|
|
|
uninstall-systemd:
|
|
$(RM) "$(DESTDIR)$(LIBPREFIX)/systemd/system/petrified.target" \
|
|
"$(DESTDIR)$(LIBPREFIX)/systemd/system/petrified.timer" \
|
|
"$(DESTDIR)$(LIBPREFIX)/systemd/system/petrified@.service"
|
|
$(RM) "$(DESTDIR)$(LIBPREFIX)/systemd/user/petrified.target" \
|
|
"$(DESTDIR)$(LIBPREFIX)/systemd/user/petrified.timer" \
|
|
"$(DESTDIR)$(LIBPREFIX)/systemd/user/petrified@.service"
|
|
|
|
clean:
|
|
$(RM) $(MANPAGES)
|
|
|
|
.PHONY: clean doc install uninstall
|
|
|