gengitkan/debian/rules

54 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2019-12-05 13:10:02 +01:00
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
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
endif
ifeq (, $(shell which node 2>/dev/null))
override_dh_auto_build: install-nodejs
endif
%:
dh $@ --with systemd
override_dh_auto_build: $(GOPATH)
cd client && npm install
GOPATH=$(GOPATH) PATH="$(PATH):/usr/local/go/bin:$(GOPATH)/bin" go mod vendor
GOPATH=$(GOPATH) PATH="$(PATH):/usr/local/go/bin:$(GOPATH)/bin" ARCH_TARGETS=$(ARCH) make release
$(GOPATH):
mkdir -p $(GOPATH)
install-go:
wget https://dl.google.com/go/go$(GO_VERSION).$(OS)-$(ARCH).tar.gz
tar -C /usr/local -xzf go$(GO_VERSION).$(OS)-$(ARCH).tar.gz
install-nodejs:
wget -O- https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
override_dh_auto_install:
2020-04-30 16:10:57 +02:00
mkdir -p debian/gengitkan/usr/share/gengitkan
mkdir -p debian/gengitkan/etc/gengitkan
mkdir -p debian/gengitkan/usr/bin
2019-12-05 13:10:02 +01:00
2020-04-30 16:10:57 +02:00
cp -r release/server-$(OS)-$(ARCH)/* debian/gengitkan/usr/share/gengitkan/
2019-12-05 13:10:02 +01:00
2020-04-30 16:10:57 +02:00
mv debian/gengitkan/usr/share/gengitkan/bin/server debian/gengitkan/usr/bin/gengitkan
mv debian/gengitkan/usr/share/gengitkan/server.conf debian/gengitkan/etc/gengitkan/server.conf
2019-12-05 13:10:02 +01:00
2020-04-30 16:10:57 +02:00
install -d debian/gengitkan
2019-12-05 13:10:02 +01:00
override_dh_strip:
override_dh_auto_test: