From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Help creating zeek recipe #yocto To: yocto@lists.yoctoproject.org From: gary@missionsecure.com X-Originating-Location: Charlottesville, Virginia, US (216.197.64.240) X-Originating-Platform: Linux Firefox 78 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Fri, 03 Jul 2020 14:22:40 -0700 Message-ID: Content-Type: multipart/alternative; boundary="ZfFd3nDW5p0VgI17w3ZM" --ZfFd3nDW5p0VgI17w3ZM Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I would like to create a recipe for zeek (a network security monitoring too= l, https://zeek.org/). It fails while compiling because it cannot find a ex= ecutable that it needs to install called binpac.=C2=A0 binpac is included i= n the zeek repo and is normally built as part of the zeek build.=C2=A0 I've= created a recipe for binpac and included the native class and included bin= pac-native in the zeek recipe.=C2=A0 The binpac-native builds. binpac_git.bb SUMMARY =3D "BinPAC is a high level language for describing protocol parse= rs and generates C++ code." HOMEPAGE =3D "https://github.com/zeek/binpac" LICENSE =3D "Unknown" LIC_FILES_CHKSUM =3D "file://COPYING;md5=3D5139995cafc8b5273b85dd8bab50985= 5" SRC_URI =3D "git://git@github.com/zeek/binpac.git;protocol=3Dssh" # Modify these as desired PV =3D "0.55-8+git${SRCPV}" SRCREV =3D "9c3211ff121ddc677d0ed8bd3a85783f87921cce" BBCLASSEXTEND =3D "native" DEPENDS +=3D "bison-native \ flex-native \ " S =3D "${WORKDIR}/git" inherit distutils zeek_3.1.4.bb: # Zeek # Install reference: # https://docs.zeek.org/en/current/install/install.html SRC_URI =3D "https://download.zeek.org/zeek-${PV}.tar.gz" SRC_URI[md5sum] =3D "b9d82fbd4964ea2d49c31653726d0dc0" SRC_URI[sha256sum] =3D "d72b8bcba0def6ba93b650d6f25896d9326ee0b02113b80696= f47b08bd73e964" DEPENDS =3D "\ binpac-native \ bifcl-native \ swig-native \ bison-native \ flex-native \ sed \ libpcap \ zlib \ openssl \ " RDEPENDS_${PN} +=3D "\ bash \ python \ libpcap \ openssl \ bind \ zlib \ " inherit cmake pythonnative # So that cmake can find sed OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM =3D "BOTH" # Specify any options you want to pass to cmake using EXTRA_OECMAKE: EXTRA_OECMAKE =3D "" --ZfFd3nDW5p0VgI17w3ZM Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable I would like to create a recipe for zeek (a network security monitoring too= l, https:= //zeek.org/). It fails while compiling because it cannot find a executa= ble that it needs to install called binpac.  binpac is included in the= zeek repo and is normally built as part of the zeek build.  I've crea= ted a recipe for binpac and included the native class and included binpac-n= ative in the zeek recipe.  The binpac-native builds.

binpac= _git.bb

HOMEPAGE =3D "https://github.com/zeek/bin= pac"

LICENSE =3D "Unknown"
LIC_FILES_CHKSUM =3D "file://COP= YING;md5=3D5139995cafc8b5273b85dd8bab509855"

SRC_URI =3D "git://= git@github.com/zeek/binpac.git;protocol=3Dssh"

# Modify these as= desired
PV =3D "0.55-8+git${SRCPV}"
SRCREV =3D "9c3211ff121ddc67= 7d0ed8bd3a85783f87921cce"

BBCLASSEXTEND =3D "native"

= DEPENDS +=3D "bison-native \
       = ;     flex-native \
     =       "
S =3D "${WORKDIR}/git"

inh= erit distutils

zeek_3.1.4.bb:
# Zeek
# Install referen= ce:
# https://docs.zeek.org/en/current/insta= ll/install.html
SRC_URI =3D "https://download.zeek.org/zeek-${PV}.= tar.gz"
SRC_URI[md5sum] =3D "b9d82fbd4964ea2d49c31653726d0dc0"
SR= C_URI[sha256sum] =3D "d72b8bcba0def6ba93b650d6f25896d9326ee0b02113b80696f47= b08bd73e964"

