From owner-freebsd-ports@freebsd.org Fri Feb 12 07:45:05 2021 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D135546CAE for ; Fri, 12 Feb 2021 07:45:05 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DcQWj3PHnz4YJV; Fri, 12 Feb 2021 07:45:05 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MacBook-Pro-449.fritz.box (p200300cd5f0ef9004ca589541ec18b5d.dip0.t-ipconnect.de [IPv6:2003:cd:5f0e:f900:4ca5:8954:1ec1:8b5d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id C6C512FB89; Fri, 12 Feb 2021 07:45:04 +0000 (UTC) (envelope-from se@freebsd.org) To: Shawn Webb Cc: Chris , freebsd-ports@freebsd.org, "Patrick M. Hausen" References: <20210211162625.k55tncjs2yjpw5jt@mutt-hbsd> <9C536D5D-6D0B-45FA-8DBF-F3FC51BC0551@punkt.de> <20210211171206.7dcplood437oqmfc@mutt-hbsd> From: Stefan Esser Subject: Re: Creating port from pre-built package Message-ID: Date: Fri, 12 Feb 2021 08:45:01 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210211171206.7dcplood437oqmfc@mutt-hbsd> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NF4UhBhXrzwkqXnemzh2uvs74BBV0pKWF" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 07:45:05 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NF4UhBhXrzwkqXnemzh2uvs74BBV0pKWF Content-Type: multipart/mixed; boundary="y8ZyR1ESch9mpXhgLs8nsvKB1vbH6LwqB"; protected-headers="v1" From: Stefan Esser To: Shawn Webb Cc: Chris , freebsd-ports@freebsd.org, "Patrick M. Hausen" Message-ID: Subject: Re: Creating port from pre-built package References: <20210211162625.k55tncjs2yjpw5jt@mutt-hbsd> <9C536D5D-6D0B-45FA-8DBF-F3FC51BC0551@punkt.de> <20210211171206.7dcplood437oqmfc@mutt-hbsd> In-Reply-To: <20210211171206.7dcplood437oqmfc@mutt-hbsd> --y8ZyR1ESch9mpXhgLs8nsvKB1vbH6LwqB Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Am 11.02.21 um 18:12 schrieb Shawn Webb: > On Thu, Feb 11, 2021 at 06:09:52PM +0100, Patrick M. Hausen wrote: >> Hi all, >> >>> Am 11.02.2021 um 18:03 schrieb Chris : >>> >>> On 2021-02-11 08:26, Shawn Webb wrote: >>>> Hey all, >>>> The Splunk universal forwarder for FreeBSD is distributed as a packa= ge >>>> tarball that you can use `pkg add` on. I'm in a position where I'd >>>> like to create a port of the package so that I can automate certain >>>> tasks. >>> Reverse engineer a package? I think that will violate the NDA you >>> signed. ;-) >>> >>> Really. Unless the package is simply a wrapper of a binary blob. You'= ll >>> need to *build* the port, as part of the package creation process. >>> That is, unless I've *completely* misunderstood your intent here. :-)= >> >> The binary package is provided by the software manufacturer without >> source code. >> >> Still one might want to have a port available so one can put the port >> in poudriere and have it available in one's own package repo. >> >=20 > Right, I'm not aiming to recompile the software. I'm looking to simply > create a new package.txz with the pre-built artifacts included. I shouldn't be too hard to create a port, just be careful to consider the architecture dependency of the binary package you are using. If multiple architectures and OS releases are supported, then you'll have to create the package name from those parameters and provide distinfo data for all supported combinations of architecture and OS release. You can override the name of the DISTINFO_FILE in the port's Makefile to have separate distinfo files per arch/version. In the port's Makefile extract the contents of the correct package into the stage directory, have dummy targets for phases that are not reuquired (e.g. an empty do-stage to have the stage done marker set in the ${WRKSRC} directory) and provide a pkg-plist (possibly multiple variants selected by the PLIST variable, if there are arch/version specific differences). Use ONLY_FOR_ARCH and IGNORE to limit the package building to those architectures and releases that are supported, to prevent package fall-out messages and to give ports users a reasonable error message when trying to build the port on an unsupported system. The generated package will have the meta-data from your port. If you want to preserve some meta-date from the pre-built package, then extract it from the extracted distfile, e.g. in the build phase. Else use NO_BUILD to suppress this and possibly other phases that are not required (empty dummy targets will do as well). Regards, STefan --y8ZyR1ESch9mpXhgLs8nsvKB1vbH6LwqB-- --NF4UhBhXrzwkqXnemzh2uvs74BBV0pKWF Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmAmMf0FAwAAAAAACgkQR+u171r99UQI RwgAuNqCkznUh0CUSKbNro6tvcOEqPDgNtek/WyDTyV8nDhUmrOVRKDZEPbrc+dWo0CLB5kHuueK +VT80UfBdPpB2Hu2qiWJl1kRZINGZdPVOSNo0Ou9gtTw91Fue7Nm9KdLdZcRwNNcmSkb/rpI7Nf2 T3WwWUTRsyZUYO/Qz0QB+Hn0LrOnL0jhoVZ3gWFsMdsaQORxj9sXkt7sKdSvNbtQlMF5osWfRVUJ mm4LVJLWtwfZrq4B9JU2EK9E3G/TtzQlypKPaG7ncgV21WRhJcJVXAXxWXJFYRNtcbUMGjauI8g7 OHIE4uCpJqfbfRunuj/D2aSmyVxDw29rtNMUZCsVvQ== =5SEL -----END PGP SIGNATURE----- --NF4UhBhXrzwkqXnemzh2uvs74BBV0pKWF--