userv: Tidy up a bit. Require file descriptors to be right.
[cryptomail] / Makefile
1 ### Makefile for cryptomail
2
3 PRP = twofish
4 KEYSZ = 256
5 USER = cryptomail
6 ASUSER = become $(USER) -g$(USER) --
7
8 all: config.files crontab.stamp
9
10 config.files: config
11 splitconf config
12 update-addrcheck
13
14 crontab.stamp: crontab
15 @if [ -f really-install-crontab ]; then \
16 echo "crontab -u $(USER) crontab"; \
17 crontab -u $(USER) crontab; \
18 else \
19 echo "(Not installing crontab.)"; \
20 fi
21 touch crontab.stamp
22
23 install: all db/keyring db/cryptomail.db
24
25 db:
26 mkdir -p -m 700 db.new
27 chown $(USER):$(USER) db.new
28 mv db.new db
29
30 db/keyring: db
31 $(ASUSER) \
32 key -k db/keyring add -abinary -b$(KEYSZ) -eforever \
33 cryptomail prp=$(PRP)
34
35 db/cryptomail.db: db
36 $(ASUSER) bin/cryptomail initdb
37
38 clean:
39 splitconf -d config
40 rm -f config.files crontab.stamp
41
42 realclean: clean
43 rm -rf db
44
45 .PHONY: clean all install