]> git.madduck.net Git - code/molly-guard.git/blob - Makefile

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

factor out destination directories to Makefile
[code/molly-guard.git] / Makefile
1 prefix?=/usr/local
2 etc_prefix?=$(prefix)
3 DST=$(DEST)$(prefix)
4 ETCDIR=$(DEST)$(etc_prefix)/etc/molly-guard
5
6 all: molly-guard.8.gz shutdown
7
8 %.8: DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
9 %.8: XP=xsltproc -''-nonet
10 %.8: %.xml
11         $(XP) $(DB2MAN) $<
12
13 %.gz: %
14         gzip -9 $<
15
16 man: molly-guard.8
17         man -l $<
18 .PHONY: man
19
20 clean:
21         rm -f shutdown
22         rm -f molly-guard.8 molly-guard.8.gz
23 .PHONY: clean
24
25 shutdown: shutdown.in
26         sed -e 's,@ETC_PREFIX@,$(etc_prefix),g' $< > $@
27
28 install: shutdown molly-guard.8.gz
29         mkdir -m755 --parent $(DST)/share/molly-guard
30         install -m755 -oroot -oroot shutdown $(DST)/share/molly-guard
31
32         mkdir -m755 --parent $(DST)/sbin
33         ln -s ../share/molly-guard/shutdown $(DST)/sbin/poweroff
34         ln -s ../share/molly-guard/shutdown $(DST)/sbin/halt
35         ln -s ../share/molly-guard/shutdown $(DST)/sbin/reboot
36         ln -s ../share/molly-guard/shutdown $(DST)/sbin/shutdown
37
38         mkdir -m755 --parent $(ETCDIR)
39         install -m644 -oroot -oroot rc $(ETCDIR)
40         cp -r run.d $(ETCDIR) \
41           && chown root.root $(ETCDIR)/run.d && chmod 755 $(ETCDIR)/run.d
42
43         mkdir -m755 --parent $(ETCDIR)/messages.d
44
45         mkdir -m755 --parent $(DST)/share/man/man8
46         install -m644 -oroot -groot molly-guard.8.gz $(DST)/share/man/man8
47 .PHONY: install