summaryrefslogtreecommitdiffstats
path: root/Makefile.hornet
blob: 29ef1e85710839193ce0e06ecd64a3a1c9ab697b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
INSTALL := \
    .config/alacritty/alacritty.yml \
    .config/darksky/api \
    .config/i3/browser-workspace.json \
    .config/i3/config \
    .config/i3/signal-workspace.json \
    .config/i3/terminal-workspace.json \
    .config/i3status/config \
    .config/imapnotify/tozt.conf \
    .config/msmtp/config \
    .config/perspektiv/config.toml \
    .mbsyncrc \
    .mbsyncloop \
    .notmuch-config \
    .ssh/authorized_keys \
    .xbindkeysrc \
    .Xdefaults \
    .xinitrc \
    .xprofile \
    .Xmodmap \
    $(patsubst %,.%,$(wildcard services/available/*/run)) \
    $(patsubst %,.%,$(wildcard services/available/*/log/run))

EMPTYDIRS := \
    $(patsubst services/available/%,.log/%,$(wildcard services/available/*)) \
    Maildir \
    .cache/mpd \
    .cache/notmuch \
    .config/mpd/playlists

INSTALL_CUSTOM := \
    $(patsubst services/available/%,$(INTO)/.services/enabled/%,$(wildcard services/available/*)) \
    /var/spool/cron/$(USER) \
    $(INTO)/.cache/notmuch/hooks/post-new

BUILD := \
    config/alacritty/alacritty.yml \
    mbsyncloop

install ::
	@chmod 600 config/msmtp/config

clean ::
	@crontab -r

/var/spool/cron/$(USER) : crontab
	@crontab $<

$(INTO)/.cache/notmuch/hooks/post-new: notmuch/hooks/post-new
	@[ ! -e $@ ] || [ -h $@ ] || mv -f $@ $@.bak
	$(MKDIR) $(INTO)/.cache/notmuch/hooks
	$(LN) $(PWD)/$< $@

$(INTO)/.services/enabled :
	$(MKDIR) $@

$(INTO)/.services/enabled/% : services/available/% $(INTO)/.services/enabled
	$(MKDIR) $(dir $<)
	$(LN) ../available/$(notdir $<) $@

config/alacritty/alacritty.yml : config/alacritty/alacritty.yml.hornet
	$(LN) $(notdir $<) $@

config/darksky :
	$(MKDIR) $@

config/darksky/api : config/darksky
	rbw get darksky.net api > $@

mbsyncloop: mbsyncrc
	@sed 's/^PassCmd.*/PassCmd "head -n1 \/run\/user\/1000\/mbsyncloop"/' mbsyncrc > mbsyncloop