summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:27:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:27:32 +0000
commitd3a5973363d48e715eb586b390f9340787b9193c (patch)
tree07754e1307d9f8f9540b3eede439bdbe27401cb2 /Makefile
parentInitial commit. (diff)
downloadmolly-guard-d3a5973363d48e715eb586b390f9340787b9193c.tar.xz
molly-guard-d3a5973363d48e715eb586b390f9340787b9193c.zip
Adding upstream version 0.7.2.upstream/0.7.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..67f0b05
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,49 @@
+PREFIX?=/usr
+cfgdir?=/etc/molly-guard
+libdir?=/lib
+sbindir?=/sbin
+REALPATH?=$(libdir)/molly-guard
+
+all: molly-guard.8 shutdown
+
+%.8: DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
+%.8: XP=xsltproc -''-nonet
+%.8: %.xml
+ $(XP) $(DB2MAN) $<
+
+man: molly-guard.8
+ man -l $<
+.PHONY: man
+
+clean:
+ rm -f shutdown
+ rm -f molly-guard.8
+.PHONY: clean
+
+shutdown: shutdown.in
+ sed -e 's,@cfgdir@,$(cfgdir),g;s,@REALPATH@,$(REALPATH),g' $< > $@
+
+install: shutdown molly-guard.8
+ mkdir -m755 --parent $(DESTDIR)$(libdir)/molly-guard
+ install -m755 -oroot -oroot shutdown $(DESTDIR)$(libdir)/molly-guard/molly-guard
+
+ mkdir -m755 --parent $(DESTDIR)$(sbindir)
+ ln -s $(libdir)/molly-guard/molly-guard $(DESTDIR)$(sbindir)/poweroff
+ ln -s $(libdir)/molly-guard/molly-guard $(DESTDIR)$(sbindir)/halt
+ ln -s $(libdir)/molly-guard/molly-guard $(DESTDIR)$(sbindir)/reboot
+ ln -s $(libdir)/molly-guard/molly-guard $(DESTDIR)$(sbindir)/shutdown
+ ln -s $(libdir)/molly-guard/molly-guard $(DESTDIR)$(sbindir)/coldreboot
+ ln -s $(libdir)/molly-guard/molly-guard $(DESTDIR)$(sbindir)/pm-hibernate
+ ln -s $(libdir)/molly-guard/molly-guard $(DESTDIR)$(sbindir)/pm-suspend
+ ln -s $(libdir)/molly-guard/molly-guard $(DESTDIR)$(sbindir)/pm-suspend-hybrid
+
+ mkdir -m755 --parent $(DESTDIR)$(cfgdir)
+ install -m644 -oroot -oroot rc $(DESTDIR)$(cfgdir)
+ cp -r run.d $(DESTDIR)$(cfgdir) \
+ && chown root.root $(DESTDIR)$(cfgdir)/run.d && chmod 755 $(DESTDIR)$(cfgdir)/run.d
+
+ mkdir -m755 --parent $(DESTDIR)$(cfgdir)/messages.d
+
+ mkdir -m755 --parent $(DESTDIR)$(PREFIX)/share/man/man8
+ install -m644 -oroot -groot molly-guard.8 $(DESTDIR)$(PREFIX)/share/man/man8
+.PHONY: install