chiark / gitweb /
test-example: Rules for making a privkeys directory
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Dec 2019 13:45:16 +0000 (13:45 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 21:52:07 +0000 (21:52 +0000)
This generates a directory suitable for use with the priv-cache
closure.  Nothing uses it yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
stest/Subdir.sd.mk
test-example/Subdir.sd.mk

index 06a29252d6a3d22e9f194582e205352519284326..a7fb58f28236b704e3e9f01c0dbebc53c6be71ea 100644 (file)
@@ -43,6 +43,7 @@ debian/secnet.substvars
 /build
 
 test-example/*.key
+test-example/*.privkeys
 test-example/sites.conf
 test-example/bogus-setup-request
 build-stamp
index d8191700137a29ca8b22132567ef59fc310e9367..be0a8d9ea9db9be4182ff185f36f77147f8d0cc9 100644 (file)
@@ -7,6 +7,7 @@
 &DEPS += test-example/sites.conf
 &DEPS += test-example/inside.key
 &DEPS += test-example/outside.key
+&DEPS += test-example/all-privkeys
 
 &:include test-common.sd.mk
 
index 345b11af0514a339383db43a52af3f60c12391e1..b0a63b79ae9fae76865359e1333d519f4a17966b 100644 (file)
@@ -8,4 +8,14 @@ include common.make
 &sites.conf: $(src)/make-secnet-sites &^/sites &/Subdir.mk
        $(src)/make-secnet-sites &^/sites $@
 
+define privkey
+&/$1.privkeys/priv.$2: &/$3
+       mkdir -p $$(dir $$@) && cp $$< $$@.tmp && mv -f $$@.tmp $$@
+&all-privkeys:: &/$1.privkeys/priv.$2
+&clean::
+       rm -rf &/$1.privkeys
+endef
+
+$(eval $(call privkey,outside,0000000000,outside.key))
+
 &CLEAN += *.new