Montag, 24. September 2012

HOWTO: Set up a Maemo 5 Scratchbox SDK VM (and upload packages)

I've somehow lost my good old "MaemoSDK" VirtualBox VM, so while I'm setting up the new VM, here are the instructions in case I or somebody else needs to do that again.

The goal: To have a nice VM (more lightweight than the Maemo SDK VMs offered online) that one can SSH into and build packages for Maemo 4 and Maemo 5:
  1. Get the Debian i386 netinst CD image from http://www.debian.org/CD/netinst/
  2. Create a new VirtualBox VM (Name: MaemoSDK, Operating System: Linux, Version: Debian) - the default size (8 GB) should be okay, less is also okay
  3. Go to Settings, Storage, IDE Controller, select the .iso you downloaded in step 1
  4. Power up the VM, select "Install" in the menu
  5. Set the hostname to "maemosdk"
  6. Use an empty root password (you can use "sudo" from your user)
  7. Full name for the new user: Maemo Developer
  8. Username for the new user: user
  9. Password for the new user: maemo
  10. Use the default options for partitioning, and wait until the base system is installed
  11. Select the "SSH Server" option when the Debian Installer offers it
  12. Install GRUB into the MBR of the VM
  13. Go to the Maemo 5 SDK Download Page on Nokia Developer
  14. From the SDK Download page, get the Scratchbox installer script (maemo-scratchbox-install_5.0.sh) and the SDK installer script (maemo-sdk-install_5.0.sh):
    http://repository.maemo.org/stable/5.0/maemo-scratchbox-install_5.0.sh
    http://repository.maemo.org/stable/5.0/maemo-sdk-install_5.0.sh 
  15. Login to your new VM, then wget the two scripts above
  16. sudo sh maemo-scratchbox-install_5.0.sh
  17. sudo sh maemo-scratchbox-install_5.0.sh -u user
  18. Log out and log back in again
  19. sh maemo-sdk-install_5.0.sh
  20. When asked, I chose Full + Development packages, but feel free to chose a more minimal variant (in that case, you might have to install -dev packages later on as build-dependencies)
You can also read up on how to set up SSH agent forwarding in the VM, so that you don't need to store your SSH key on the SDK VM.

As for building gPodder from source in this SDK, here are the instructions:
  1. scratchbox
  2. vi /etc/apt/sources.list # then add these entries:
    deb http://repository.maemo.org/extras-devel fremantle free non-free
    deb-src http://repository.maemo.org/extras-devel fremantle free
  3. fakeroot apt-get install python2.5 python-feedparser python-mygpoclient python-dev maemo-optify
  4. git clone git://github.com/gpodder/gpodder.git
  5. cd gpodder
  6. git checkout origin/maemo-5
  7. dpkg-buildpackage -rfakeroot -S -sa -I.git -i.git # for the source upload
  8. dpkg-buildpackage -rfakeroot -b # for the binary to test locally
You can also build the Maemo 4 (N800/N810) package by replacing "maemo-5" with "maemo-4" in the "git checkout" command.

To get files out of the SDK without setting up fancy SSH stuff, you can also just use netcat (on the target: nc -l 9999 | tar xzv, on the source: tar czv /path/to/files/ | nc a.b.c.d 9999).

To upload files to Maemo Extras, follow the instructions at Uploading to Extras.

Keine Kommentare: