UbuntuPorting

From Amahi Wiki
Revision as of 08:36, 19 March 2010 by Anzenketh (talk | contribs) (Formatting changes)
Jump to: navigation, search

This page is being edited actively and a lot of sections are missing currently

Current state

We just started porting Amahi to Ubuntu. The support is highly experimental. There are a few important things to be fixed before you can run it with minimal tweaking. Please don't try it on a production server yet. We are using Ubuntu 9.04 (jaunty) Desktop 32 bit for development. We strongly recommend you to use the same for experiments. You can download this version from here.

Requirements

You may want to have two different installations of Ubuntu.

  • A development platform, running Ubuntu 9.04 Desktop 32 bit and/or 64 bit with the recommended development packages installed.
  • An Amahi sandbox, running Ubuntu 9.04 Desktop 32 bit preferably under VirtualBox.

Please don't install the Amahi packages on the development platform as this might break your networking.

Setting up the development platform

  1. Install Ubuntu 9.04 Desktop 32 bit.
  2. Install essential build toolchain.
    1. sudo apt-get update
    2. sudo apt-get install build-essential
    3. sudo apt-get install devscripts
    4. sudo apt-get install debhelper
    5. sudo apt-get install fakeroot
    6. sudo apt-get install lintian
  3. Install git. # sudo aptitude install git-core
  4. Read Ubuntu packaging guide to get an idea of other additional packages that you may want to install to create Ubuntu packages. I will list the packages to make your part easier at a later point.

Setting up the Amahi sandbox

  1. Install Sun VirtualBox. # sudo aptitude install virtualbox-ose
  2. Open VirtualBox and create a new guest platform for Ubuntu and install Ubuntu 9.04 Desktop 32 bit.
  3. Install VirtualBox guest additions in your Amahi sandbox.
  4. Setup VirtualBox folder sharing between your development platform and Amahi sandbox.

Amahi source code

On your development platform, download Amahi source code from our git repository. Follow these steps to build Ubuntu packages.

Update Changelog

1. If you are repackaging for a new version Run dch -v with the version number currently in the makefile. Where you run the command depends on if you are changing hdactl or hda-platform.

        # cd deb/ubuntu/karmic/hdactl
               OR
        # cd deb/ubuntu/karmic/hda-platform
        # dch -v <version number>
  Add the changes that you made to the system. If you are just updating for a new version state so.
  If you are not changing the version number run dch -a. Where you run the command depends on if you are changing hdactl or hda-platform.
       # cd deb/ubuntu/karmic/hdactl
               OR
       # cd deb/ubuntu/karmic/hda-platform
       # dch -a

NOTE: If you are just building a .deb for your own testing you can just run make deb or continue to step 2.

2. To build hdactl package, change to 'platform/hdactl' directory and

  run 'make deb'.
      # cd platform/hdactl
      # make deb
  You will find the .deb file generated under platform/hdactl/release
  directory.

3. To build hda-platform package, change to 'platform/platform' directory and

  run 'make deb'.
      # cd platform/platform
      # make deb
  You will find the .deb file generated under platform/platform/release
  directory.

Architecture differences

  • Apache runs as 'www-data' instead of 'apache'.
    • Fix - Edit /var/hda/platform/html/script/install-app the following:
  uid = Etc.getpwnam("apache").uid
  • Alternative Fix:
    • Edit the file /etc/apache2/envvars to set the apache user to 'apache' as opposed to 'www-data'

Post install gotchas (asp's notes)

After building the deb packages above and installing using the Ubuntu pkg installer, was able to then startup hdactl (using '/etc/init.d/hdactl start') and then http;//hda worked.

  1. Had to install the pluginfactory gem by running 'gem install -no-rdoc -no-ri pluginfactory'
  2. Noticed that Apache runs as 'www-data' on Ubuntu instead of 'apache' user like on Fedora. Amahi-app-installer.log indicated 'apache' user was not found after attempting to install an app on Application tab of platform.

Considerations

Instead of using FastCGI, perhaps package Amahi with capability to use Ubuntu's native phusion passenger (aka mod_rails) package.

Add the following line to the Third Party Software Sources:

 deb http://apt.brightbox.net hardy main

(The simplest way to do that is to create a file in /etc/apt/sources.list.d/ containing the deb instruction, and then run 'apt-get update').

Once you've done this then you can install Phusion Passenger by running:

 apt-get install libapache2-mod-passenger


This page is being edited actively and a lot of sections are missing currently