mirror of
https://github.com/namecoin/ncdns-repro
synced 2024-11-01 03:20:14 +00:00
81f0dcda69
This improves build reproducibility. Fixes https://github.com/namecoin/ncdns-repro/issues/57
51 lines
1.6 KiB
Bash
51 lines
1.6 KiB
Bash
#!/bin/bash
|
|
[% c("var/set_default_env") -%]
|
|
[% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
|
|
export CGO_ENABLED=0
|
|
distdir=/var/tmp/dist/[% project %]
|
|
mkdir -p $distdir
|
|
|
|
[% FOREACH dep = c("var/go_lib_deps") -%]
|
|
tar -C /var/tmp/dist -xf [% c('input_files_by_name/' _ dep) %]
|
|
[% END -%]
|
|
|
|
mkdir -p $GOPATH/src/github.com/namecoin
|
|
tar -C $GOPATH/src/github.com/namecoin -xf [% project %]-[% c('version') %].tar.gz
|
|
mv $GOPATH/src/github.com/namecoin/dnssec-hsts-native-[% c('version') %] $GOPATH/src/github.com/namecoin/dnssec-hsts-native
|
|
|
|
# TODO: Remove static build ID after migrating to Go 1.13.3+
|
|
go install -ldflags '-s -buildid=' github.com/namecoin/dnssec-hsts-native/src/dnssec_hsts
|
|
|
|
#mkdir -p /var/tmp/build
|
|
#tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
|
|
#cd /var/tmp/build/[% project %]-[% c('version') %]
|
|
|
|
#mkdir -p "$GOPATH/src/github.com/namecoin"
|
|
#ln -sf "$PWD" "$GOPATH/src/github.com/namecoin/ncdns"
|
|
|
|
#mkdir -p out
|
|
#cd out
|
|
#for x in .. ../ncdumpzone ../generate_nmc_cert; do
|
|
# go build -ldflags '-s' "$x"
|
|
#done
|
|
|
|
[% IF c("var/linux-x86_64") -%]
|
|
GOPATHBIN="${GOPATH}/bin"
|
|
[% ELSE -%]
|
|
GOPATHBIN="${GOPATH}/bin/${GOOS}_${GOARCH}"
|
|
[% END -%]
|
|
|
|
ls $GOPATHBIN
|
|
|
|
cp -a $GOPATHBIN/dnssec_hsts[% IF c("var/windows") %].exe[% END %] $distdir/
|
|
|
|
# TODO: This JSON file is only tested on GNU/Linux, and definitely won't work
|
|
# on Windows because the "path" field is wrong for Windows.
|
|
cp -a $GOPATH/src/github.com/namecoin/dnssec-hsts-native/setup/org.namecoin.dnssec_hsts.json $distdir/
|
|
|
|
cd $distdir
|
|
[% c('tar', {
|
|
tar_src => [ '.' ],
|
|
tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
|
|
}) %]
|