1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#!/usr/bin/make -f
# This file is in the public domain.
# You may freely use, modify, distribute, and relicense it.
export GOROOT := $(CURDIR)
export GOROOT_FINAL := /usr/lib/go
DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)
RUN_TESTS := true
ifeq (ppc64, $(DEB_HOST_ARCH_CPU))
RUN_TESTS := false
endif
ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
RUN_TESTS := false
endif
%:
+dh --parallel $(opt_no_act) $@
override_dh_auto_clean:
# remove autogenerated files
rm -f \
src/cmd/cgo/zdefaultcc.go \
src/cmd/go/zdefaultcc.go \
src/cmd/internal/obj/zbootstrap.go \
src/runtime/internal/sys/zversion.go
# remove built objects
rm -rf bin pkg
override_dh_auto_test-arch:
ifeq (true, $(RUN_TESTS))
set -ex; \
cd src; \
export PATH="$(GOROOT)/bin:$$PATH"; \
eval "$$(go tool dist env)"; \
bash run.bash -k -no-rebuild;
# -k keep going even when error occurred
# -no-rebuild don't rebuild std and cmd packages
# On linux/amd64 run.bash installs some race enabled standard library
# packages. Delete them again to avoid accidentally including them in
# the package.
set -ex; \
export PATH="$(GOROOT)/bin:$$PATH"; \
eval "$$(go tool dist env)"; \
rm -rf "$(GOROOT)/pkg/$${GOOS}_$${GOARCH}_race/"
else
# skip the tests on platforms where they fail
endif
override_dh_compress-indep:
dh_compress -Xusr/share/doc/golang-doc/html -Xusr/share/doc/golang-doc/godoc
override_dh_install-indep:
dh_install --fail-missing
override_dh_install-arch:
dh_install --fail-missing
# Remove Plan9 rc(1) scripts
find debian/golang-src/usr/share/go/src -type f -name '*.rc' -delete
# Remove empty /usr/share/go/src from golang-go, it is provided by golang-src
find debian/golang-go/usr/share/go/src -type d -delete
# Touch built and installed files and directories to have same timestamp
touch debian/golang-go/usr/lib/go/pkg
find debian/golang-go/usr/lib/go/pkg -exec touch -r $(CURDIR)/debian/golang-go/usr/lib/go/pkg {} \;
override_dh_strip:
# strip disabled as golang upstream doesn't support it and it makes go
# crash. See http://bugs.debian.org/717172
override_dh_shlibdeps:
dh_shlibdeps -Xtestdata -Xtest
override_dh_auto_build-arch:
[ -f VERSION ] || echo "debian snapshot +$$(dpkg-parsechangelog -SVersion)" > VERSION
export GOROOT_BOOTSTRAP=$$(env -i go env GOROOT) \
&& cd src \
&& $(CURDIR)/debian/helpers/goenv.sh \
bash ./make.bash --no-banner
opt_no_act :=
ifneq (,$(findstring n,$(MAKEFLAGS)))
opt_no_act := --no-act
endif
|