Use mkdir -p in Makefile and domtool-addcert
[hcoop/domtool2.git] / Makefile
index f3161d4..45e6cc5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,21 @@
-all: mlton
+all: mlton bin/vmailpasswd elisp/domtool-tables.el
+
+bin/vmailpasswd: src/mail/vmailpasswd.c
+       $(CC) -lcrypt -o $@ $<
 
 COMMON_DEPS := configDefault/config.sig configDefault/configDefault.sml \
-       openssl/openssl_sml.so
+       openssl/openssl_sml.so config.sml
+
+EMACS_DIR := /usr/local/share/emacs/site-lisp/domtool-mode
+
+config.sml:
+       echo -e 'structure Config :> CONFIG = struct\nopen ConfigDefault\nend' > $@
 
 .PHONY: all mlton smlnj install
 
 mlton: bin/domtool-server bin/domtool-client bin/domtool-slave \
        bin/domtool-admin bin/domtool-doc bin/dbtool bin/vmail \
-       bin/smtplog bin/setsa
+       bin/smtplog bin/setsa bin/mysql-fixperms
 
 smlnj: $(COMMON_DEPS) openssl/smlnj/FFI/libssl.h.cm src/domtool.cm
 
@@ -78,6 +86,10 @@ src/smtplog.mlb: src/prefix.mlb src/sources src/suffix.mlb
        $(MAKE_MLB_BASE) >src/smtplog.mlb
        echo "main-smtplog.sml" >>src/smtplog.mlb
 
+src/mysql-fixperms.mlb: src/prefix.mlb src/sources src/suffix.mlb
+       $(MAKE_MLB_BASE) >src/mysql-fixperms.mlb
+       echo "main-mysql-fixperms.sml" >>src/mysql-fixperms.mlb
+
 openssl/smlnj/FFI/libssl.h.cm: openssl/openssl_sml.h
        cd openssl/smlnj ; ml-nlffigen -d FFI -lh LibsslH.libh -include ../libssl-h.sml \
        -cm libssl.h.cm -D__builtin_va_list="void*" \
@@ -134,12 +146,19 @@ bin/setsa: $(COMMON_MLTON_DEPS) src/setsa.mlb
 bin/smtplog: $(COMMON_MLTON_DEPS) src/smtplog.mlb
        $(MLTON) -output bin/smtplog src/smtplog.mlb
 
+bin/mysql-fixperms: $(COMMON_MLTON_DEPS) src/mysql-fixperms.mlb
+       $(MLTON) -output bin/mysql-fixperms src/mysql-fixperms.mlb
+
+elisp/domtool-tables.el: lib/*.dtl bin/domtool-doc
+       bin/domtool-doc -basis -emacs >$@
+
 install:
        cp scripts/domtool-publish /usr/local/sbin/
        cp scripts/domtool-reset-global /usr/local/sbin/
        cp scripts/domtool-reset-local /usr/local/sbin/
        cp scripts/domtool-adduser /usr/local/bin/
        cp scripts/domtool-addcert /usr/local/bin/
+       cp scripts/domtool-addcert-daemon /usr/local/bin/
        cp scripts/domtool-addacl /usr/local/bin/
        cp scripts/domtool-rmuser /usr/local/bin/
        cp scripts/domtool-admin-sudo /usr/local/bin/
@@ -157,10 +176,24 @@ install:
        -cp bin/vmail /usr/local/bin/
        -cp bin/setsa /usr/local/bin/
        -cp bin/smtplog /usr/local/bin/
+       -cp bin/mysql-fixperms /usr/local/bin/
+       -cp bin/vmailpasswd /usr/local/bin/
        cp src/plugins/domtool-postgres /usr/local/sbin/
        cp src/plugins/domtool-mysql /usr/local/sbin/
+       -mkdir -p $(EMACS_DIR)
+       cp elisp/*.el $(EMACS_DIR)/
 
-.PHONY: grab_lib
+.PHONY: grab_lib install_server install_slave
 
 grab_lib:
-       rsync --delete /afs/hcoop.net/common/etc/domtool/lib/* lib/
+       rsync -r --delete /afs/hcoop.net/common/etc/domtool/lib/* lib/
+
+install_server:
+       sudo /etc/init.d/domtool-server stop
+       sudo make install
+       sudo /etc/init.d/domtool-server start
+
+install_slave:
+       sudo /etc/init.d/domtool-slave stop
+       sudo make install
+       sudo /etc/init.d/domtool-slave start