[arch-commits] Commit in beats/trunk (PKGBUILD gopacket-identifiers.patch)

Massimiliano Torromeo mtorromeo at archlinux.org
Mon Mar 4 09:34:57 UTC 2019


    Date: Monday, March 4, 2019 @ 09:34:56
  Author: mtorromeo
Revision: 437511

upgpkg: beats 6.6.1-1

Updated to version 6.6.1 and fixed encoding of kibana dashboards

Added:
  beats/trunk/gopacket-identifiers.patch
Modified:
  beats/trunk/PKGBUILD

----------------------------+
 PKGBUILD                   |   30 ++++++++++++++++----
 gopacket-identifiers.patch |   62 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-03-04 08:27:33 UTC (rev 437510)
+++ PKGBUILD	2019-03-04 09:34:56 UTC (rev 437511)
@@ -3,7 +3,7 @@
 
 pkgbase=beats
 pkgname=(filebeat packetbeat metricbeat heartbeat-elastic auditbeat journalbeat)
-pkgver=6.6.0
+pkgver=6.6.1
 pkgrel=1
 pkgdesc='Data shippers for Elasticsearch'
 arch=('x86_64')
@@ -10,11 +10,12 @@
 url='https://www.elastic.co/products/beats'
 license=('Apache')
 depends=('glibc')
-makedepends=('go-pie' 'git' 'libpcap' 'rsync' 'python' 'audit')
+makedepends=('go-pie' 'git' 'libpcap' 'rsync' 'python2-virtualenv' 'audit')
 optdepends=('elasticsearch: for standalone installation'
             'python: for migration script')
 source=("https://github.com/elastic/beats/archive/v$pkgver/beats-$pkgver.tar.gz"
         "golang-crypto.patch" # golang/crypto patch
+        "gopacket-identifiers.patch"
         "filebeat.sysusers"
         "filebeat.service"
         "packetbeat.service"
@@ -23,8 +24,9 @@
         "auditbeat.service"
         "journalbeat.service"
         "tmpfile.conf")
