~sbaildon/tldevelopment

cb673a0f249192d148f5b578cbb4ce675e3e5b6a — Sean Baildon 8 months ago d75bd16
makefile to install things
4 files changed, 69 insertions(+), 0 deletions(-)

A Makefile
A READING.md
A dnsmasq.conf
A localhost.dnsmasq.plist
A Makefile => Makefile +19 -0
@@ 0,0 1,19 @@
PLIST=localhost.dnsmasq.plist
DAEMON_DIR=/Library/LaunchDaemons
DAEMON=$(DAEMON_DIR)/$(PLIST)

.PHONY: configure
configure: _build/$(PLIST)

install: /etc/dnsmasq.conf $(DAEMON)

$(DAEMON): _build/$(PLIST)
	install -m 644 $< $(DAEMON)

/etc/dnsmasq.conf: dnsmasq.conf
	install -m 644 dnsmasq.conf /etc/dnsmasq.conf

_build/$(PLIST): $(PLIST)
	install -d -m 755 $(dir $@)
	DNSMASQ_BIN=$(shell type -p dnsmasq) \
	    envsubst -no-unset -no-empty -i $< > $@

A READING.md => READING.md +13 -0
@@ 0,0 1,13 @@
port 53 things
https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html

https://lists.gnupg.org/pipermail/gnupg-devel/2018-June/033789.html

https://lists.gnupg.org/pipermail/gnupg-devel/2016-August/031492.html

https://developer.apple.com/library/archive/technotes/tn2083/_index.html

https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html

https://lists.gnupg.org/pipermail/gnupg-devel/2018-June/033789.html


A dnsmasq.conf => dnsmasq.conf +4 -0
@@ 0,0 1,4 @@
address=/.test/127.0.0.1
address=/.example/127.0.0.1
port=53
listen-address=127.0.0.1

A localhost.dnsmasq.plist => localhost.dnsmasq.plist +33 -0
@@ 0,0 1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>localhost.dnsmasq.plist</string>

	<key>ProgramArguments</key>
	<array>
		<string>${DNSMASQ_BIN}</string>
		<string>--keep-in-foreground</string>
		<string>-C</string>
		<string>/etc/dnsmasq.conf</string>
		<string>-7</string>
		<string>/etc/dnsmasq.d,*.conf</string>
	</array>

	<key>StandardOutPath</key>
	<string>/tmp/dns.log</string>

	<key>StandardErrorPath</key>
	<string>/tmp/dns.error.log</string>

	<key>RunAtLoad</key>
	<true/>

	<key>KeepAlive</key>
	<dict>
		<key>Crashed</key>
		<true/>
	</dict>
</dict>
</plist>