ffplayout/Makefile

56 lines
2.1 KiB
Makefile
Raw Normal View History

2020-02-03 07:22:46 -05:00
SHELL := /bin/bash
2020-02-04 07:13:23 -05:00
CURRENT_DIR = $(shell pwd)
2020-02-03 07:22:46 -05:00
init:
virtualenv -p python3 venv
2020-02-03 11:48:22 -05:00
source ./venv/bin/activate && pip install -r requirements.txt
2020-02-03 07:22:46 -05:00
@echo ""
@echo "-------------------------------------------------------------------"
2020-02-04 07:13:23 -05:00
@echo "external packages for ffplayout installed in \"$(CURRENT_DIR)/venv\""
2020-02-03 14:40:13 -05:00
@echo ""
2020-02-04 07:13:23 -05:00
@echo "run:"
@echo "\"$(CURRENT_DIR)/venv/bin/python\" \"$(CURRENT_DIR)/ffplayout.py\""
2020-02-03 14:40:13 -05:00
@echo ""
@echo "or:"
@echo "source ./venv/bin/activate"
@echo "./ffplayout.py"
2020-02-03 07:22:46 -05:00
@echo ""
2020-02-04 07:13:23 -05:00
@echo "-------------------------------------------------------------------"
@echo "run \"sudo make install USER=www-data\" if you would like to run ffplayout on server like environments"
@echo "instead of www-data you can use any user which need write access to the config file"
@echo "this user will also be placed in systemd service"
@echo "systemd is required!"
install:
if [ ! "$(CURRENT_DIR)" == "/opt/ffplayout-engine" ]; then \
install -d -o $(USER) -g $(USER) /opt/ffplayout-engine/; \
cp -r docs ffplayout venv "/opt/ffplayout-engine/"; \
chown $(USER):$(USER) -R "/opt/ffplayout-engine/"; \
2020-02-05 03:25:56 -05:00
install -m 755 -o $(USER) -g $(USER) ffplayout.py "/opt/ffplayout-engine/"; \
2020-02-04 07:13:23 -05:00
fi
install -d /etc/ffplayout/
install -d -o $(USER) -g $(USER) /var/log/ffplayout/
if [ ! -f "/etc/ffplayout/ffplayout.yml" ]; then \
install -m 644 -o $(USER) -g $(USER) ffplayout.yml /etc/ffplayout/; \
fi
2020-04-24 08:57:56 -04:00
if [ -d "/etc/systemd/system" ] && [ ! -f "/etc/systemd/system/ffplayout-engine.service" ]; then \
install -m 644 docs/ffplayout-engine.service /etc/systemd/system/; \
sed -i "s/root/$(USER)/g" "/etc/systemd/system/ffplayout-engine.service"; \
2020-02-04 07:13:23 -05:00
fi
@echo ""
@echo "-------------------------------------------------------------------"
@echo "installation done..."
@echo ""
@echo "if you want ffplayout to autostart, run: \"systemctl enable ffplayout\""
clean:
rm -rf venv
uninstall:
rm -rf "/etc/ffplayout"
rm -rf "/var/log/ffplayout"
2020-04-24 08:57:56 -04:00
rm -rf "/etc/systemd/system/ffplayout-engine.service"
2020-02-04 07:13:23 -05:00
if [ ! "$(CURRENT_DIR)" == "/opt/ffplayout-engine" ]; then \
rm -rf "/opt/ffplayout-engine"; \
fi