Porting of Smallstep CA

Markus Wipp mw at wipp.bayern
Fri Apr 10 08:31:02 UTC 2020



> On 8. Apr 2020, at 23:05, Bernhard Fröhlich <decke at bluelife.at> wrote
> 
> 
> There is more work to do (pkg-descr, pkg-plist probably, don't know if it needs some other files etc.) but it builds the binary at least and passes portlint:
> 
> https://github.com/decke/ports/blob/master/security/smallstep-cli/Makefile <https://github.com/decke/ports/blob/master/security/smallstep-cli/Makefile>

Hi Bernhard, 

Thanks for your input here. I tried it and it worked. Unfortunately in the meantime there is a new version of this tool and I tried to do it the same way, but I’m getting the following
Error now:

===>  Building for smallstep-cli-0.14.2
(cd /usr/ports/security/smallstep-cli/work/cli-0.14.2;  for t in ./cmd/step; do  out=$(/usr/bin/basename $(echo ${t} |  /usr/bin/sed -Ee 's/^[^:]*:([^:]+).*$/\1/' -e 's/^\.$/smallstep-cli/'));  pkg=$(echo ${t} |  /usr/bin/sed -Ee 's/^([^:]*).*$/\1/' -e 's/^smallstep-cli$/./');  echo "===>  Building ${out} from ${pkg}";  /usr/bin/env XDG_DATA_HOME=/usr/ports/security/smallstep-cli/work  XDG_CONFIG_HOME=/usr/ports/security/smallstep-cli/work  HOME=/usr/ports/security/smallstep-cli/work PATH=/usr/ports/security/smallstep-cli/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" CGO_ENABLED=1  CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"  GOARM= GOPATH=""  GOBIN="/usr/ports/security/smallstep-cli/work/bin"  GO_NO_VENDOR_CHECKS=1 /usr/local/bin/go build -v -buildmode=exe -ldflags=-s -mod=vendor  -o /usr/ports/security/smallstep-cli/work/bin/${out}  ${pkg};  done)
===>  Building step from ./cmd/step
import cycle not allowed
package github.com/smallstep/cli/cmd/step
	imports github.com/smallstep/certificates/ca
	imports github.com/smallstep/certificates/acme/api
	imports github.com/smallstep/certificates/api
	imports github.com/smallstep/certificates/authority
	imports github.com/smallstep/certificates/kms
	imports github.com/smallstep/certificates/kms/cloudkms
	imports cloud.google.com/go/kms/apiv1
	imports cloud.google.com/go/iam
	imports github.com/googleapis/gax-go/v2
	imports github.com/googleapis/gax-go/v2
*** Error code 1

Stop.
make: stopped in /usr/ports/security/smallstep-cli

As I’m not a go programmer, I’ve no clue of why this is happening and what to do about it.
I already have regenerated the go mod vender / modules2tuples part in the Makefile and did a make clean makesum stage

When using the Makefile that comes with the tool it builds with no issues. When I try to use this and put in
USES=           gmake go:modules,no_targets
ALL_TARGET=     build

Instead of
USES=          go:modules

I get this error:

Build Complete!
gmake[1]: Leaving directory '/usr/ports/security/smallstep-cli/work/cli-0.14.2'
===>  Staging for smallstep-cli-0.14.2
===>   Generating temporary packing list
gmake[1]: Entering directory '/usr/ports/security/smallstep-cli/work/cli-0.14.2'
usage: install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               [-B suffix] [-l linkflags] [-N dbdir]
               file1 file2
       install [-bCcpSsUv] [-f flags] [-g group] [-m mode] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               [-B suffix] [-l linkflags] [-N dbdir]
               file1 ... fileN directory
       install -dU [-vU] [-g group] [-m mode] [-N dbdir] [-o owner]
               [-M log] [-D dest] [-h hash] [-T tags]
               directory ...
gmake[1]: *** [make/common.mk:92: install] Error 64
gmake[1]: Leaving directory '/usr/ports/security/smallstep-cli/work/cli-0.14.2'
*** Error code 2

Stop.
make: stopped in /usr/ports/security/smallstep-cli

Additionally I’m not able to find the bin directory which is created when I do this manually.

Any help Is highly appreciated!

Thanks 
Markus

> 
> -- 
> Bernhard Fröhlich
> http://www.bluelife.at/ <http://www.bluelife.at/>



More information about the freebsd-ports mailing list