You are trying to build Packetbeat, correct? You wrote "packagebeat" which is a different project.
When Packetbeat 1.3 was released it was build with Go 1.7. So install that version and then Go should automatically find those missing dependencies which are included in the project's /vendor directory.
Yes, sorry. Packetbeat. I've changed the topic title.
Ok, There's a go1.7.1.linux-armv6l.tar.gz file in that directory, that might work. Worth a try, at least.
Debian jessie-backports has go 1.7, but finding backports for architectures other than i386 and/or amd64 seems futile (one might get lucky, but there are no guarantees they will ever get in place).
Unpacking a tarball and setting the PATH appropriately is probably a lot less work.
Now I've successfully built packetbeat on the rPi (well... there is a binary called packetbeat present, and I got no error message from the "make" command).
But I'm unable to figure out how to build a debian package. There is nothing about debian in the makefiles, as far as I can tell.
Is there stuff in the build setup to build a .deb of packagebeat?
Or would I have to look elsewhere for that? E.g. in debian somewhere?
dev-tools/packer/platforms/debian/build.sh in the Beats git looks promising.
Hm... not present on the 1.3 branch...?
And it doesn't look like it can be easily transferred to that branch.
The reason for trying the 1.3 branch in the first place, was because
that was what I would have installed if I had been able to just pick a
.deb package and installing it.
However if 5.0 is what will build, that is what I will try...
[code]echo "Start building packages for packetbeat"
Start building packages for packetbeat
mkdir -p /home/sb/go/src/github.com/elastic/beats/packetbeat/build/upload
if [ true = true ]; then
make prepare-package-cgo;
else
make prepare-package;
fi
make[1]: Entering directory '/home/sb/go/src/github.com/elastic/beats/packetbeat'
However if docker is the docker container, it isn't in debian jessie, this is the only package containing an executable named "docker": https://packages.debian.org/jessie/docker
(and that is something other than the docker container...)
I found a package called docker.io which for regular debian only is in jessie-backports, but surprisingly was available in raspbian jessie (which doesn't have backports), and installed it on the rPi.
I tried doing "make package" as my own user but that failed since the command required privileges I don't have.
So I set GOROOT and GOPATH and added go to the PATH for root, and tried building, and ran into a new problem:
[code]root@ocon:/home/sb/go/src/github.com/elastic/beats/packetbeat# export GOROOT=/usr/local/go
root@ocon:/home/sb/go/src/github.com/elastic/beats/packetbeat# export GOPATH=/home/sb/go
root@ocon:/home/sb/go/src/github.com/elastic/beats/packetbeat# export PATH=$PATH:$GOROOT/bin
root@ocon:/home/sb/go/src/github.com/elastic/beats/packetbeat# make package
echo "Start building packages for packetbeat"
Start building packages for packetbeat
mkdir -p /home/sb/go/src/github.com/elastic/beats/packetbeat/build/upload
if [ true = true ]; then
make prepare-package-cgo;
else
make prepare-package;
fi
make[1]: Entering directory '/home/sb/go/src/github.com/elastic/beats/packetbeat'
cross compile on ubuntu
docker run --rm
-v /home/sb/go/src/github.com/elastic/beats/dev-tools/packer/xgo-scripts:/scripts
-v /home/sb/go/src/github.com/elastic/beats:/source
-v /home/sb/go/src/github.com/elastic/beats/packetbeat/build:/build
-e PACK=packetbeat
-e BEFORE_BUILD=before_build.sh
-e SOURCE=/source
-e TARGETS="windows/amd64 windows/386 darwin/amd64"
-e BUILDID=caeb4035662e2f591157f8cee2f3956bd09f5a15
tudorg/beats-builder github.com/elastic/beats/packetbeat
Unable to find image 'tudorg/beats-builder' locally
Pulling repository tudorg/beats-builder
2016/09/18 00:34:51 Could not reach any registry endpoint
../libbeat/scripts/Makefile:348: recipe for target 'prepare-package-cgo' failed
make[1]: *** [prepare-package-cgo] Error 1
make[1]: Leaving directory '/home/sb/go/src/github.com/elastic/beats/packetbeat'
../libbeat/scripts/Makefile:384: recipe for target 'package' failed
make: *** [package] Error 2[/code]
The output is a little different, but the core of the error message is still "Could not reach any registry endpoint" which google told me earlier meant a mismatch between the image and my docker.io version:/home/sb/go/src/github.com/elastic/beats/packetbeat# make package-setup
make -C ../dev-tools/packer deps images
make[1]: Entering directory '/home/sb/go/src/github.com/elastic/beats/dev-tools/packer'
go get -u github.com/tsg/gotpl
cd /home/sb/go/src/github.com/elastic/beats/dev-tools/packer/docker/xgo-image/; ./build.sh
Sending build context to Docker daemon 318 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu:14.04
Pulling repository ubuntu
2016/09/19 17:37:58 Could not reach any registry endpoint
Makefile:44: recipe for target 'xgo-image' failed
make[1]: *** [xgo-image] Error 1
make[1]: Leaving directory '/home/sb/go/src/github.com/elastic/beats/dev-tools/packer'
../libbeat/scripts/Makefile:377: recipe for target 'package-setup' failed
make: *** [package-setup] Error 2
/home/sb/go/src/github.com/elastic/beats/packetbeat#
On a cross-compiling note: If I try to cross compile on my regular computer, an Intel i5 (i.e. "amd64"), running debian jessie, will the build system be able to handle the dependency to pcap? I.e. to the libpcap.h file and presumably also a link with the native libpcap.so...?
Note that I was able to build the packetbeat binary itself natively on the rPi (at least from the 1.3 branch. I haven't actually tried building just the binary from 5.0 yet).
However, I needed to "apt-get install libpcap-dev" on the rPi to be able to build the binary, without the libpcap-dev package the packetbeat build complained a missing libpcap.h.
Glad that you managed to compile it on your PI. About the compiling on a "regular computer". make package uses docker containers which already have all the dependencies inside for the compiling / packaging. If you do not compile it inside the docker container, I think you will also need to install libpcap.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.