Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jul 2015 09:50:22 +0100
From:      Matthew Seaman <matthew@freebsd.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Naming a locally-built version of a package
Message-ID:  <55A4CD4E.3040003@freebsd.org>
In-Reply-To: <37E1F657-243D-4F8F-A563-0C17B344D1B9@omnigroup.com>
References:  <37E1F657-243D-4F8F-A563-0C17B344D1B9@omnigroup.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--cekIi6qv51EPlEIVrr1iCWlU2Xw1RJpWb
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 07/14/15 01:19, Wim Lewis wrote:
> Is there a particular recommended practice for naming a
> locally-built package that is built with a local patch, or different co=
nfigure
> options, etc., so that it works well with the rest of the package
> system, particularly dependencies and things?

If what you're doing is tweaking an existing package built out of the
ports tree, then mostly people wouldn't bother giving it a special name.
 It's just a locally built version of the 'foobar' package.

However, it is perfectly feasible to create your own ports and overlay
on the ports tree. You can add a Makefile.local at pretty much any level
of the tree so you can add Makefile-foo to an individual port (eg. to
add new options or similar).  Similarly you can add your own ports or
even entire new categories of ports.  For the sort of thing you want to
do, you would probably want to create a slave port with the original as
master -- which is certainly the way to go if you happened to want to
build both modified and unmodified versions of the port.

> Ideally: let's say I'm building a custom version of Foo-1.3. I'd like t=
o name it such that:
>    - Existing packages that require Foo will be satisfied by my patched=
 Foo
>    - Local packages which require my patched Foo can specify a dependen=
cy on it

This is much harder.  Dependencies are registered against the PKGNAME of
a port, and that is required by pkg(8) to be unique across the ports
tree.  You'ld probably have to modify all the dependent ports to change
their RUN_DEPENDS or LIB_DEPENDS settings to point to your modified port.=


As I said above, usually people just use the original port name with
their own modifications, and it's mostly because of dependency tracking
like this.  There was discussion at BSDCan about introducing 'flexible
dependencies' -- which is essentially a list of packages (including
version number ranges) that could be used to fulfil a dependency, but
even so, you'ld still have to add your custom ports to that list.

> Less important but nice:
>    - pkg audit will still recognize my Foo as Foo and inform me of thin=
gs I should know
>    - The system won't suggest to "upgrade" my Foo to a non-patched Foo =
of a later version=20
>=20
> Is this (or a subset) possible with pkgng?

pkg audit matches against the PKGNAME as I recall, so doubtful that it
would alert you to security problems in your modified package.

However, it is certainly possible to tell pkg(8) not to mess with
locally customized packages.  See pkg-lock(8).  The mechanism is not
entirely as smooth as we would like it to be, and pkg(8) should grow the
intelligence to understand that replacing a package 'Foo with option
bar' with a package 'Foo without option bar' is something that should be
avoided wherever possible.

	Cheers,

	Matthew



--cekIi6qv51EPlEIVrr1iCWlU2Xw1RJpWb
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJVpM1YAAoJEABRPxDgqeTnuUAP/it/0EDbPDeZDOkM8PR6ejPU
BAqcAVmm0aYDwk3/CnMXAjWbVhC1yJZEXyjf9Z7TFUg7q/8NrI9rNSgJiW3hOvp0
ulO+KJc4l4jnwzo+d8D7NjOrqFUEosafeo1xCTqIb9EZmFoxlYJTM4rJUpdv6U0U
m8SmpjAAzH+rFFhlnewjo4vYWi3P+J2i/iR0ZtWhy1V3BbbZJscpWd6Lu56L5jeH
lV+kRfiNjjZDkYT5kaQpohpaGC/GqhuorENjTyH9pVPsm+w7aNtf0jodr9WXT/1M
ppXGH4ROU119sDdJS4c1U48GP9cxc6O7733uLtoJhT8jOT4vtGre1RCAmetS6Zyc
0wkvWAdFyH9Gm9huLCWIj3one4h9fBsK0fJcupGJUtuqSMUqxavy+uTGuDn+SQBN
sxLr5epcO9SIFOjmZbfdWK2dNDwbOcWFnKNN9Tk9v1PyYxMQmP5aaTFV0VYxmdQp
n9ZGUXTpYFyaQhX39EC+EXjYh99VzJHX+qhbzuE4qhGV2kqOz6MuGWLZG9prIfeN
qJj23O9E9w+kC91on2knmRFJz8Q+eJuOBTcwmeNIxD/phMv8ArZUTca/HR8ShfSR
e9UhQlI5J/2FE2UFyTBD7aMxYIVhxgSd/JVLFcuzbwRzFR7EFoRqMNRde8pNEJcQ
Ns5EY7zpCIZm3jc5dXYY
=kwJQ
-----END PGP SIGNATURE-----

--cekIi6qv51EPlEIVrr1iCWlU2Xw1RJpWb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55A4CD4E.3040003>