Steps to build the Appliance

For the curious (and me if I have to re-build the appliance), here are the necessary steps.

Install JeOS on VMware Server

1. Follow this recipe through 'Preparing the OS'

Install X and Xfce 4

2. sudo aptitude install xorg (gets 54,8MB of archives; after unpacking, 158 MB will be used)

3. install VMware Tools as per the recipe st

4. before you can start X, sudo apt-get install xserver-xorg-input-vmmouse

5. after that X will start, but you probably don't want to, since it is so bare bones.

6. XFCE: sudo apt-get install gdm xfce4 firefox (32MB unpacked to 136MB; that installs xfce 4.4.1 of April 07; 4.4.2 of Dec 07 is the latest)

sudo apt-get install xterm xfce4-terminal

Java

7. sudo apt-get install sun-java6-jdk (43.4MB of archives, unpacked to 128MB disk space; Installs 1.6.0_03-b05)

sudo apt-get install sun-java6-plugin sun-java6-fonts (274 kB only!)

Eclipse 3.2 (pity, not 3.3)

8. sudo apt-get install eclipse-platform eclipse-jdt (56.2MB, unpacked to 87.3MB)

Installs (most of) eclipse to /usr/lib/eclipse; and happily, its dependencies include tomcat and ant.

But we need the executable, so force the install of the eclipse package without its dependencies on -source (which is 29MB) or -pde (4MB).

dev@plutext-dev:~$ sudo apt-get install -d eclipse dev@plutext-dev:~$ sudo dpkg --force-depends -i /var/cache/apt/archives/eclipse_3.2.2-3ubuntu3_i386.deb

And Eclipse runs! But its 3.2, not 3.3. See https://bugs.launchpad.net/debian/+source/eclipse/+bug/123064

Hmmm .. apt-get now complains about broken dependencies. Not worth it, so give in:

dev@plutext-dev:~$ sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed:

eclipse-pde eclipse-source

Give Eclipse sufficient memory:

sudo vi /usr/bin/eclipse, and set

VMARGS="-Xms128M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=256M"

(/usr/lib/eclipse/eclipse.ini is ignored!)

replace eclipse 3.2 with 3.3.1

download eclipse-java-europa-fall2-linux-gtk.tar.gz from eclipse.org (there is no .deb pkg at present) sudo rm /usr/lib/eclipse sudo mv eclipse /usr/lib/ sudo mv /usr/bin/eclipse /usr/bin/eclipse-OLD sudo cd /usr/bin ; ln -s /usr/lib/eclipse eclipse sudo rm ~/.eclipse

(Should have cleaned out ~/workspace/.metadata/ before running new eclipse!)

Reinstall subclipse and m2eclipse.

To correct the menu link for eclipse: dev@plutext-dev:/usr/share/applications$ sudo vi eclipse.desktop

Now it uses eclipse.ini, so:

dev@plutext-dev:/usr/lib/eclipse$ vi eclipse.ini dev@plutext-dev:/usr/lib/eclipse$ more eclipse.ini -showsplash org.eclipse.platform -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m -XX:MaxPermSize=256m

== Tomcat 5.5 ===

8 above also installs tomcat to /usr/share/tomcat5.5

But libtomcat5.5-java doesn't give you bin/catalina.sh, startup.sh, nor server.xml .. and tomcat5.5 has dependencies on gcj (a further 22MB/49.3MB). See https://launchpad.net/ubuntu/+source/tomcat5.5/+bug/72222

Copy those, and conf directory from a working Tomcat install.

Set JAVA_HOME in .bashrc

mkdir /usr/share/tomcat5.5/logs, temp

Cause of "java.lang.IllegalStateException?: No Java compiler available" is jasper-compiler-jdt.jar -> ../../../java/ecj.jar in tomcat's common/lib. Replace with jasper-*.jar from working Tomcat.

Ant 1.7

8 above also installs ant to /usr/share/ant

Subversion

dev@plutext-dev:~$ sudo apt-get install subversion

Eclipse Subversion plugin

http://subclipse.tigris.org/update_1.2.x

Maven 2

http://codespin.blogspot.com/2008/01/installing-apache-maven-2-on-ubuntu-710.html

Installs to /usr/share/maven2

dev@plutext-dev:~/workspace/docx4j$ cp /usr/share/maven2/conf/settings.xml ~/.m2/

docx4j

Install

docx4all

Download https://appframework.dev.java.net/downloads/AppFramework-1.03-src.zip

apt-get install unzip

MySQL 5.0.45

(37.3 MB; 109 MB)

password for root: default

dev@plutext-dev:~$ mysqladmin -u root -p create alfresco

dev@plutext-dev:~$ mysql -u root -p -e "grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;"

