Android App Inventor on Fedora 13 #appinventor

Wouldn’t you know it, the App Inventor for Android “extras” software for Linux (evidently you have to wait for an exclusive invite to access the actual software which is apparently a Java applet) is only supplied as a .deb package. What’s a Fedora user to do? Aside from reflect on our own no-doubt-sordid history of such OS bigotry.

Well for one thing, you can complain. I used Twitter. If you find an email or form where someone might listen… let me know.

Also, there’s this program called alien that will try to convert your .deb to an RPM. But getting that to work is tricky itself. Alien is kind of old. None of the canned packages for it worked for me. Perhaps understandably it’s not packaged in the Fedora yum repo (probably because it’s not really considered a good idea to do this conversion; you should build the RPM from source. But you can’t do that when the source is not available. Hopefully this will be a temporary problem). So we’re back to the old make/make install business (alien has no tests, how comforting). Actually it’s a Perl project so there’s perl Makefile.PL first.

I needed a few extra packages for alien to work:

sudo yum install rpm-build perl-ExtUtils-MakeMaker

And then I could get the source for alien, and

tar zfx alien_8.81.tar.gz
cd alien
perl Makefile.PL
make install

If I were smart I’d probably package it into an RPM and install that, but I don’t have the time; I’m just happy to have it working.

Now it’s time to actually use alien for the conversion. This is using rpmbuild under the covers, and it wants to install files with root permissions, so I pretty much have to do everything with sudo.

$ sudo /usr/local/bin/alien --to-rpm appinventor-extras_1.0-1_all.deb
Package build failed. Here's the log of the command (cd appinventor-extras-1.0; rpmbuild --buildroot=/home/luke/Downloads/appinventor-extras-1.0 -bb --target noarch appinventor-extras-1.0-2.spec):
Building target platforms: noarch
Building for target noarch
Processing files: appinventor-extras-1.0-2.noarch
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /bin/sh
error: Arch dependent binaries in noarch package

D’oh! alien is trying to create a noarch package, but it’s not actually architecture independent! Guess alien isn’t smart enough to figure that out or provide a reasonable default (like, the current system architecture). And guess what, there’s no option to override that. However, there IS an option to generate everything up to the rpmbuild command and then stop – it’s the –generate option:

sudo /usr/local/bin/alien --to-rpm appinventor-extras_1.0-1_all.deb \
                          -v --generate

And alien helpfully gave us the rpmbuild command line it tried, so we just need to modify the arch:

cd appinventor-extras-1.0/
sudo rpmbuild --buildroot=/home/luke/Downloads/appinventor-extras-1.0 \
              -bb --target i686 appinventor-extras-1.0-2.spec
cd ..
sudo yum install -nogpg appinventor-extras-1.0-2.i686.rpm

And there you have it. What a pain – and just to basically put some files in /usr/google/ (looks like mainly Android emulator images). And then wait for the invite.


5 Responses

  1. Thanks for the how-to. Saved me going through the same pain as you :)

    Should point out though that your command line examples run beyond the right hand side of the post; this led to quite a bit of confusion for me!


  2. Glad it helped. Yeah, preformatted text doesn’t break at the end of the line – guess I need to get friendly with the backslashes! Of course cut and paste will get you the whole story regardless…

  3. I followed this, and I’m sad to say, it seems it will not let me connect my phone. I just put a request in for an .RPM, but we’ll find out if this’ll do anything later

    • Wes, does it work with an emulator? I imagine on a phone you have to go into systems settings and allow both USB debugging and non-market apps. But I wouldn’t know because I still don’t have access!!

  4. Thanks for the instructions, I just got my invite today and needed an RPM. I discovered when I ran Makefile.PL for alien, it created a .spec file. You can then just run rpmbuild -ba on that (after cp’ing alien.x.tgz to ~/rpm/SOURCES) and it’ll build the alien rpm…..

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: