daddy/debian/rules

36 lines
954 B
Makefile

#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
ifeq (, $(shell which node 2>/dev/null))
override_dh_auto_build: install-nodejs
endif
%:
dh $@ --with systemd
override_dh_auto_build:
cd frontend && npm install && npm run build
install-nodejs:
wget -O- https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
override_dh_auto_install:
mkdir -p debian/daddy/usr/share/daddy/client/public
mkdir -p debian/daddy/usr/share/daddy/server/config
mkdir -p debian/daddy/etc/nginx/sites-available
mkdir -p debian/daddy/etc/systemd/system
cp -r frontend/dist/* debian/daddy/usr/share/daddy/client/public/
cp -r backend/config/* debian/daddy/usr/share/daddy/server/config/
cp misc/debian/nginx/daddy.conf debian/daddy/etc/nginx/sites-available/
cp misc/debian/systemd/daddy.env debian/daddy/etc/systemd/system/
install -d debian/daddy
override_dh_strip:
override_dh_auto_test: