summaryrefslogtreecommitdiff
path: root/.local/bin/setup
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/setup')
-rwxr-xr-x.local/bin/setup50
1 files changed, 50 insertions, 0 deletions
diff --git a/.local/bin/setup b/.local/bin/setup
new file mode 100755
index 0000000..e26c590
--- /dev/null
+++ b/.local/bin/setup
@@ -0,0 +1,50 @@
+#!/usr/bin/make -f
+
+HOME = $(shell cd "$(dir $(lastword $(MAKEFILE_LIST)))" && git rev-parse --show-toplevel)
+export HOME
+undefine XDG_CONFIG_DIR
+
+LANG = C
+export LANG
+undefine $(filter LC_%,$(.VARIABLES))
+
+CFLAGS += -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter
+
+dirs = \
+ $(HOME)/packages/pkgdest \
+ $(HOME)/packages/srcdest \
+ $(HOME)/packages/srcpkgdest \
+ $(HOME)/packages/logdest \
+ $(HOME)/packages/builddir
+
+all: \
+ $(HOME)/.local/bin/autobuild \
+ $(HOME)/.ssh/id_rsa \
+ $(HOME)/.ssh/id_rsa.pub \
+ $(HOME)/.gnupg/secring.gpg \
+ $(HOME)/packages/abslibre \
+ $(dirs)
+
+$(HOME)/.local/bin/autobuild: %: %.c
+ cd $(@D) && $(LINK.c) $(notdir $^) $(LOADLIBES) $(LDLIBS) -o $(@F) && chmod 6755 $(@F)
+
+$(HOME)/.ssh/id_% $(HOME)/.ssh/id_%.pub:
+ ssh-keygen -N '' -f $(@D)/id_$*
+
+$(HOME)/.gnupg/secring.gpg: | $(HOME)/.config/git/config
+ chmod 700 $(@D)
+ printf '%s\n' \
+ 'Key-Type: default' \
+ 'Subkey-Type: default' \
+ "Name-Real: $$(git config user.name)" \
+ "Name-Email: $$(git config user.email)" \
+ 'Expire-Date: 0' \
+ | gpg --gen-key --batch
+
+$(HOME)/packages/abslibre:
+ createworkdir
+
+$(dirs): %:
+ mkdir -p -- $@
+
+.DELETE_ON_ERROR: