I have set up a build environment on the N900 based on the scratchbox rootstrap and used this to build debian packages on the N900 itself.