poudriere with custom packages

Michael Gmelin freebsd at grem.de
Thu Jul 16 09:06:06 UTC 2015


On Thu, 16 Jul 2015 08:09:39 +0100
Matthew Seaman <matthew at FreeBSD.org> wrote:

> On 16/07/2015 04:49, Aristedes Maniatis wrote:
> > I have a custom built package which I'm building outside the FreeBSD
> > ports system (using pkg-create commands). How can I add that package
> > to a poudriere managed repository so that it appears in the package
> > index and can be easily installed like any other package?
> > 
> > Thanks for any help
> 
> I can think of two ways to handle this:
> 
> 1) Manually build your own repo containing just your custom package.
> Simply copy the package .txz to a directory accessible from your
> webserver (or however you want to publish the repo.)  Then run
> 'pkg repo' in that directory.  See pkg-repo(8) for the gory details.
> 
> This fails on your 'poudriere managed' requirement, but it's pretty
> simple.  You could even add your own package to the directory that
> poudriere creates and then use pkg repo to rebuild the catalogue
> there.
> 
> 2) Integrate your custom package into the ports tree.  You can add a
> 'Makefile.local' in /usr/ports containing something like:
> 
>    SUBDIR += myports
> 
> which adds 'myports' as a new category for your custom stuff.  Then
> just mimic the layout from any of the other categories.  This
> obviously works best if your custom stuff uses the standard ports
> machinery to build your package.  You can then add
> 'myports/mypackage' to the list of what poudriere should build.
> 
> I'd be interested to hear about how you are creating packages outside
> the ports tree.  This is something we'd like to facilitate, but at the
> moment pkg(8) and the ports are deeply entwined and there isn't much
> useable documentation or prior art for how to do it 'by hand'.
> 

Hi Matthew, hi Ari,

We're planing to use poudriere to build our custom packages as well and
it seems like we're in a similar situation as Ari, therefore let
me explain what we're doing right now (I'm quite curious if their
process looks roughly the same). We've been doing this for a few years
now, porting it from pkg_tools to pkg was quite easy:

cmake and a custom wrapper script are used to build our custom code and
stage it in a local directory. That directory already resembles the
final directory layout, we then write +DESC and +MANIFEST using a
shell script.

During this process package dependencies are determined used "ldd -f
pkg which -q %p\\n $DISTDIR/bin/* $DISTDIR/lib/*". This is probably a
bit problematic for poudriere, as it needs to know dependencies
beforehand.

Finally "pkg create -o $PACKAGEDIR -r $DISTBASE -m $DISTBASE" is called
to create the package.

($DISTBASE contains +MANIFEST and +DESC, $DISTDIR is a directory within
$DISTBASE).

One idea is to add a "port-skeleton" target to our build system, which
emits a Makefile containing (BUILD|RUN)_DEPENDS automatically. Another
question is how to handle check-out of the code from our source
repositories and the fact that it's more or less continuous integration
at that point (meaning that distinfo is changing all the time). It
might be easiest to have a job that checks out all repos on a regular
basis, tars them up and writes them to a webserver on localhost and
then runs "make makesum" on all custom ports outside of poudriere
before starting a build.

- Michael


-- 
Michael Gmelin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 603 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20150716/563100b9/attachment.bin>


More information about the freebsd-ports mailing list