Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 71 lines (60 sloc) 2.064 kb
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
include ../include.mk


all debug: ../bin/yaws yaws.conf

../bin/yaws: yaws.template
cat yaws.template | \
./Subst %yawsdir% "`pwd`/.." | \
./Subst %vardir% "$(VARDIR)" | \
./Subst %run_erl% "$(ERLBINDIR)/run_erl" | \
./Subst %to_erl% "$(ERLBINDIR)/to_erl" | \
./Subst %erl% $(ERL) | \
./Subst %werl% $(WERL) > ../bin/yaws
chmod +x ../bin/yaws


local_install: ../bin/yaws
@install -d $$HOME/yaws_logs
@if [ -f $$HOME/yaws.conf ]; \
then target=$$HOME/yaws.conf.template; \
else \
target=$$HOME/yaws.conf; \
fi; \
echo "--- Installing local config file at $${target} "; \
cat yaws.conf.template | \
./Subst %yawsdir% "`pwd`/.." | \
./Subst %logdir% $$HOME/yaws_logs | \
./Subst %host% `hostname` | \
./Subst %port% 8000 | \
./Subst %vardir% "$(VARDIR)" | \
./Subst %docroot% `pwd`/../www | \
./Subst %certdir% `pwd`/../ssl | \
./Subst %sslport% 4443 > $${target}; \
$(INSTALL) -d $$HOME/bin; \
rm $$HOME/bin/yaws 2> /dev/null; \
cp -f ../bin/yaws $$HOME/bin/yaws; \
echo "--- Installed $$HOME/bin/yaws"


yaws.conf:
@echo PREFIX is $(PREFIX)
cat yaws.conf.template | \
./Subst %yawsdir% "$(PREFIX)/lib/yaws" | \
./Subst %logdir% "$(PREFIX)/var/log/yaws" | \
./Subst %vardir% "$(VARDIR)" | \
./Subst %host% `hostname` | \
./Subst %port% 80 | \
./Subst %docroot% "$(VARDIR)/yaws/www" | \
./Subst %certdir% "$(ETCDIR)/yaws" | \
./Subst %sslport% 443 > yaws.conf

clean:
rm -f ../bin/yaws yaws.conf

install: .install

.install:
-rm -rf /tmp/yaws 2> /dev/null
sh ./Install $(PREFIX) $(ERL) \
$(WERL) $(ETCDIR)/ $(VARDIR)/ $(ERLBINDIR)/ $(DESTDIR)
@if [ -f $(DESTDIR)$(ETCDIR)/yaws/yaws.conf ]; \
then echo "Keeping old config file "; \
cp yaws.conf $(DESTDIR)$(ETCDIR)/yaws/yaws.conf.template; \
else \
echo "Installing $(DESTDIR)$(ETCDIR)/yaws/yaws.conf"; \
mkdir -p $(DESTDIR)$(ETCDIR)/yaws; \
cp yaws.conf $(DESTDIR)$(ETCDIR)/yaws/yaws.conf; \
fi
@cp ../ssl/yaws-cert.pem $(DESTDIR)$(ETCDIR)/yaws
@cp ../ssl/yaws-key.pem $(DESTDIR)$(ETCDIR)/yaws
Something went wrong with that request. Please try again.