dev@plutext-dev:~$ mysql -u root -p -e "grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;"

More Tomcat stuff

dev@plutext-dev:/usr/share$ sudo mkdir tomcat5.5-virtual dev@plutext-dev:/usr/share$ sudo cp tomcat5.5/* tomcat5.5-virtual/ -rR

Add to .bashrc:

export TOMCAT_HOME=/usr/share/tomcat5.5 export VIRTUAL_TOMCAT_HOME=/usr/share/tomcat5.5-virtual

ImageMagick

dev@plutext-dev:~$ sudo apt-get install imagemagick

Alfresco

See our recipe.

Fixes

gdm missing Human.xml - apt-get install feisty-gdm-themes

Time. configure to sync with the host, via the .vmx config file option tools.syncTime.

eth0: ERROR while getting interface flags: No such device ... SIOCSIFADDR: No such device. When you clone the VM, ifconfig reports no eth0. Follow http://devmull.com/?p=13

SvnAnt

http://subclipse.tigris.org/svnant.html

dev@plutext-dev:~/svnant-1.0.0$ sudo cp lib/svnant.jar /usr/share/ant/lib/ dev@plutext-dev:~/svnant-1.0.0$ sudo cp lib/svnClientAdapter.jar /usr/share/ant/lib/

ant-jnlp

Besides putting the jars in ant/lib, need to run the keytool:

dev@plutext-dev:~$ keytool -genkey -alias alias -dname "CN=A Developer, O=Open Source" -validity 9999 -keystore .keystore -keypass password -storepass password

free up space

dev@plutext-dev:~$ sudo aptitude remove build-essential linux-headers-$(uname -r) The following packages are unused and will be REMOVED:

binutils dpkg-dev g++ g++-4.1 gcc gcc-4.1 libc6-dev libmudflap0 libmudflap0-dev libstdc++6-4.1-dev linux-headers-2.6.22-14 linux-libc-dev make patch

The following packages will be REMOVED:

build-essential linux-headers-2.6.22-14-virtual

Need to get 0B of archives. After unpacking 105MB will be freed.

dev@plutext-dev:~$ sudo aptitude install patch

trim stuff easily replaced

sudo rm /usr/share/tomcat5.5/webapps/alfresco -rf (49MB)

dev@plutext-dev:~/workspace/Alfresco/HEAD/root$ ant clean (which upsets Eclipse unless you do a clean in there as well)

dev@plutext-dev:~/workspace/Alfresco/HEAD/root$ cd projects/3rd-party/ dev@plutext-dev:~/workspace/Alfresco/HEAD/root/projects/3rd-party$ rm build distro lib src -rf

dev@plutext-dev:~/workspace/Alfresco/HEAD/root/projects/3rd-party$ cd ../repository/source/cpp/ dev@plutext-dev:~/workspace/Alfresco/HEAD/root/projects/repository/source/cpp$ rm CAlfrescoApp -rf

dev@plutext-dev:~/workspace/Alfresco/HEAD/root/projects/extension-sample$ rm build config source -rf

dev@plutext-dev:~/workspace/Alfresco/HEAD/root/projects/installer$ rm extras-wcm -rf

dev@plutext-dev:~/workspace/Alfresco/HEAD/root/projects/extensions$ rm AlfrescoOffice?2003 AlfrescoOffice?2007 firefox wordaddin -rf

dev@plutext-dev:~/workspace/Alfresco/HEAD/root/modules$ rm mediawiki-integration -rf

dev@plutext-dev:/$ sudo du -S | sort -n > ~/large-now.txt

then zero fill. df says 1.7 G

shrink

File on disk was 4.08 GB, after removal of snapshots.

dev@plutext-dev:~$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 7850996 1727268 5724916 24% / dev@plutext-dev:~$ sudo /usr/bin/vmware-toolbox [sudo] password for dev: Log: FILEIO: Write failed 28.

Looks like the result is 1.9 GB uncompressed.

Finally

Adapt sun-java6-bin.preinst as accept-sun-java6-license-or-revert

#!/bin/bash

echo "About to present Sun's Java license for your consideration." echo "This one-off step is triggered the first time you use a terminal." echo "Please enter your password." # Need the user to accept Sun's Operating System # Distributor License for Java version 1.1 # See https://jdk-distros.dev.java.net/

sudo ./accept-sun-java6-license-or-revert

# Generate a key specific to this VM keytool -genkey -alias alias -dname "CN=A Developer, O=Open Source" -validity 9999 -keystore .keystore -keypass password -storepass password

echo "Thanks. You could edit the tail of .bashrc to clean up after this procedure."

Remove .keystore - it will be regenerated on first use.

Make Firefox default to a local copy of the relevant wiki page.