From 283a28cd2d7fcc4392b96495be45f2c7ba4e6e3c Mon Sep 17 00:00:00 2001 From: JeremyRand Date: Mon, 10 Jun 2019 02:23:57 +0000 Subject: [PATCH] Support building ncdns as library --- projects/ncdns/build | 22 ++++++++++++++++------ projects/ncdns/config | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/projects/ncdns/build b/projects/ncdns/build index f264557..9485379 100644 --- a/projects/ncdns/build +++ b/projects/ncdns/build @@ -51,14 +51,24 @@ go install -ldflags '-s' github.com/namecoin/ncdns/... GOPATHBIN="${GOPATH}/bin/${GOOS}_${GOARCH}" [% END -%] -ls $GOPATHBIN +cd /var/tmp/dist +[% IF !c("var/go_lib_no_output") -%] + # Build as library + [% c('tar', { + tar_src => [ 'gopath' ], + tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'), + }) %] +[% ELSE %] + # Build as executable + ls $GOPATHBIN -for x in ncdns ncdumpzone ncdt generate_nmc_cert tlsrestrict_chromium_tool; do - cp -a $GOPATHBIN/"$x"[% IF c("var/windows") %].exe[% END %] $distdir/ -done + for x in ncdns ncdumpzone ncdt generate_nmc_cert tlsrestrict_chromium_tool; do + cp -a $GOPATHBIN/"$x"[% IF c("var/windows") %].exe[% END %] $distdir/ + done -cd $distdir -[% c('tar', { + cd $distdir + [% c('tar', { tar_src => [ '.' ], tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'), }) %] +[% END %] diff --git a/projects/ncdns/config b/projects/ncdns/config index 157c902..729134a 100644 --- a/projects/ncdns/config +++ b/projects/ncdns/config @@ -18,6 +18,7 @@ var: - gopkg.in,hlandau,easyconfig.v1 - gopkg.in,hlandau,service.v2 - golang.org,x,net + go_lib_no_output: 1 targets: linux: