daddy/debian/rules

55 lines
1.3 KiB
Plaintext
Raw Normal View History

2020-06-17 18:58:27 +02:00
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
2020-07-16 22:33:51 +02:00
GO_VERSION := 1.13.5
OS := linux
ARCH := amd64
GOPATH=$(HOME)/go
ifeq (, $(shell which go 2>/dev/null))
override_dh_auto_build: install-go
2020-07-16 22:50:55 +02:00
override_dh_auto_clean: install-go
2020-07-16 22:33:51 +02:00
endif
2020-06-17 18:58:27 +02:00
ifeq (, $(shell which node 2>/dev/null))
override_dh_auto_build: install-nodejs
endif
%:
dh $@ --with systemd
2020-07-16 22:33:51 +02:00
override_dh_auto_build: $(GOPATH)
2020-07-16 22:50:55 +02:00
GOPATH=$(GOPATH) PATH="$(PATH):/usr/local/go/bin:$(GOPATH)/bin" make deps
2020-07-16 22:33:51 +02:00
GOPATH=$(GOPATH) PATH="$(PATH):/usr/local/go/bin:$(GOPATH)/bin" ARCH_TARGETS=$(ARCH) make release
$(GOPATH):
mkdir -p $(GOPATH)
install-go:
2020-07-16 22:50:55 +02:00
wget -nc https://dl.google.com/go/go$(GO_VERSION).$(OS)-$(ARCH).tar.gz
2020-07-16 22:33:51 +02:00
tar -C /usr/local -xzf go$(GO_VERSION).$(OS)-$(ARCH).tar.gz
2020-06-17 18:58:27 +02:00
install-nodejs:
wget -O- https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
override_dh_auto_install:
2020-07-16 22:33:51 +02:00
mkdir -p debian/daddy/usr/share/daddy
mkdir -p debian/daddy/etc/daddy
mkdir -p debian/daddy/usr/bin
cp -r release/server-$(OS)-$(ARCH)/* debian/daddy/usr/share/daddy/
mv debian/daddy/usr/share/daddy/bin/server debian/daddy/usr/bin/daddy
mv debian/daddy/usr/share/daddy/server.conf debian/daddy/etc/daddy/config.yml
2020-06-17 18:58:27 +02:00
install -d debian/daddy
override_dh_strip:
override_dh_auto_test: