Ok, the subject is probably a bit ambitious, and I'm sure this is obvious to some, but since it took me a long time to figure it out from various bits of info, I thought this might be useful to a few people.
Why should I do this ?
The cloud9 image on the BeagleBone actually contains a pretty good compilation/development environment, and you should be able to do quite a bit of work directly on the board. Nevertheless, on a modern machine you will go dozens of times faster when compiling, and in the long run you will save lots of time when creating new images if you build your custom pacakges during the overall image building process, rather than recompile your pacakges manually each time.
So, how do I create/add my own packages on the Beaglebone?
This describes what I did to create a ".ipk" for the icecast server which I needed on my beaglebone. Your mileage may vary...
Create a local directory - outside of setup-scripts if possible - where you will put your ".bb" recipes. I used ~/Documents/Beaglebone/ed-local/ on my system.
In that directory, create subdirs with the name of the package you want to create, and inside those, the BB recipe. Note on the example below how the version number is in the BB recipe, this filename format is used by the BB recipe to download the correct version. For instance:
So what is important there, and what is not? You absolutely have to put the correct MD5SUM variables in your BB recipe, Angstrom insists on it. No worries though, just put wrong values to start with, and do a bitbake your_package_name -c fetch which will fail but will tell you the correct value of the MD5/SHA2 checksums, you will then be able to put the right values in your recipe. You also have to define at least one license file, along with its checksum, otherwise the build process will complain. You will also need to put the correct dependencies in the definitions, and any extra configure options as shown in the example. But it's not that hard, really, at least for most simple packages.
Now that your recipe is ready, bake it! bitbake icecast in this example. The resulting "IPK" will be located in build/tmp-angstrom_2010_x-eglibc/deploy/ipk/armv7a . Put it on your BeagleBone, and do a opgk install my_package.ipk , everthing should work, hopefully!