Packaging Ubuntu

From emergent
Jump to: navigation, search
Emergent Logo
Installing and Building Emergent
  • Build from source (expert)

Steps for Packaging on Ubuntu.

Running the packaging script

  • Check out the full emergent source, and run script in package directory:
svn co http://grey.colorado.edu/svn/emergent/emergent/trunk ~/emergent2
cd ~/emergent2/package

We need to checkout the source code into a different directory than ~/emergent, as the packaging scripts will re-checkout its own version of emergent into ~/emergent, and this may conflict

Next, we need to ensure that we have quarter installed. Either we can install it in some way, or create a ubuntu package for quarter as well. For the later:

./ubuntu-motu-quarter

The quarter .deb will get created in /tmp. Once the package has been built, it can be installed with:

sudo dpkg -i libquarter0_1.0-50ubuntu1_amd64.deb

The version number might be slightly different, so you will need to adjust the name to the correct version you just built

Next we can go about actually building the emergent packages:

./ubuntu-motu-emergent

The emergent .deb package will be created in ~/

Move packages to FTP site / Ubuntu repo

Once all packages have been created and copied to your home directory on grey, you need to run scripts to move them to the FTP site and Ubuntu repository.

Do this once:

ssh you@grey.colorado.edu
svn co http://grey.colorado.edu/svn/emergent/emergent/trunk/package ~/package
mkdir ~/ubuntu_packages/trusty ~/ubuntu_packages/xenial

Make sure you copy the correct packages into the correct subdir on grey

Do this every time:

ssh you@grey.colorado.edu
cd ~/ubuntu_packages/
# Check that there is an i386 and an amd64 .deb file in each directory.
find trusty xenial -type f

# Check that there are 6 files:
#   a 32-bit and 64-bit .exe installer for Windows,
#   a 32-bit and 64-bit .dmg installer for Mac, and
#   a 32-bit and 64-bit upgrade .dmg installer for Mac.
ls -l

../package/update-ubuntu-repo.sh
update-win-mac.sh

The script update-ubuntu-repo.sh needs to be run as actual root, not just through sudo. The ubuntu repository is signed through GPG with the emergent-dev public/private key. This key is currently stored in the keyring of root, and if you run through sudo, it won't find the key. You will also need to know the password for using the private GPG key. Currently Randy and Kai have the password for that.

Updating main repo

By default, the update-ubuntu-repo.sh script only updates the latest Ubuntu repository, which is for beta releases.

For major releases of the emergent software, the main repository should also be updated.

Usage:
  ubuntu-repo-update.sh             # Update the latest repo
  ubuntu-repo-update.sh main        # Update the main repo
  ubuntu-repo-update.sh main latest # Update the main and latest repos

Building on Amazon EC2

2/5/15 - Not tested and surely won't work without updates on trusty and utopic but could be upgraded.

Instead of running 10 virtual machines, the Ubuntu build can be done on Amazon EC2 in less than 2 hours, for less than $2. See notes in package/aws/README.txt to get the environment set up. The grey.py file is omitted from svn for security reasons but can be found in /home/dpfurlani/package/aws/grey.py.

To launch all 10 Ubuntu builds simultaneously:

 rev=5400
 cd /c/src/emergent/package/aws
 rm ~/.ssh/known_hosts_amazon
 for distro in lucid maverick natty oneiric precise; do
   for bits in 32 64; do
     mintty /c/src/emergent/package/aws/build.py $distro $bits $rev &
   done
 done

History of build script

A new release process was established in 2011 to provide installation packages for Ubuntu. Much of the process is automated by scripts. The scripts are located in the emergent Subversion repository in the package subfolder.

Prior to the 2011 build-system overhaul there were various methods described on this wiki to create Ubuntu (or Kubuntu) packages, but none of them worked across all the Ubuntu releases we needed to support:

  • CMake was supposed to be able to build .deb packages, but a bug was introduced in CMake 2.8.2 that prevented the .deb packages from installing properly.
  • The checkinstall approach had some critical issue and needed to be run as root. This came very close to working many times, but ultimately checkinstall is a hack.
  • Creating an .rpm using rpmbuild (perhaps for CentOS) and then using alien to convert it to a .deb -- another hack approach that didn't pan out.

There were additional difficulties due to inconsistencies in the version of CMake installed. Ultimately the build script had to enable backport repositories for lucid and maverick so that patched versions of CMake could be installed (2.8.0 and 2.8.2 were problematic).

There are no prebuilt .deb packages for the Quarter software, which glues Coin3D to Qt, so the build script creates a libquarter0_*.deb (only needs to be done once per platform). Prior to 2011 there were libquarter*.deb packages (without the 0) in circulation. There was some reason the "0" was needed (perhaps the debuild system required it). The build script will attempt to remove libquarter in favor of libquarter0. It also marks libquarter as a conflict in the libquarter0 .deb file.

The Ubuntu build script uses apt-get to install all prerequisite packages needed to build emergent. Thus, the script can be run on a stock Ubuntu system with no other preparation.

However, in order to enable backport repositories and install prerequisite packages (including libquarter0_*.deb), the script uses sudo in a bunch of places. Don't be alarmed when it prompts for your password!

Suggested that you create a virtual machine for each ubuntu release.

  • VirtualBox VMs are quite helpful. 32-bit VMs can get away with 1-1.5 GB RAM and 8GB of hard disk space. 64-bit VMs require 2 GB RAM and 16GB of hard disk (faster with more RAM of course)
    • If using VirtualBox got to Devices menu and select "Insert Guest Additions CD Image" so that you can get a display of reasonable size.
    • Also helpful - select Devices->Shared Clipboard->Bidirectional