# Makefile (projects/tools) for installing scripts into /usr/local/bin DEST = /usr/local/bin INSTALL_SUDO = install --mode=440 --preserve-timestamps $(INSTALL_OPTS) '$<' $@ SCRIPT_MODE=555 .PHONY: install install_scripts install: install_scripts /usr/local/bin/README.txt install_scripts: install --mode=$(SCRIPT_MODE) --group=adm --preserve-timestamps $(INSTALL_OPTS) \ rcontrol $(DEST) for cmd in rshutdown rreboot rpoweroff ; do ln $(DEST)/rcontrol $(DEST)/$$cmd ; done /usr/local/bin/README.txt: @echo "Certain scripts (those without write permission for root) have been" >> $@ @echo "installed here from source control work directories. DO NOT EDIT THEM." >> $@ @echo README.txt installed # support for installing files into /etc/sudoers.d/ # TO-DO: support for creating /etc/sudoers.d/ with a file in it # ((catch-22 situation as currently written) .PHONY: install_sudoers test_sudoers_d install_sudoers: /etc/sudoers.d/safe_hardware_access /etc/sudoers.d/%: %.sudoers | test_sudoers_d $(INSTALL_SUDO) # tests for the following in /etc/sudoers: # ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment) # #includedir /etc/sudoers.d test_sudoers_d: | /etc/sudoers.d grep -q '^#includedir /etc/sudoers.d' /etc/sudoers /etc/fail2ban/jail.d/%.local: %.jail | /etc/fail2ban/jail.d install --mode=644 --preserve-timestamps $(INSTALL_OPTS) '$<' $@ /etc/fail2ban/jail.d: mkdir $@ # For older versions of fail2ban that don't support /etc/fail2ban/jail.d /etc/fail2ban/jail.local: /tmp/customisation.jail install --mode=644 --preserve-timestamps $(INSTALL_OPTS) '$^' $@ /tmp/customisation.jail: *.jail cat $^ > $@