How to build the App Inventor 2 installer for GNU/Linux
Hal Abelson, 10/11/14

For best compatibility, do this building on a 32-bit system.

=========

Create the following directory structure containing the appropariate files
Here <root> ism for example, appinventor2-setup_1.1

DIRECTORY STRUCTURE AND REQUIRED INSTALLATION FILES

<root>/
	appinventor/
	  commands-for-appinventor
	  from-Android-SDK
	  extras
	debian/
		appinventor2-setup.install
		changelog
		compat
		control
		debhelper.log
		rules
	useful-extra-stuff
	notes


appinventor/commands-for-appinventor
    is the actual directory of
    commands that appinventor runs on the client machine, including, adb,
    aiStarter, run-emulator, and others.   Best to get them from a current
    installation and  modity them as required.   Make sure to test these
    on Linux to validate that they are good executables.  For compatibility
    you should use 32-bir binaries for adb and emultator and mksdcard.
    Test these on a 32-bit machine to make sure they run.

appinventor/from-Android-SDK
    Are the required  pieces of the Linux SDK, which is a
    platforms/android-<version> folder with images and skins.  Check
    the Mac version to see what's needed, and get these from the
    Google installation (make sure to get the Linux version).

appinventor/extras
    This contains the data to build the initial emulator image.  Get
    it from the Mac installer package or a previous Linux installer

debian/
    Get these from a previous Linux installer and modify as required.
    You'll probbly need to consult the dpkg documentation.

useful-extra-staff
    contains only an apk for an old version
    of text-to-speech, which might need to be installed in the emulator
    image.  This might be obsolete and unnecessary.


notes
    are these notes

OTHER LIBRARIES
    in order to run dpkg, you'll need to make sure the machine you are
    building on has the following pacakges, which you can install with apt-get
      debhelper
      fakeroot
      dpkg-dev

PYINSTALLER AND BUILDING AISTARTER
   You'll need to build a binary for aiStarter, which should be
   included in the appinventor/commands-for-appinventor folder.
   You build this using pyinstaller, which needs to be installed on
   your machine.   You'll also need the aiStarter.py build script, and bottle.py.
   You can get both of these from the appinventor source distribution on Github
   in appinventor/misc/emulator-support.

   Put the two .py files in some convenient place (e.g. Desktop) and execute
       pyinstaller aiStarter.py -F -p .

   This should create a folder dist/ that contains aiStarter.   Test
   it before moving it to commands-for-appinventor

BUILDING THE PACKAGE

Once all of the above has been set up, you build the installation
package with 

cd <root>
dpkg-buildpackage -rfakeroot -tc

The resulting packages will be in parent directory of <root>.  You
should grab the .deb package installer file and the gzipped tar file,
and put them in the appropariate location for public downloading.