<lots of license lines>

DEPENDS = =3D "\
           b= inpac-native \
         &= nbsp; bifcl-native \
        &= nbsp;  swig-native \
       &n= bsp;   bison-native \
      &n= bsp;    flex-native \
     &nb= sp;     sed \
      =      libpcap \
      = ;     zlib \
      &= nbsp;    openssl \
      =     "

RDEPENDS_${PN} +=3D "\
  &nb= sp;            =     bash \
       &n= bsp;           python \            = ;       libpcap \
   &nbs= p;            &= nbsp;  openssl \
        =            bind \
&n= bsp;            = ;      zlib \
     &= nbsp;            "

inherit cmake pythonnative

# So that cmake can f= ind sed
OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM =3D "BOTH"
# Specify = any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMA= KE =3D ""

--ZfFd3nDW5p0VgI17w3ZM-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bsmtp.bon.at (bsmtp.bon.at [213.33.87.14]) by mx.groups.io with SMTP id smtpd.web12.53756.1594025512004188549 for ; Mon, 06 Jul 2020 01:51:52 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: streamunlimited.com, ip: 213.33.87.14, mailfrom: quentin.schulz@streamunlimited.com) Received: from qschulz (vpn.streamunlimited.com [91.114.0.140]) by bsmtp.bon.at (Postfix) with ESMTPSA id 4B0fSh0MYvz5tlW; Mon, 6 Jul 2020 10:51:47 +0200 (CEST) Date: Mon, 6 Jul 2020 10:51:46 +0200 From: "Quentin Schulz" To: gary@missionsecure.com Cc: yocto@lists.yoctoproject.org Subject: Re: [yocto] Help creating zeek recipe #yocto Message-ID: <20200706085146.hyrjcozgvxmuvj45@qschulz> References: MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20180716 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Gary, On Fri, Jul 03, 2020 at 02:22:40PM -0700, gary via lists.yoctoproject.org= wrote: > I would like to create a recipe for zeek (a network security monitoring= tool, https://zeek.org/). It fails while compiling because it cannot fin= d a executable that it needs to install called binpac.=A0 binpac is inclu= ded in the zeek repo and is normally built as part of the zeek build.=A0 = I've created a recipe for binpac and included the native class and includ= ed binpac-native in the zeek recipe.=A0 The binpac-native builds. >=20 > binpac_git.bb >=20 > SUMMARY =3D "BinPAC is a high level language for describing protocol pa= rsers and generates C++ code." > HOMEPAGE =3D "https://github.com/zeek/binpac" >=20 > LICENSE =3D "Unknown" > LIC_FILES_CHKSUM =3D "file://COPYING;md5=3D5139995cafc8b5273b85dd8bab50= 9855" >=20 > SRC_URI =3D "git://git@github.com/zeek/binpac.git;protocol=3Dssh" >=20 > # Modify these as desired > PV =3D "0.55-8+git${SRCPV}" > SRCREV =3D "9c3211ff121ddc677d0ed8bd3a85783f87921cce" >=20 > BBCLASSEXTEND =3D "native" >=20 > DEPENDS +=3D "bison-native \ > flex-native \ > " > S =3D "${WORKDIR}/git" >=20 > inherit distutils >=20 I'm not sure setup.py is supported for the project as it's empty? So distutils does not look correct to me. You have a makefile (inherit no classes, that;s the default) or Cmakelists (inherit cmake) or ./configure (inherit autotools, though it expects a configure.ac and not a configure directly). Then, what you want to check is that your binpac binary is installed in ${WORKDIR}/sysroot-dirs. If it's not, you've to find where the binary is installed (if it is) and fix the Cmake/autotools scripts to install in the correct directory (one of the directories in STAGING_DIRS as a "subdirectory" of ${D}) or add said directory to the ones installed in other recipes' sysroot (STAGING_DIRS). Quentin