The officially recommended way to create .deb packages for the maemo platform is to use dpkg-buildpackage within Scratchbox. For me, Scratchbox is a pain to install for two main reasons. First, there is no RPM package of the scratchbox environment, so apparently I need to run some scripts as root, let my system get a little messier, which I am not willing to do. Second, the docs advise to turn off SELinux in order to get the Scratchbox environment to work, which again I am not keen to do.
If you are using Debian or Ubuntu, there is probably a cleaner approach, but I am currently using Fedora, so I just rolled my own method using the command line. Copy the following files to your project directory:
Then rename deb_hand_example.mak to Makefile, and adjust the variables in this file to match your project.
Setup the required files (referenced in these makefiles) for packaging. There some pointers on this in the Python Maemo howto in the packaging section.
Note the ${PACKAGE_DIR}/data: ${SOURCE_DIR}
target in the makefile. This must be modified to layout all files as you wish them to be installed on the target system. The example makefile rule should be a reasonable guide.
Then once you are ready, do ‘make PACKAGE_DIR= deb’ and if all goes well a shiny new deb package should be sitting in release_dir. If not, fix your settings in the Makefile, run ‘make clobber’ and then try again.