-sha256sums=('0e55beab8945ba4c8035afcd22ae263d2c955dfc47e420d5231780ab53391342'
+sha256sums=('3da3a445927b84b64405470018aaa941f42f0bec571f265a0b621bfb218278f1'
             '75583a195b43d7345449bbac60359bf54661ccbd699386a6e59bb483c6054338'
+            'f0570a83aa59d28edfa9efd6b8d7884f79306b69f3a80f157314cc1896f40a99'
             '33feb3690f8b31563cc1e2da557c2aa326501ce9ccd7e0a142036902bfdb05ff'
             '4d5394cfe3299c9a6af5ac34c1ad4bcdc2e79162379cccbf00fb414eb28253c0'
             '9f4e33fc768d3500fa3428dcbfda241c6473a2cae8cc4dbadf8f61ca9f2bbec5'
@@ -35,6 +37,11 @@
             'f29361772f23ec42bb15b5e0ca7e93f17fe00d31cf08a9e2c0d0ab27f2277bbc')
 
 prepare() {
+    mkdir -p "$srcdir/bin"
+    ln -s /usr/bin/python2 "$srcdir/bin/python"
+    ln -s /usr/bin/pip2 "$srcdir/bin/pip"
+    ln -s /usr/bin/virtualenv2 "$srcdir/bin/virtualenv"
+
     export GOPATH="$srcdir"/gopath
     mkdir -p "$GOPATH"
     go get golang.org/x/sys/cpu
@@ -42,6 +49,9 @@
     cd "$srcdir"/beats-$pkgver/vendor/golang.org/x/crypto
     patch -p1 -i "$srcdir"/golang-crypto.patch
 
+    cd "$srcdir"/beats-$pkgver/vendor/github.com/tsg/gopacket
+    patch -p1 -i "$srcdir"/gopacket-identifiers.patch
+
     cd "$srcdir"/beats-$pkgver
 
     # Avoid installing extraneous configs
@@ -64,13 +74,13 @@
 
 build() {
     export GOPATH="$srcdir"/gopath
-    export PATH="$GOPATH/bin:$PATH"
+    export PATH="$GOPATH/bin:$srcdir/bin:$PATH"
 
     cd "$GOPATH"/src/github.com/elastic/beats
     git init # git root required by one of the build scripts
 
     cd libbeat
-    make fields
+    make update
 
     for beat in ${pkgname[@]}; do
         beat="${beat%-elastic}"
@@ -77,10 +87,18 @@
         msg2 "Building $beat..."
         cd ../$beat
         make
-        make fields
 
         if grep -Eq '^kibana:' Makefile; then
             make kibana
+        fi
+
+        if [ "$beat" = "auditbeat" ]; then
+            make fields
+        else
+            make update
+        fi
+
+        if grep -Eq '^kibana:' Makefile; then
             mv _meta/kibana{.generated,}
         fi
     done

Added: gopacket-identifiers.patch
===================================================================
--- gopacket-identifiers.patch	                        (rev 0)
+++ gopacket-identifiers.patch	2019-03-04 09:34:56 UTC (rev 437511)
@@ -0,0 +1,62 @@
+diff --git a/pcap/pcap.go b/pcap/pcap.go
+index c869bcc..35fb11c 100644
+--- a/pcap/pcap.go
++++ b/pcap/pcap.go
+@@ -170,7 +170,7 @@ type InterfaceAddress struct {
+ // BPF is a compiled filter program, useful for offline packet matching.
+ type BPF struct {
+ 	orig string
+-	bpf  _Ctype_struct_bpf_program // takes a finalizer, not overriden by outsiders
++	bpf  C.struct_bpf_program // takes a finalizer, not overriden by outsiders
+ }
+ 
+ // BlockForever, when passed into OpenLive/SetTimeout, causes it to block forever
+@@ -382,7 +382,7 @@ func (p *Handle) Error() error {
+ 
+ // Stats returns statistics on the underlying pcap handle.
+ func (p *Handle) Stats() (stat *Stats, err error) {
+-	var cstats _Ctype_struct_pcap_stat
++	var cstats C.struct_pcap_stat
+ 	if -1 == C.pcap_stats(p.cptr, &cstats) {
+ 		return nil, p.Error()
+ 	}
+@@ -443,7 +443,7 @@ func (p *Handle) SetBPFFilter(expr string) (err error) {
+ 		}
+ 	}
+ 
+-	var bpf _Ctype_struct_bpf_program
++	var bpf C.struct_bpf_program
+ 	cexpr := C.CString(expr)
+ 	defer C.free(unsafe.Pointer(cexpr))
+ 
+@@ -486,7 +486,7 @@ func (b *BPF) String() string {
+ }
+ 
+ // BPF returns the compiled BPF program.
+-func (b *BPF) BPF() _Ctype_struct_bpf_program {
++func (b *BPF) BPF() C.struct_bpf_program {
+ 	return b.bpf
+ }
+ 
+@@ -549,10 +549,10 @@ func FindAllDevs() (ifs []Interface, err error) {
+ 	return
+ }
+ 
+-func findalladdresses(addresses *_Ctype_struct_pcap_addr) (retval []InterfaceAddress) {
++func findalladdresses(addresses *C.struct_pcap_addr) (retval []InterfaceAddress) {
+ 	// TODO - make it support more than IPv4 and IPv6?
+ 	retval = make([]InterfaceAddress, 0, 1)
+-	for curaddr := addresses; curaddr != nil; curaddr = (*_Ctype_struct_pcap_addr)(curaddr.next) {
++	for curaddr := addresses; curaddr != nil; curaddr = (*C.struct_pcap_addr)(curaddr.next) {
+ 		var a InterfaceAddress
+ 		var err error
+ 		// In case of a tun device on Linux the link layer has no curaddr.addr.
+@@ -818,7 +818,7 @@ func (h *Handle) NewDumper(file string) (dumper *Dumper, err error) {
+ // Writes a packet to the file. The return values of ReadPacketData
+ // can be passed to this function as arguments.
+ func (d *Dumper) WritePacketData(data []byte, ci gopacket.CaptureInfo) (err error) {
+-	var pkthdr _Ctype_struct_pcap_pkthdr
++	var pkthdr C.struct_pcap_pkthdr
+ 	pkthdr.caplen = C.bpf_u_int32(ci.CaptureLength)
+ 	pkthdr.len = C.bpf_u_int32(ci.Length)
+ 


More information about the arch-commits mailing list