1. Install the latest version of Spotify on the iPhone (version 0.4.x)
  2. 'Jailbreak' your iPhone to gain full access to the filesystem
  3. Edit the hosts file (using SSH or MobileTerminal and a text editor) as described on the wiki
  4. Launch Spotify, enable "Last.fm scrobbling" and enter your Libre.fm username and password.