harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess" <mark.hind...@googlemail.com>
Subject [general] How I created the Linux binaries for the M10 release
Date Thu, 18 Jun 2009 13:13:42 GMT

I built the Linux binaries for the M10 release using a clean minimal
build environment.  I created the clean environment using the
copy-on-write builder (cowbuilder) on Debian.  I'd like the process
for generating the release binaries from the source to be as "open" as
possible so I've appended a rough description of what I did.

(I used cowbuilder rather than debootstrap/chroot because the tree
remains clean for re-use and because it handles mounting /proc, etc for
you.)

Regards,
 Mark.

# install the copy-on-write builder (intended for use by pdebuild when
# creating debian packages
sudo apt-get install cowbuilder

# cd to temporary directory on the same filesystem as /var/cache/pbuilder
# create a pristine debian etch environment (etch because the lenny version
# of libc is too new with respect to some enterprise distributions)
sudo cowbuilder --create --basepath etch-amd64.cow --distribution etch \
                --debootstrap debootstrap

# get login shell in new environment
sudo cowbuilder --login --basepath etch-amd64.cow

# set $HOME to /tmp
cd /tmp
HOME=/tmp
export HOME

# install wget
apt-get install wget

# fetch the harmony KEYS file
wget -q -O- http://svn.apache.org/repos/asf/harmony/KEYS | gpg --import

# install a jre to bootstrap building the M10 snapshots
# (M10 debian packages as I built the M9 packages with lenny not etch)
for f in jre classlib drlvm ; do
  # fetch package and check signature
  wget http://my.server.example.com/deb/harmony-5.0-${f}_0.0r782693-1_amd64.deb
  wget $_.asc
  gpg --verify harmony-5.0-${f}_0.0r782693-1_amd64.deb.asc
  # check the output to make sure it is good
done

# (attempt to) install the bootstrap jre
dpkg -i harmony-5.0*.deb

# this fails due to missing dependencies so ask apt-get to fix the missing
# dependencies
apt-get install -f

# install the other build dependencies
apt-get install ant subversion ant-optional liblcms1-dev libjpeg62-dev \
                    libpng-dev libxft-dev libxml2-dev libxtst-dev libxext-dev

# create a user to perform the build
useradd -d /tmp build

# make the harmony keys we've imported available to the new user
chown -R build /tmp/.gnupg

# become the build user
su - build

# fetch the harmony source and check the signature
wget http://people.apache.org/~hindessm/m10/apache-harmony-src-r782693-snapshot.tar.gz
wget $_.asc
gpg --verify apache-harmony-src-r782693-snapshot.tar.gz.asc
# check the output to make sure it is good

# unpack the sources
tar xzf apache-harmony-src-r782693-snapshot.tar.gz
cd apache-harmony-src-r782693

# fetch the dependencies
ant fetch-depends

# un-become the build user so root can work some magic
exit

# cd to build tree
cd /tmp/apache-harmony-src-r782693

# copy some dependencies to ant lib
cat common_resources/depends/jars/ecj_3.4.2/ecj-3.4.2.jar \
    >/usr/share/ant/lib/ecj.jar
cat working_classlib/depends/jars/junit_4.4/junit.jar \
    >/usr/share/ant/lib/junit.jar # only needed to run tests

# become the build user
su - build

# cd to build tree
cd apache-harmony-src-r782693

# build and create bundles
ant build bundle-hdk bundle-jdk bundle-jre

# copy target/* to host
# hint: outside of the cowbuilder shell the files will be in:
#   /var/cache/pbuilder/build/cow.NNNNN/tmp/apache.../target
# use lsof as follows to find the correct value for NNNNN:
#  lsof +d /var/cache/pbuilder/build

# repeat for i386
sudo cowbuilder --create --debootstrapopts --arch=i386 \
                --basepath etch-i386.cow --distribution etch \
                --debootstrap debootstrap

# use linux32 to get a suitable (fake) i386 environment
linux32 sudo cowbuilder --login --basepath etch-i386.cow
# continue as before but with x86 / i386 instead of x86_64 / amd64



Mime
View raw message