[PC-BSD Pbi-dev] Automating PBI module creation?

Kris Moore kris at pcbsd.org
Mon Jun 21 10:08:48 PDT 2010

On 06/21/2010 12:32, Jesse Smith wrote:
> Has anyone looked at the possibility of automating PBI module creation?
> > From what I've seen thus far, and I admit I've only tried putting
> together a few modules, it looks like a lot of the process could be
> automated.
> > From my limited experience, it seems that making a module basically
> consists of making a port, figuring out which files it installs on the
> system and then editing three or four files.
> I think a small program could probably do something like
> cd to a port directory
> run make install
> Check to see if any errors occurred thus far
> See which files have been installed
> Create a simple module template with pbi.conf, copy-files and kmenu
> entries updated.
> Bundle the new module into a tarball.
> The only snag I see in the whole process is some ports ask the user for
> config options during the "make" process. But not all do. (Is there a
> "make" option to take config defaults and skip the user interaction?)
Yep, set 'BATCH=yes' in make.conf

> Does anyone else think this is a viable approach to building large
> numbers of PBIs from ports? If so I'd like to take a stab at creating
> such a program/script. I think it could free up developer time in the
> long run.
> - Jesse
This is a viable approach, however the problem occurs when trying to 
figure out the main binary executable / icon / mime data. The ports tree 
simply doesn't contain this information and some user interaction is 
required to make these associations.

That being said, for PC-BSD 9.0 I've done a large re-write of the PBI 
format, which greatly assists in this process. Modules are very minimal 
now, and most of the information can be pulled from the port & built 
with a single command. Also included is a conversion tool, which can 
take our current modules and convert to the new format easily.

However, if you want to work on a script which automates the process of 
building a module, go for it! It could pull all the info possible from a 
port, and then prompt for the missing bits. It would come in handy for 
starting a new module, that's for sure :)

(Also, the copy-files stuff isn't necessary usually now, so one less 
step to do)

Kris Moore
PC-BSD Software

More information about the Pbi-dev mailing list