Date: Wed, 06 Oct 2010 22:18:54 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: third-party ports/packages sources Message-ID: <4CACE7BE.6040709@infracaninophile.co.uk> In-Reply-To: <20101006180601.GA75552@guilt.hydra> References: <20101006180601.GA75552@guilt.hydra>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAB38A3DEB915F6E3FD79DB75 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/10/2010 19:06:01, Chad Perrin wrote: > Is there some way to set up a third-party online source for ports and/o= r > packages that allows users to do the same kinds of things they can do > with the official ports system? I mean, for instance, using portversio= n > to check whether there are new versions available (or an equivalent > operation) and possibly even checking for security issues via portaudit= =2E >=20 > I see, looking at the manpage for portversion, this: >=20 > PKG_DBDIR Alternative location for the installed package data= base. > The default is ``/var/db/pkg''. >=20 > PORTSDIR Alternative location for the ports tree and the por= ts > database files. The default is ``/usr/ports''. >=20 > I also see some stuff in pkgtools.conf comments that might pertain to > this sort of thing, but I'm not entirely clear yet on how this might be= > used to access a third-party repository for ports without breaking norm= al > operation. If there's a tutorial out there that would explain how to d= o > something like this, I have not yet found it. You certainly can do this sort of thing. If you want to create a local pkg repository all it is basically is a HTTP or FTP server wrapped around the file structure generated by 'make package' under /usr/ports/packages. Maybe with some extra depth in the path to account for CPU architecture and OS version. You can mirror pkgs from the official sites or you can compile your own -- in which case, check out the Tinderbox application. Then you just need to set some environment variables such as PKG_PATH, PACKAGEROOT or PACKAGESITE so that the various client-side tools will use your personal pkg repo. See the ENVIRONMENT section in pkg_add(1). Now, you could create your own entirely independent ports tree if you felt that way inclined, but why would you want to? Most freely available software is already available from the ports, and you don't want to duplicate the maintenance burden of any of that. Instead, a better approach is to use the hooks provided within the ports system to add your own local patches, add extra ports or even entire extra categories of ports to the standard tree. The key point here is that you can create a Makefile.local at any level in the ports tree and it will be included by the regular ports Makefile at that level. There are several other potential Makefile filenames you could use similarly, which the ports looks for and will include given various criteria: the best way to learn about them is to study the code in /usr/ports/Mk/bsd.ports.mk. If your local ports are any good, then do submit them for inclusion in the main ports collection. Pro bono publico as lawyers quite rarely say.= You have to be a bit careful with updating mechanisms if you customise your ports like this: portsnap for one is quite unfriendly to "foreign" files within the ports tree, but csup works fine. Portaudit is a bit harder -- it's processed out of the vuxml sources automatically, and there isn't a simple mechanism for adding local modifications. You could duplicate the whole portaudit generation process with some local tweaks if you needed to, but on the whole I think just using the centrally generated version would be good enough for the vast majority of people. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matthew@infracaninophile.co.uk Kent, CT11 9PW --------------enigAB38A3DEB915F6E3FD79DB75 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkys58kACgkQ8Mjk52CukIz02ACgh2N8i8UfHPuA8c9W+nMT2SI/ 220An1OkYITiLFi42d8Cs7cWP8gcnsPH =asTi -----END PGP SIGNATURE----- --------------enigAB38A3DEB915F6E3FD79DB75--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CACE7BE.6040709>