forked from erlyaws/yaws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
81 lines (70 loc) · 2.33 KB
/
Makefile.am
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
72
73
74
75
76
77
78
79
80
81
include @top_srcdir@/include.mk
EXTRA_DIST = darwin debian freebsd gentoo netbsd openbsd redhat suse systemd \
gen-yaws gen-yaws-conf gen-yaws-generated Subst \
regular-install make-release make-upload \
rebar-pre-script yaws.conf.template yaws.template
if !MINGW
install-data-local: yaws_script yaws_conf yaws_init_script
uninstall-local:
$(AM_V_at)if diff -U0 $(DESTDIR)$(confdir)/yaws.conf.template \
$(DESTDIR)$(confdir)/yaws.conf; then \
rm -f $(DESTDIR)$(confdir)/yaws.conf; \
else \
echo "Keep modified config file"; \
fi
$(AM_V_at)rm -f $(DESTDIR)$(bindir)/yaws
$(AM_V_at)rm -f $(DESTDIR)$(sysconfdir)/init.d/yaws
$(AM_V_at)rm -f $(DESTDIR)$(sysconfdir)/rc.d/yaws
$(AM_V_at)rm -f $(DESTDIR)$(sysconfdir)/systemd/system/yaws.service
$(AM_V_at)rm -f $(DESTDIR)$(confdir)/yaws.conf.template
yaws_script:
$(AM_V_GEN)
$(AM_V_at)$(INSTALL) -d $(DESTDIR)$(bindir)
$(AM_V_at)(cd @srcdir@ && \
YAWSDIR='$(yawsdir)' \
VARDIR='$(localstatedir)' \
ERLBINDIR='$(ERLANG_ERTS_DIR)/bin' \
ERL='$(ERL)' WERL='$(WERL)' \
./gen-yaws > $(DESTDIR)$(bindir)/yaws)
$(AM_V_at)chmod +x $(DESTDIR)$(bindir)/yaws
yaws_conf:
$(AM_V_GEN)
$(AM_V_at)$(INSTALL) -d $(DESTDIR)$(confdir);
$(AM_V_at)user=$${SUDO_USER:-$$(whoami)}; \
if [ $${user} == 'root' -o $${user} != $$(whoami) ]; then \
PORT=80; \
SSLPORT=443; \
else \
PORT=8000; \
SSLPORT=4443; \
fi; \
(cd @srcdir@ && \
YAWSDIR='$(yawsdir)' \
LOGDIR='$(logdir)' \
VARDIR='$(localstatedir)' \
PORT=$${PORT} \
DOCROOT='$(wwwdir)' \
CERTDIR='$(confdir)' \
SSLPORT=$${SSLPORT} \
./gen-yaws-conf > $(DESTDIR)$(confdir)/yaws.conf.template)
$(AM_V_at)if [ -f "$(DESTDIR)$(confdir)/yaws.conf" ]; then \
echo "* Keeping old config file "; \
else \
echo "* Installing new config file"; \
$(INSTALL) -m 644 $(DESTDIR)$(confdir)/yaws.conf.template \
$(DESTDIR)$(confdir)/yaws.conf; \
fi
yaws_init_script:
$(AM_V_GEN)
$(AM_V_at)(cd @srcdir@ && \
DESTDIR='$(DESTDIR)' \
PREFIX='$(prefix)' \
ETCDIR='$(sysconfdir)' \
BINDIR='$(bindir)' \
LOGDIR='$(logdir)' \
YAWSDIR='$(ERLANG_INSTALL_LIB_DIR_yaws)' \
./regular-install)
endif
# Local Variables:
# tab-width: 8
# End: