Commit 4c6982dd authored by ale's avatar ale

hermetic build with system golang

parent 34b1341a
......@@ -2,7 +2,7 @@ Source: autoradio
Section: net
Priority: extra
Maintainer: ale <ale@incal.net>
Build-Depends: debhelper (>= 8.0.0), dh-systemd
Build-Depends: debhelper (>= 8.0.0), dh-systemd, golang-go (>= 1.5)
Standards-Version: 3.9.4
Homepage: https://git.autistici.org/ale/autoradio
......
......@@ -25,17 +25,17 @@ DESTDIR = $(CURDIR)/debian/autoradio-server
override_dh_install:
# Build the binary
(mkdir -p $(CURDIR)/build/src/$(dir $(GOPKG)) && \
ln -s $(CURDIR) $(CURDIR)/build/src/$(GOPKG) && \
cd $(CURDIR)/build/src/$(GOPKG) && \
env GOPATH=$(CURDIR)/build PATH=$$PATH:/usr/local/bin go install -v ./...)
install -m 755 -o root -g root -d $(DESTDIR)/usr/bin
(for bin in radioctl radiobench ; do \
install -m 755 -o root -g root $(CURDIR)/build/bin/$$bin $(DESTDIR)/usr/bin/$$bin ; \
done)
install -m 755 -o root -g root -d $(DESTDIR)/usr/sbin
(for bin in redirectord radiod ; do \
install -m 755 -o root -g root $(CURDIR)/build/bin/$$bin $(DESTDIR)/usr/sbin/$$bin ; \
(export GOPATH=$(shell mktemp -d); mkdir -p $$GOPATH/src/$(dir $(GOPKG)) && \
cp -r $(CURDIR) $$GOPATH/src/$(GOPKG) && \
cd $$GOPATH/src/$(GOPKG) && \
go install -v ./... && \
for bin in radioctl radiobench ; do \
install -m 755 -o root -g root $$GOPATH/bin/$$bin $(DESTDIR)/usr/bin/$$bin ; \
done && \
for bin in redirectord radiod ; do \
install -m 755 -o root -g root $$GOPATH/bin/$$bin $(DESTDIR)/usr/sbin/$$bin ; \
done)
# Install the static files and templates for the HTTP dashboard.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment