Showing posts with label post project. Show all posts
Showing posts with label post project. Show all posts

Friday, 1 July 2011

Firefox 5 from Source

These are the instructions for installing FF5 from source on the LFS system I built in earlier posts, assuming that you have not installed any version.

wget http://ftp.gnome.org/pub/gnome/sources/libIDL/0.8/libIDL-0.8.14.tar.bz2
tar -xjvf /sources/extras/libIDL-0.8.14.tar.bz2
cd libIDL-0.8.14
./configure --prefix=/usr &&
make
make install
cd ..
rm -rvf libIDL-0.8.14

wget http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2
wget http://www.linuxfromscratch.org/patches/blfs/svn/Python-2.6.4-bdb_4.8-1.patch
wget http://docs.python.org/ftp/python/doc/2.6/python-2.6-docs-html.tar.bz2
tar -xjvf /sources/extras/Python-2.6.4.tar.bz2
cd Python-2.6.4
sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py
patch -Np1 -i /sources/extras/Python-2.6.4-bdb_4.8-1.patch
./configure --prefix=/usr --enable-shared
make
make test
make install
chmod -v 755 /usr/lib/libpython2.6.so.1.0
install -v -m755 -d /usr/share/doc/Python-2.6.4/html
tar --strip-components=1 --no-same-owner --no-same-permissions -C /usr/share/doc/Python-2.6.4/html -xvf /sources/extras/python-2.6-docs-html.tar.bz2
cat >> /etc/profile << "EOF"
export PYTHONDOCS=/usr/share/doc/Python-2.6.4/html
EOF
cd ..
rm -rvf Python-2.6.4
wget http://www.tortall.net/projects/yasm/releases/yasm-1.0.1.tar.gz
cd /dev/shm
tar -xzvf /sources/extras/yasm-1.0.1.tar.gz
cd yasm-1.0.1
CC="gcc -fPIC" ./configure --prefix=/usr
time make $CORES_TO_USE
make install
wget http://cairographics.org/releases/cairo-1.10.2.tar.gz
cd /dev/shm
tar -xzvf /sources/desktop/cairo-1.10.2.tar.gz
cd cairo-1.10.2
./configure --prefix=/usr --enable-tee=yes
make $CORES_TO_USE
make install
cd ..
rm -rvf cairo-1.10.2
wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/5.0/source/firefox-5.0.source.tar.bz2
tar -xjvf /sources/extras/firefox-5.0.source.tar.bz2
cd moz*
cat > .mozconfig << "EOF"
ac_add_options --enable-application=browser
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../firefox-build
mk_add_options MOZ_MAKE_FLAGS="-j2"
ac_add_options --prefix=/opt/firefox5
ac_add_options --enable-optimize
ac_add_options --enable-system-cairo
ac_add_options --with-system-jpeg
#ac_add_options --with-system-png
ac_add_options --with-pthreads
ac_add_options --with-system-zlib
ac_add_options --disable-accessibility
ac_add_options --disable-crashreporter
ac_add_options --disable-dbus
ac_add_options --disable-gnomevfs
ac_add_options --disable-necko-wifi
ac_add_options --disable-installer
ac_add_options --disable-javaxpcom
ac_add_options --disable-tests
ac_add_options --disable-updater
ac_add_options --disable-libnotify
ac_add_options --enable-official-branding
ac_add_options --enable-safe-browsing
ac_add_options --enable-strip
EOF
time make -f client.mk build
make -f client.mk install
cd ..
rm -rvf moz*
cat >> /etc/ld.so.conf << "EOF"
# Extra Path so Firefox's libraries can be used by Flash10
/opt/firefox5/lib/firefox-5.0
# End of Extra Path.
EOF
wget http://curl.haxx.se/download/curl-7.20.0.tar.bz2
cd /dev/shm
tar -xjvf /sources/extras/curl-7.20.0.tar.bz2
cd curl-7.20.0
./configure --prefix=/usr
make $CORES_TO_USE
make install
find docs -name "Makefile*" -o -name "*.1" -o -name "*.3" | xargs rm
install -v -d -m755 /usr/share/doc/curl-7.20.0
cp -v -R docs/* /usr/share/doc/curl-7.20.0
wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
tar -xzvf install_flash_player_10_linux.tar.gz
mkdir -v /opt/firefox5/lib/firefox-5.0/plugins
cp -v libflashplayer.so /opt/firefox5/lib/firefox-5.0/plugins
cp -v ./usr/bin/flash-player-properties /usr/bin/
Add this to the openbox menu.xml file:
<item label="flash player properties">
<action name="Execute">
<execute>
/usr/bin/flash-player-properties
</execute>
</action>
</item>
Download Java from here. OR:
wget http://download.oracle.com/otn-pub/java/jdk/6u26-b03/jdk-6u26-linux-i586.bin
mv jdk-6u26-linux-i586.bin* jdk-6u26-linux-i586.bin
chmod +x /sources/extras/jdk-6u26-linux-i586.bin
cd /dev/shm
/sources/extras/jdk-6u26-linux-i586.bin
cd jdk1.6.0_26
install -v -m755 -d /opt/jdk-6u26
mv -v * /opt/jdk-6u26
chown -v -R root:root /opt/jdk-6u26
ln -v -sf xawt/libmawt.so /opt/jdk-6u26/jre/lib/i386/
cd ..
sed -i 's@XINERAMA@FAKEEXTN@g' /opt/jdk-6u26/jre/lib/i386/xawt/libmawt.so
ln -v -nsf jdk-6u26 /opt/jdk
ln -sv /opt/jdk/jre/lib/i386/libnpjp2.so /opt/firefox5/lib/firefox-5.0/plugins
cat >> /etc/profile.d/30-jdk.sh << "EOF"
# Begin /etc/profile.d/30-jdk.sh

# Set JAVA_HOME directory
JAVA_HOME=/opt/jdk

# Adjust PATH
pathappend ${JAVA_HOME}/bin PATH

# Auto Java CLASSPATH
# Copy jar files to, or create symlinks in this directory
AUTO_CLASSPATH_DIR=/usr/lib/classpath
pathprepend . CLASSPATH
for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
pathappend $dir CLASSPATH
done

export JAVA_HOME CLASSPATH
unset AUTO_CLASSPATH_DIR
unset dir

# End /etc/profile.d/30-jdk.sh
EOF
source /etc/profile
If you have installed openoffice:
ln -sv /opt/openoffice-3.2.1/program/libnpsoplugin.so /opt/firefox5/lib/firefox-5.0/plugins

Friday, 18 February 2011

LAP - Accessing NTFS Partitions

Eventually you may want to use your Linux USB system to access a Windows HDD. It won't be a problem if the windows system uses a FAT32 disk, but those things are rare outside USB Keys now. Most windows HDDs will be formatted with NTFS, and that required some tweaking to get my system to talk to it. First of all I needed to recompile the kernel. Yes, really. If you followed my instructions on how to compress your kernel source directory using LZMA then you can just run the following command to uncompress it to the ramdisk. Makes things a bit quicker, but you need a sensible (2G) amount of ram to make this work.

cd /dev/shm
cat /sources/linux.tar.lzma | lzma -d | tar x
cd linux-2.6.32.8
make mrproper
cp /boot/config-2.6.32.8 ./.config
make LANG=en_GB.utf8 LC_ALL= menuconfig

You then go into the Filesystems section and activate NTFS support (including write support) and also turn on Fuse (as a module). You can now exit the menu system. You compile the kernel, make a backup of your old kernel and settings and copy the new kernel into place by running these commands:

make $CORES_TO_USE
make modules_install
cp -v /boot/vmlinux-2.6.32.8-lfs-6.6 /boot/vmlinux-2.6.32.8-lfs-6.6.backup
cp -v /boot/System.map-2.6.32.8 /boot/System.map-2.6.32.8.backup
cp -v /boot/config-2.6.32.8 /boot/config-2.6.32.8.backup
cp -v arch/x86/boot/bzImage /boot/vmlinux-2.6.32.8-lfs-6.6
cp -v System.map /boot/System.map-2.6.32.8
cp -v .config /boot/config-2.6.32.8

You would be best to reboot now, to make sure the new kernel is working. After you get back up and running, you then download the source code for the necessary software in the usual way:

cd /sources/extras
wget http://prdownloads.sourceforge.net/fuse/fuse-2.7.4.tar.gz
wget http://www.ntfs-3g.org/ntfs-3g-2009.4.4.tgz

Now, move to the ramdisk and uncompress and compile FUSE. I am not entirely clear what FUSE is, but it seems to be a bit of software that lets you load weird and wonderful filesystems.

cd /dev/shm
tar -xzvf /sources/extras/fuse-2.7.4.tar.gz
cd fuse-2.7.4
./configure --prefix=/usr &&
make $CORES_TO_USE
make install &&
rm -rf /etc/init.d
cd ..
rm -rvf fuse-2.7.4

The installation is pretty basic. Not sure why it wants to delete the whole of [/etc/init.d] though. Still my LFS install doesn't use that, so hey ho. Next up is the ntfs driver itself:

tar -xzvf /sources/extras/ntfs-3g-2009.4.4.tgz
cd ntfs-3g-2009.4.4
./configure --prefix=/usr --libdir=/usr/lib &&
make $CORES_TO_USE
make install
cd ..
rm -rvf ntfs-3g-2009.4.4

Again, all pretty straightforwards. We just need to make sure it knows where to put its libraries.

You then mount NTFS partitions with:

mount -t ntfs-3g [device] [mountpoint]

Friday, 4 February 2011

LAP - WPA Wireless Security

OK, this one was one of the tasks I set myself at the end of my project last year. I just could not get to grips with the wpa-supplicant documentation. It seemed from reading it that I would have to rebuild my network driver or get a new one or, or, some other bloody stupid thing. Anyway, pleasantly it turned out to be considerably easier than I had lead myself to believe.

So, grab the source code, and move to the ramdisk in the usual way:

cd /sources/extras
wget http://hostap.epitest.fi/releases/wpa_supplicant-0.6.10.tar.gz
cd /dev/shm

Now, we unpack the source code, and build it with these commands. The [defconfig] is a default config file which basically contains all the usual settings that you would use a [./configure] script to set. It is fucking painful to wade through, and was really what put me off this whole endeavour to date. Helpfully, though, with my Compaq Mini, it worked fine with the default settings. i haven't tested it on any other hardware yet, and it may well b0rk if I do.

tar -xzvf /sources/extras/wpa_supplicant-0.6.10.tar.gz
cd wpa_supplicant-0.6.10
cd wpa_supplicant &&
cp defconfig .config
make $CORES_TO_USE
cp -v wpa_cli wpa_supplicant wpa_passphrase /sbin
cd ..
rm -rvf wpa_supplicant-0.6.10

You will notice we did not [make install]. There as no need, we are just installing the three programs that we [c]o[p]ied to [/sbin].

The software also needs a configuration file to work. To connect to a WPA2 enable network with a personal key, you would make the following configuration file:

cat > /etc/wpa_supplicant.conf << "EOF"
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
        ssid="NAME OF NETWORK"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP
        psk="VERY SECRET PASSPHRASE"
}
EOF

The NAME OF NETWORK and VERY SECRET PASSPHRASE should be obvious. If you just want to connect to a WEP enabled network, wpa_supplicant can handle that as well. Just make this configuration file instead:

cat > /etc/wpa_supplicant.conf << "EOF"
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
network={
        ssid="NAME OF NETWORK"
        key_mgmt=NONE
        #wep_key0="passphrase"
        wep_key0=HEXCODE
        wep_tx_keyidx=0
}
EOF

Obviously you set the [wep_key0] to whatever you use, either hexcode or passphrase. The [#] operates in the usual way, so that line is blanked out in the example above.

You have the option of putting both the WPA2 and WEP in the same .conf file. What you do is just copy the [network={...}] bit and paste it at the bottom of your .conf file. If you move your laptop/netbook around different locations, you will end of with a list of different network settings. What you then have to do is, at the end of each [network={...}] bit, put a line just before the [}] saying [priority=] and then a number. The software will try the highest numbered networks first, so make sure you give your usual networks the highest priorities.

Incidentally if you want to use WPA rather than WPA2 and you have a Compaq Mini netbook, then as far as my rigorous testing has been able to determine, you are going to have to learn to live with disappointment. I have tried three separate routers, and it just doesn't fucking work.

Lastly we need to create a script to run on boot to run the software:

cat > ~/wifi_wpa_wl.sh << "EOF"
rmmod b43 
rmmod ssb 
rmmod wl
rmmod lib80211
modprobe lib80211
modprobe wl
wpa_supplicant -D wext -i eth1 -c/etc/wpa_supplicant.conf -B
dhcpcd eth1
EOF

You will spot the similarity to the iwconfig wifi script I used in the past. The [-D wext] setting tells the software it can use the standard linux [w]ireless [ext]tensions, and not some fancy driver. These must be installed with the kernel, because I do not remember compiling them. The [i]interface and [c]onfiguration file commands are self explanatory. The [B] option tells it to run as a daemon.

Useful tips:
Run the wpa_supplicant command from the script with -d instead of -B to test the settings and report back error messages. The command:

wpa_passphrase ESSID PASSPHRASE

(where ESSID is the name of your wireless network, and PASSPHRASE is, well, work it out) will output an encrypted version of your passphrase for you to pop into the wpa_supplicant.conf file instead of the clear text. Remember to:

chmod 600 /etc/wpa_supplicant.conf

to protect the file from all but root. You can also run:

wpa_cli status
wpa_cli scan
wpa_cli scan_results

to obtain some self evident information.

Friday, 7 January 2011

Installing Conky

cd /dev/shm
wget http://sourceforge.net/projects/conky/files/conky/1.8.1/conky-1.8.1.tar.bz2/download
cd /dev/shm
tar -xjvf conky-1.8.1.tar.bz2
cd conky-1.8.1
./configure --prefix=/usr --enable-wlan --disable-lua --enable-x11 --enable-curl
make -j2
#make install
/dev/shm/conky-1.8.1/src/conky

cat > ~/.conkyrc << "EOF"
# set to yes if you want Conky to be forked in the background
background yes

# Use Xft?
use_xft yes

# Set conky on the bottom of all other applications
#on_bottom yes

# Xft font when Xft is enabled
xftfont Deja Vu Sans Mono:size=7.5

# Text alpha when using Xft
xftalpha 0.15

# Update interval in seconds
update_interval 5.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window no

# If own_window is yes, you may use type normal, desktop or overide
#own_window_type desktop

# Use pseudo transparency with own_window?
#own_window_transparent yes

# If own_window is yes, these window manager hints may be used
#own_window_hints undecorated,below,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 280 5

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 8 no

# border margins
#border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 12
gap_y 12

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase yes

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2


# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none

# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument

# stuff after 'TEXT' will be formatted on screen

TEXT
$color
${color orange}SYSTEM ${hr 2}$color
$nodename $sysname $kernel on $machine

${color orange}CPU ${hr 2}$color
${freq}MHz   Load: ${loadavg}   Temp: ${acpitemp}
$cpubar
${cpugraph 000000 ffffff}
NAME             PID       CPU%      MEM%
${top name 1} ${top pid 1}   ${top cpu 1}    ${top mem 1}
${top name 2} ${top pid 2}   ${top cpu 2}    ${top mem 2}
${top name 3} ${top pid 3}   ${top cpu 3}    ${top mem 3}
${top name 4} ${top pid 4}   ${top cpu 4}    ${top mem 4}

${color orange}MEMORY / DISK ${hr 2}$color
RAM:   $memperc%   ${membar 6}$color
Swap:  $swapperc%   ${swapbar 6}$color
Root:  ${fs_free_perc /}%   ${fs_bar 6 /}$color

${color orange}NETWORK (${addr eth1}) ${hr 2}$color
Down: $color${downspeed eth1} k/s ${alignr}Up: ${upspeed eth1} k/s
${downspeedgraph eth1 25,140 000000 ff0000} ${alignr}${upspeedgraph eth1 25,140 000000 00ff00}$color
Total: ${totaldown eth1} ${alignr}Total: ${totalup eth1}
${execi 30 netstat -ept | grep ESTAB | awk '{print $9}' | cut -d: -f1 | sort | uniq -c | sort -nr}
$color Wifi Quality: ${color #07dbf4}${wireless_link_bar eth1}

${color orange}Battery: ${color #ec0000}
${battery BAT1} $color
${battery_bar BAT1}

${color orange}Master Volume:${color}${execi 3 ~/conky_volume.sh}
#The next line does not work if the script outputs text, such as mute.  Need to fix this.
${execibar 3 ~/conky_volume.sh}
EOF

cat > ~/conky_volume.sh << "EOF"
#!/bin/bash
amixer get Master | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "Mute" } else { print $2"%" }}'
EOF
chmod +x ~/conky_volume.sh

Friday, 24 December 2010

LFS - Openbox Configuration

I originally wrote the following before I put together the far more sensible popular dependencies post, which cut down the shit significantly. I leave this here therefore, as an example of the joys of dependency hell.

I decide I want to install the obconf program which lets me configure openbox from a gui, and obmenu which lets me configure openbox's menu from, drum roll, a gui. Shocker. So, lets start by having a look at the README in the latest version of obmenu:

REQUERIMENTS:

  python >= 2.3, pygtk, python-glade

OK, so we installed Python 2.6.4 for Firefox, so we just need the other two. Now, what about obconf. Great, there is nothing in the README file for obconf. However, if you go to the website for obconf here, you get this:

Compiling ObConf requires the following packages:

    GTK+ 2.x library and headers (development package)
    Glade 2.x library and headers (development package)
    Openbox 3.4 or above (the libraries development package if it is separate)

So, we have GTK and Openbox (it take a special kind of mind to decide to point out that the configuration software for openbox needs openbox to be installed). Not sure what this Glade thing is, but it echos the python-glade package needed for obconf. A ha! It is an interface designer. Interestingly, wikipedia has in in the same category of tools as MUI for the Amiga. The glade 2.x library is presumably the libglade package referred to in BLFS. Good news is we have previously installed both of its dependencies, libxml2 and GTK+2. Now, as far as I and Google can gather there is no such fucking thing as python-glade, so I am operating on the presumption that python-glade = Glade 2.x library = libglade.

wget http://ftp.gnome.org/pub/gnome/sources/libglade/2.6/libglade-2.6.4.tar.bz2
tar -jxvf libglade-2.6.4.tar.bz2
cd libglade-2.6.4
./configure --prefix=/usr &&
make
make check

Error, error, error and then I check the page and discover that one of the tests is supposed to fail. OK, hands up that was my fault.

make install
cd ..
rm -rvf libglade-2.6.4

So that should be all the dependencies sorted out for obconf. Next is obmenu. Let's start with pygtk. Its README file says this about dependencies:

Requirements
============
  * C compiler (GCC and MSVC supported)
  * Python 2.3.5 or higher
  * PyGObject 2.12.1 or higher
  * Glib 2.8.0 or higher
  * GTK+ 2.8.0 or higher (optional) or
    GTK+ 2.10.0 or higher for 2.10 API
    GTK+ 2.12.0 or higher for 2.12 API
    GTK+ 2.14.0 or higher for 2.14 API
    GTK+ 2.16.0 or higher for 2.16 API
  * libglade 2.5.0 or higher (optional)
  * pycairo 1.0.2 or higher (optional)
  * numpy (optional)

So, we obviously have GCC, we also have Python. We also have GTK+2 higher than all version listed there, as well as GLib (remember this is G(nome)Lib not G(nu)Libc). We have just installed libglade, so we are good to go. Not going to bother with the optional stuff. Lets just do this PyGObject thingy. In turn, it requires gobject-introspection, although it doesn't tell you that in its README. gobject-introspection in turn requires libiffi, according to BLFS.

wget ftp://sourceware.org/pub/libffi/libffi-3.0.8.tar.gz
tar -xzvf libffi-3.0.8.tar.gz
cd libffi-3.0.8
./configure --prefix=/usr &&
make
make install
cd ..
rm -rvf libffi-3.0.8

Actually installing gobject-introspection was a right pain in the arse. The one with instructions in BLFS at the time of writing (0.6.14) doesn't fucking work with pygobject 2.26.0 (which is the latest available at the time of writing), so I downloaded the latest version of this. Which doesn't fucking work with my version of Glib. Ah fuck. So it turns into a guessing game to find a version of gobject-introspection which works with my glib AND pygobject. Bastard. 0.9.5 works. Oh, hang on:

subprocess.CalledProcessError: Command '['/bin/sh', '../../libtool', '--mode=link', '--tag=CC', '--silent', 'gcc', '-o', '/dev/shm/gobject-introspection-0.9.5/tests/scanner/tmp-introspect696b_W/Regress-1.0', '-L.', 'libregress.la', '../../girepository/libgirepository-1.0.la', '-pthread', '-lgio-2.0', '-lgobject-2.0', '-lgmodule-2.0', '-lgthread-2.0', '-lrt', '-lglib-2.0', '/dev/shm/gobject-introspection-0.9.5/tests/scanner/tmp-introspect696b_W/Regress-1.0.o']' returned non-zero exit status 1

No it fucking doesn't. Right. Lets try to solve this from the other direction and find the version of pygobject that will fucking work with gobject-introspection 0.6.14. By the way, what the fuck is gobject-introspection. It sounds suspiciously like an arts student's 'kooky' first album.

wget http://ftp.gnome.org/pub/gnome/sources/gobject-introspection/0.6/gobject-introspection-0.6.14.tar.bz2
tar -xjvf gobject-introspection-0.6.14.tar.bz2
cd gobject-introspection-0.6.14
./configure --prefix=/usr --disable-tests &&
make
make check

make install
cd ..
rm -rvf gobject-introspection-0.6.14

It turns out that if you look at the publish date of 0.6.14 it is 3rd June 2010. If you then look at 2.21 of pygobject that was published on 12th July 2010. Hmmm. Probably too late. 2.20 was September 2009 so that will definitely work with 0.6.14. Good. Progress. I install 2.20.

Well it installed, but then when I came to the next step (pygtk), oh, holy fucking shitting bastard. When I then downloaded 2.22 of pygtk, its README file states, and I quote:

PyGObject 2.12.1 or higher

What do I have? I have 2.20 - look its right up there! But when ./configuring I got:

checking for PYGOBJECT... configure: error: Package requirements (pygobject-2.0 >= 2.21.3) were not met:

Cocksucker. So when it SAYS 2.12.1 or higher it actually means 2.21.3 or higher. Looks like some lazy bastard hasn't updated the README file doesn't it? After checking file dates ... if I drop back to 2.17 of pygtk that should sync with 2.20 of PyGObject that I have installed.

checking for PYGOBJECT... configure: error: Package requirements (pygobject-2.0 >= 2.16.1) were not met:

No package 'pygobject-2.0' found

Oh, jesus fuck give me strength. YES IT FUCKING IS. I try 2.21 of pygtk and I get exactly the same fucking, manifestly false, bullshit statement. Right. Lets try 2.21.3 of pygobject since pygtk seems to desire that above all other things.

checking for GLIB - version >= 2.22.4... yes (version 2.22.4)

Man, that is cutting things pretty god damned fine. And does it fucking work? Does it fuck. Right, lets try exactly 2.16.1 of pygobject.

wget http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.16/pygobject-2.16.1.tar.bz2
tar -xjvf pygobject-2.16.1.tar.bz2
cd pygobject-2.16.1
./configure --prefix=/usr
make
make install
cd ..
rm -rvf pygobject-2.16.1

Now for pygtk 2.17 again ...

checking for PYCAIRO... no
no
not checking for gtk due to missing pycairo
checking for GDK target... x11
configure: WARNING: Could not find a valid numpy installation, disabling.
checking whether gcc understands -Wall... yes
checking whether gcc understands -fno-strict-aliasing... yes
checking whether gcc understands -std=c9x... yes
configure: error: conditional "HAVE_GTK_2_16" was never defined.
Usually this means the macro was only invoked conditionally.

God fucking damn cunting it. PYCAIRO is supposed to be a fucking optional package.
* pycairo 1.0.2 or higher (optional)
See - OPTIONAL. Right.

wget http://cairographics.org/releases/py2cairo-1.8.10.tar.gz
tar -xzvf py2cairo-1.8.10.tar.gz
cd pycairo-1.8.10
./configure --prefix=/usr
make
make install
cd ..
rm -rvf pycairo-1.8.10

wget http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.17/pygtk-2.17.0.tar.bz2
tar -xjvf pygtk-2.17.0.tar.bz2
cd pygtk-2.17.0
./configure --prefix=/usr
make
make install
cd ..
rm -rvf pygtk-2.17.0

Well, at fucking last. Lesson? PYCairo is NOT FUCKING OPTIONAL. Probably all the other versions of pygtk were stalling on this as well, so my install is now completely unnecessarily retarded. Bastard.

wget http://prdownloads.sourceforge.net/obmenu/obmenu-1.0.tar.gz?download
tar -xzvf obmenu-1.0.tar.gz
cd obmenu-1.0
python setup.py install
cd ..
rm -rvf obmenu-1.0

Amazingly obmenu installed and is functional after all that shite. On the other hand obconf does not fucking work because Startup Notification has not been installed - boo fucking hoo. Bastard arseholes. This wasn't mentioned anywhere in its README of course.

wget http://ftp.gnome.org/pub/gnome/sources/startup-notification/0.9/startup-notification-0.9.tar.bz2
tar -xjvf startup-notification-0.9.tar.bz2
cd startup-notification-0.9
./configure --prefix=/usr &&
make
make install &&
install -v -m644 -D doc/startup-notification.txt /usr/share/doc/startup-notification-0.9/startup-notification.txt
cd ..
rm -rvf startup-notification-0.9

wget http://openbox.org/dist/obconf/obconf-2.0.3.tar.gz
tar -xzvf obconf-2.0.3.tar.gz
cd obconf-2.0.3
./configure --prefix=/usr
make
make install
cd ..
rm -rvf obconf-2.0.3

And, fucking hell, they both now work. That was not fun.

By way of summary, the follow packages turned out to be needed:

(GTK+2, Python, libxml2)

obmenu <-- libglade
       <-- pygtk <-- pygobject <-- gobject-introspection <-- libffi
                 <-- pycairo
obconf <-- libglade
       <-- startup-notification

Friday, 10 December 2010

Updated BLFS Packages - OpenOffice.org

mkdir /sources/ooo
cd /sources/ooo
wget http://ftp.gnu.org/gnu/gperf/gperf-3.0.4.tar.gz
wget http://ftp.osuosl.org/pub/openoffice/stable/3.2.1/OOo_3.2.1_src_core.tar.bz2
wget http://ftp.osuosl.org/pub/openoffice/stable/3.2.1/OOo_3.2.1_src_system.tar.bz2
wget http://www.linuxfromscratch.org/patches/blfs/svn/OOo_3.2.1-build_with_db5-1.patch
wget ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/1.1.14/seamonkey-1.1.14.source.tar.bz2
wget ftp://ftp.osuosl.org/pub/openoffice/stable/3.2.1/OOo_3.2.1_src_l10n.tar.bz2
wget ftp://ftp.osuosl.org/pub/openoffice/stable/3.2.1/OOo_3.2.1_src_extensions.tar.bz2

We need to install one dependency 'gperf':

tar -xzvf /sources/ooo/gperf-3.0.4.tar.gz
cd gperf-3.0.4
./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.0.4 &&
make
make install &&
install -m644 -v doc/gperf.{dvi,ps,pdf,txt} /usr/share/doc/gperf-3.0.4 &&
pushd /usr/share/info &&
rm -v dir &&
for FILENAME in *; do
    install-info $FILENAME dir 2>/dev/null
done &&
popd
cd ..
rm -rvf gperf-3.0.4

And now for OpenOffice.org which you just cannot install from a ramdisk on a 32bit machine.

cd /sources/ooo
tar -xjvf OOo_3.2.1_src_system.tar.bz2
tar -xjvf OOo_3.2.1_src_core.tar.bz2
tar -xjvf OOo_3.2.1_src_extensions.tar.bz2
tar -xjvf OOo_3.2.1_src_l10n.tar.bz2
cd OOO320_m19
cp ../seamonkey-1.1.14.source.tar.bz2 moz/download/

Don't follow the instructions in BLFS, it gets the seamonkey filename wrong. Apparently OOo shits itself if you have certain environment variables set, so unset them and fire on a patch. In a rapidly developing theme the patch file name is also wrong on BLFS.

umask 0022 &&
unset LANG LC_ALL
patch -Np1 -i ../OOo_3.2.1-build_with_db5-1.patch
autoreconf

Now, set the configuration.

PKG_CONFIG=/usr/bin/pkg-config ./configure \
--enable-graphite              \
--disable-lockdown             \
--disable-binfilter            \
--disable-fontooo              \
--disable-cups                 \
--enable-fontconfig            \
--disable-symbols              \
--disable-gnome-vfs            \
--disable-systray              \
--disable-odk                  \
--disable-qadevooo             \
--enable-cairo                 \
--disable-dbus                 \
--disable-gconf                \
--enable-gio                   \
--disable-pam                  \
--without-afms                 \
--without-fonts                \
--without-ppds                 \
--without-pam                  \
--with-system-stdlibs          \
--with-system-libxml           \
--with-system-libxslt          \
--with-system-cairo            \
--with-system-expat            \
--with-system-zlib             \
--with-system-jpeg             \
--with-system-openssl          \
--with-system-python           \
--with-system-curl             \
--with-system-freetype         \
--with-jdk-home=/opt/jdk       \
--with-java                    \
--with-ant-home=/opt/ant       \
--with-perl-home=/usr          \
--with-x                       \
--with-lang="en-GB"             \
--with-dict=ENGB               \
--with-package-format=native   \
--with-vendor="Your name here"     \
--with-use-shell=bash

Now compile this all with:

source LinuxX86Env.Set.sh &&
./bootstrap &&
make $CORES_TO_USE

Then to install (several hours later):

pushd instsetoo_native/unxlng?6.pro/OpenOffice/native/install/en-US/linux-2.6-*/buildroot/opt &&
cp -r -v openoffice.org3 /opt/openoffice-3.2.1 &&
cp -r -v openoffice.org/* /opt/openoffice-3.2.1 &&
ln -sf basis3.2 /opt/openoffice-3.2.1/basis-link &&
popd

for appl in sbase scalc sdraw simpress smath soffice spadmin swriter
do
    ln -v -sf /opt/openoffice-3.2.1/program/$appl /usr/bin
done

pushd sysui/desktop/icons &&
install -v -m755 -d /usr/share/icons/{hicolor,locolor} &&
cp -r -v hicolor/* /usr/share/icons/hicolor &&
cp -r -v locolor/* /usr/share/icons/locolor &&
popd

install -v -d -m755 /usr/share/applications &&
pushd /opt/openoffice-3.2.1/share/xdg/ &&
for appl in *.desktop
do
    sed -i '/Exec/d' $appl &&
    echo "Exec=/usr/bin/s`echo $appl | sed 's/.desktop//'`" >> $appl &&
    sed -i '/Icon/d' $appl &&
    echo "Icon=`echo "ooo-${appl}3.2" | sed 's/\.desktop//'`" >> $appl
done &&
sed -i 's@bin/sprinteradmin@bin/spadmin@' printeradmin.desktop &&
cp -v *.desktop /usr/share/applications &&
popd

update-desktop-database

cp -v dictionaries/unxlngi6.pro/bin/dict-*.oxt sdext/unxlngi6.pro/bin/*.oxt reportbuilder/unxlngi6.pro/bin/report-builder.oxt swext/unxlngi6.pro/bin/wiki-publisher.oxt /opt/openoffice-3.2.1/share/extension/install

for ext in /opt/openoffice-3.2.1/share/extension/install/*.oxt
do
    /opt/openoffice-3.2.1/program/unopkg add --shared --verbose $ext
done

ln -sv /opt/openoffice-3.2.1/program/libnpsoplugin.so ${FFPATH}/plugins

Thursday, 9 December 2010

Updated BLFS Packages - Firefox

First the stand alone Firefox dependency Yasm:

cd /sources/extras
wget http://www.tortall.net/projects/yasm/releases/yasm-0.8.0.tar.gz
cd /dev/shm
tar -xzvf /sources/extras/yasm-0.8.0.tar.gz
cd yasm-0.8.0
CC="gcc -fPIC" ./configure --prefix=/usr
time make $CORES_TO_USE
make install
cd ..
rm -rvf yasm-0.8.0

Now Firefox:

cd /sources/extras
wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/4.0b7/source/firefox-4.0b7.source.tar.bz2
cd /dev/shm
tar -xjvf /sources/extras/firefox-4.0b7.source.tar.bz2
cd moz*
cat > .mozconfig << "EOF"
ac_add_options --enable-application=browser
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../firefox-build
mk_add_options MOZ_MAKE_FLAGS="-j2"
#Or -j4 or -j8 or comment the whole thing out for single core.
ac_add_options --prefix=/opt/firefox
ac_add_options --enable-optimize
ac_add_options --enable-system-cairo
ac_add_options --enable-system-sqlite
ac_add_options --enable-pango
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-jpeg
#ac_add_options --with-system-png
ac_add_options --with-pthreads
ac_add_options --with-system-zlib
ac_add_options --disable-accessibility
ac_add_options --disable-crashreporter
ac_add_options --disable-dbus
ac_add_options --disable-gnomevfs
ac_add_options --disable-necko-wifi
ac_add_options --disable-installer
ac_add_options --disable-javaxpcom
ac_add_options --disable-tests
ac_add_options --disable-updater
ac_add_options --disable-libnotify
ac_add_options --enable-official-branding
ac_add_options --enable-safe-browsing
ac_add_options --enable-strip
EOF

time make -f client.mk build
make -f client.mk install
cd ..
rm -rvf moz*

Be sure to check your install path and then change the text in the following command if needs be:

cat >> /etc/profile.d/custom_variables.sh << "EOF"
FFPATH=/opt/firefox/lib/firefox-4.0b7
EOF

source /etc/profile

cat >> /etc/ld.so.conf << "EOF"
# Extra Path so Firefox's libraries can be used by Flash10
/opt/firefox/lib/firefox-4.0b7
# End of Extra Path.
EOF

And now download and install the essential plugin flashplayer, and link the Java plugin.

wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
tar -xzvf install_flash_player_10_linux.tar.gz
mkdir -v ${FFPATH}/plugins
cp -v libflashplayer.so ${FFPATH}/plugins
ln -sv /opt/jdk/jre/lib/i386/libnpjp2.so ${FFPATH}/plugins

Wednesday, 8 December 2010

Updated BLFS Packages - Desktop

We are using a slightly different install procedure this time. We are starting with GTK, then installing the Dependencies, and then moving on to applications. I put Openbox and Slim under that category, so here we go with the streamlined install now that the dependencies are taken care of:

cd /sources/desktop
wget http://download.berlios.de/slim/slim-1.3.2.tar.gz
wget http://openbox.org/dist/openbox/openbox-3.4.11.1.tar.gz
wget http://prdownloads.sourceforge.net/obmenu/obmenu-1.0.tar.gz
wget http://openbox.org/dist/obconf/obconf-2.0.3.tar.gz

cd /dev/shm

tar -xzvf /sources/desktop/slim-1.3.2.tar.gz 
cd slim-1.3.2 
sed -i -e "s:^MANDIR=.*:MANDIR=/usr/share/man:" -e "s:/usr/X11R6:/usr:" Makefile 
sed -i -e 's#X11R6/##g' -e 's#/usr/bin:##' -e 's/# daemon/daemon/' slim.conf
make $CORES_TO_USE 
make install 
cat >> /etc/inittab << "EOF"
x:5:respawn:/usr/bin/slim >& /dev/null 
EOF
cd .. 
rm -rf slim-1.3.2

tar -xzvf /sources/desktop/openbox-3.4.11.1.tar.gz
cd openbox-3.4.11.1
./configure --prefix=/usr --sysconfdir=/etc --disable-session-management
make $CORES_TO_USE
make install
cat > /root/.xinitrc << "EOF"
# Begin .xinitrc file
#xterm  -g 80x20+0+0   &
#xclock -g 100x100-0+0 &
exec openbox-session
EOF
cd ..
rm -rvf openbox-3.4.11.1

mkdir -p ~/.config/openbox
cp /etc/xdg/openbox/*.* ~/.config/openbox
cat > ~/.config/openbox/menu.xml << "EOF"
<?xml version="1.0" encoding="UTF-8"?>

<openbox_menu xmlns="http://openbox.org/3.4/menu">

<menu id="apps-editors-menu" label="Editors">
<item label="nano">
<action name="Execute">
<command>xterm -e /usr/bin/nano</command>
<startupnotify>
<enabled>yes</enabled>
</startupnotify>
</action>
</item>
</menu>

<menu id="apps-term-menu" label="Terminals">
<item label="Xterm">
<action name="Execute"><command>xterm</command></action>
</item>
</menu>

<menu id="apps-net-menu" label="Internet">
<item label="lynx">
<action name="Execute">
<command>xterm -e /usr/bin/lynx</command>
<startupnotify>
<enabled>yes</enabled>
</startupnotify>
</action>
</item>
</menu>

<menu id="apps-multimedia-menu" label="Multimedia">
<item label="alsamixer">
<action name="Execute">
<command>xterm -e /usr/bin/alsamixer</command>
<startupnotify>
<enabled>yes</enabled>
</startupnotify>
</action>
</item>
</menu>

<menu id="system-menu" label="System">
<item label="Openbox Configuration Manager">
<action name="Execute">
<command>obconf</command>
<startupnotify><enabled>yes</enabled></startupnotify>
</action>
</item>
<item label="Openbox Menu Editor">
<action name="Execute">
<execute>obmenu</execute>
</action>
</item>
<separator />
<item label="Reconfigure Openbox">
<action name="Reconfigure" />
</item>
</menu>

<menu id="root-menu" label="Openbox 3">
<separator label="Applications" />
<menu id="apps-editors-menu"/>
<menu id="apps-net-menu"/>
<menu id="apps-multimedia-menu"/>
<menu id="apps-term-menu"/>
<separator label="System" />
<menu id="system-menu"/>
<separator />
<item label="Log Out">
<action name="Exit">
<prompt>yes</prompt>
</action>
</item>
</menu>

</openbox_menu>
EOF


tar -xzvf /sources/desktop/obmenu-1.0.tar.gz
cd obmenu-1.0
python setup.py install
cd ..
rm -rvf obmenu-1.0

tar -xzvf /sources/desktop/obconf-2.0.3.tar.gz
cd obconf-2.0.3
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf obconf-2.0.3

Remember to nano both /etc/slim.conf and /etc/inittab, and to change the settings therein confirm to the instructions here.

Tuesday, 7 December 2010

LFS - Popular Dependencies

I have installed a number of bits of software onto my bare LFS/X/GTK system now, and I have noticed that I have come across the same dependencies time and again. I have installed Firefox, OpenOffice and a number of smaller applications, all of which shared to an extent background software. So, for the next build, I thought it would be a good idea to stick all of that software into a blogpost so I have a record of the shared stuff, so I can install it all in a one-er and then get on with the applications themselves.

First of all, there are a few packages which crop up and I keep having to double check that I have installed them. I have, because they form part of the core system. They are:

Installed with LFS
zlib
libuuid

Installed Basics
zip
unzip
lzma
openssl

Installed with Xorg:
XML::Parser
Intltool
libpng (and yes I applied the patch to allow it to be used with Firefox)
Fontconfig
Pixman

Installed with GTK:
Cairo
Pango
PCRE
tiff
jpeg

I do not need to worry about those again, they are already installed. So what is not, and what is the best order to install these extras in? I think first of all we will install some programs that do not depend on any of the other packages we are about to dump into the system. SQLite is a database program and startup-notification makes the pointer do the hourglass thing while another program is starting up. For some programs, unbelievably this is actually a prerequisite.

I am going to stick all of these source files in a separate folder in sources - this is just to show that they are not part of the structure of LFS, and neither are they the Applications that I will end up running.

mkdir /sources/dependencies
cd /sources/dependencies
wget http://ftp.gnome.org/pub/gnome/sources/startup-notification/0.9/startup-notification-0.9.tar.bz2
wget http://sqlite.org/sqlite-amalgamation-3.7.3.tar.gz

cd /dev/shm
tar -xjvf /sources/dependencies/startup-notification-0.9.tar.bz2
cd startup-notification-0.9
./configure --prefix=/usr &&
make $CORES_TO_USE
make install &&
install -v -m644 -D doc/startup-notification.txt /usr/share/doc/startup-notification-0.9/startup-notification.txt
cd ..
rm -rvf startup-notification-0.9

tar -xzvf /sources/dependencies/sqlite-amalgamation-3.7.3.tar.gz
cd sqlite-3.7.3
CFLAGS="-g -O2 -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_UNLOCK_NOTIFY=1" ./configure --prefix=/usr --enable-threadsafe --enable-readline --enable-dynamic-extensions &&
make $CORES_TO_USE
make install
cd ..
rm -rvf sqlite-3.7.3

Lets move on to a biggie which is the Python language. A number of applications use this, as do some of the intermediate libraries.

cd /sources/dependencies
wget http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2
wget http://www.linuxfromscratch.org/patches/blfs/svn/Python-2.6.4-bdb_4.8-1.patch
wget http://docs.python.org/ftp/python/doc/2.6/python-2.6-docs-html.tar.bz2

cd /dev/shm
tar -xjvf /sources/dependencies/Python-2.6.4.tar.bz2
cd Python-2.6.4
sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py
patch -Np1 -i /sources/dependencies/Python-2.6.4-bdb_4.8-1.patch
./configure --prefix=/usr --enable-shared
make $CORES_TO_USE
make install
chmod -v 755 /usr/lib/libpython2.6.so.1.0
install -v -m755 -d /usr/share/doc/Python-2.6.4/html
tar --strip-components=1 --no-same-owner --no-same-permissions -C /usr/share/doc/Python-2.6.4/html -xvf /sources/dependencies/python-2.6-docs-html.tar.bz2
cat >> /etc/profile.d/35-python.sh << "EOF"
export PYTHONDOCS=/usr/share/doc/Python-2.6.4/html
EOF
cd ..
rm -rvf Python-2.6.4

Right, now it is time for some hot library action:

cd /sources/dependencies
wget http://ftp.gnome.org/pub/gnome/sources/libIDL/0.8/libIDL-0.8.14.tar.bz2
wget http://xmlsoft.org/sources/libxml2-2.7.6.tar.gz
wget http://xmlsoft.org/sources/libxslt-1.1.26.tar.gz
wget ftp://sourceware.org/pub/libffi/libffi-3.0.8.tar.gz
wget http://ftp.gnome.org/pub/gnome/sources/libglade/2.6/libglade-2.6.4.tar.bz2

cd /dev/shm
tar -xjvf /sources/dependencies/libIDL-0.8.14.tar.bz2
cd libIDL-0.8.14
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf libIDL-0.8.14

tar -xzvf /sources/dependencies/libxml2-2.7.6.tar.gz
cd libxml2-2.7.6
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf libxml2-2.7.6

tar -xzvf /sources/dependencies/libxslt-1.1.26.tar.gz
cd libxslt-1.1.26
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf libxslt-1.1.26

tar -xzvf /sources/dependencies/libffi-3.0.8.tar.gz
cd libffi-3.0.8
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf libffi-3.0.8

tar -jxvf /sources/dependencies/libglade-2.6.4.tar.bz2
cd libglade-2.6.4
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf libglade-2.6.4

Still on the libraries front, we installed Glib, Cairo, Pango and GTK. Some applications need GTK to be able to speak C++ so we need to install the following crossover libraries (the libsigc++ is needed for glibmm). Note that this project has taken so long that I am now out of date with my version of glib. I had to update it before I could install glibmm. I also had to update gtk+2 and ATK, but not cairo or pango. I will write up a new GTK+2 installation post to bring the installation up to date.

cd /sources/dependencies
wget http://cairographics.org/releases/cairomm-1.6.2.tar.gz
wget http://ftp.gnome.org/pub/gnome/sources/libsigc++/2.2/libsigc++-2.2.8.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/glibmm/2.24/glibmm-2.24.2.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/pangomm/2.26/pangomm-2.26.2.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/gtkmm/2.20/gtkmm-2.20.3.tar.bz2

cd /dev/shm
tar -xzvf /sources/dependencies/cairomm-1.6.2.tar.gz
cd cairomm-1.6.2
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf cairomm-1.6.2

tar -xjvf /sources/dependencies/libsigc++-2.2.8.tar.bz2
cd libsigc++-2.2.8
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf libsigc++-2.2.8

tar -xjvf /sources/dependencies/glibmm-2.24.2.tar.bz2
cd glibmm-2.24.2
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf glibmm-2.24.2

tar -xjvf /sources/dependencies/pangomm-2.26.2.tar.bz2
cd pangomm-2.26.2
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf pangomm-2.26.2

tar -xjvf /sources/dependencies/gtkmm-2.20.3.tar.bz2
cd gtkmm-2.20.3
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf gtkmm-2.20.3

The next set are modules which plug in to the Python and give it access to GTK.

cd /sources/dependencies
wget http://ftp.gnome.org/pub/gnome/sources/gobject-introspection/0.6/gobject-introspection-0.6.14.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/pygobject/2.21/pygobject-2.21.3.tar.bz2
wget http://cairographics.org/releases/pycairo-1.8.8.tar.gz
wget http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.17/pygtk-2.17.0.tar.bz2
wget http://downloads.sourceforge.net/pyxml/PyXML-0.8.4.tar.gz
wget http://ftp.gnome.org/pub/gnome/sources/gtksourceview/2.10/gtksourceview-2.10.4.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/pygtksourceview/2.10/pygtksourceview-2.10.1.tar.bz2

cd /dev/shm
tar -xjvf /sources/dependencies/gobject-introspection-0.6.14.tar.bz2
cd gobject-introspection-0.6.14
./configure --prefix=/usr --disable-tests &&
make $CORES_TO_USE
make install
cd ..
rm -rvf gobject-introspection-0.6.14

tar -xjvf /sources/dependencies/pygobject-2.21.3.tar.bz2
cd pygobject-2.21.3
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf pygobject-2.21.3

tar -xzvf /sources/dependencies/pycairo-1.8.8.tar.gz
cd pycairo-1.8.8
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf pycairo-1.8.8

tar -xjvf /sources/dependencies/pygtk-2.17.0.tar.bz2
cd pygtk-2.17.0
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf pygtk-2.17.0

tar -xzvf /sources/dependencies/PyXML-0.8.4.tar.gz
cd PyXML-0.8.4
python setup.py build
python setup.py install &&
install -v -m644 doc/man/xmlproc_*.1 /usr/share/man/man1 &&
install -v -m755 -d /usr/share/doc/PyXML-0.8.4 &&
cp -v -R doc demo test /usr/share/doc/PyXML-0.8.4 &&
install -v -m644 README* /usr/share/doc/PyXML-0.8.4
cd ..
rm -rvf PyXML-0.8.4

tar -xjvf /sources/dependencies/gtksourceview-2.10.4.tar.bz2
cd gtksourceview-2.10.4
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf gtksourceview-2.10.4

tar -xjvf /sources/dependencies/pygtksourceview-2.10.1.tar.bz2
cd pygtksourceview-2.10.1
./configure --prefix=/usr --disable-docs &&
make $CORES_TO_USE
make install
cd ..
rm -rvf pygtksourceview-2.10.1

Sticking with the previous theme, we also need to install some modules for Perl:

cd /sources/dependencies
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/Archive-Zip-1.20.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/IO-Compress-Base-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/Compress-Raw-Bzip2-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/IO-Compress-Bzip2-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/Compress-Raw-Zlib-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/IO-Compress-Zlib-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/Compress-Zlib-2.005.tar.gz

cd /dev/shm
tar -xzvf /sources/dependencies/IO-Compress-Base-2.005.tar.gz
cd  IO-Compress-Base-2.005
perl Makefile.PL &&
make &&
make install
cd ..
rm -rvf  IO-Compress-Base-2.005

tar -xzvf /sources/dependencies/Compress-Raw-Bzip2-2.005.tar.gz
cd  Compress-Raw-Bzip2-2.005
perl Makefile.PL &&
make &&
make install
cd ..
rm -rvf  Compress-Raw-Bzip2-2.005

tar -xzvf /sources/dependencies/IO-Compress-Bzip2-2.005.tar.gz
cd  IO-Compress-Bzip2-2.005
perl Makefile.PL &&
make &&
make install
cd ..
rm -rvf  IO-Compress-Bzip2-2.005

tar -xzvf /sources/dependencies/Compress-Raw-Zlib-2.005.tar.gz
cd  Compress-Raw-Zlib-2.005
sed -i -e "s|BUILD_ZLIB\s*= True|BUILD_ZLIB = False|" -e "s|INCLUDE\s*= ./zlib-src|INCLUDE    = /usr/include|" -e "s|LIB\s*= ./zlib-src|LIB        = /usr/lib|" config.in
perl Makefile.PL &&
make &&
make install
cd ..
rm -rvf  Compress-Raw-Zlib-2.005

tar -xzvf /sources/dependencies/IO-Compress-Zlib-2.005.tar.gz
cd  IO-Compress-Zlib-2.005
perl Makefile.PL &&
make &&
make install
cd ..
rm -rvf  IO-Compress-Zlib-2.005

tar -xzvf /sources/dependencies/Compress-Zlib-2.005.tar.gz
cd  Compress-Zlib-2.005
perl Makefile.PL &&
make &&
make install
cd ..
rm -rvf  Compress-Zlib-2.005

tar -xzvf /sources/dependencies/Archive-Zip-1.20.tar.gz
cd  Archive-Zip-1.20
perl Makefile.PL &&
make &&
make install
cd ..
rm -rf  Archive-Zip-1.20

Now we need some applications which are regularly relied on:

cd /sources/dependencies
wget ftp://ftp.gnu.org/gnu/which/which-2.20.tar.gz
wget http://curl.haxx.se/download/curl-7.20.0.tar.bz2

cd /dev/shm
tar -xzvf /sources/dependencies/which-2.20.tar.gz
cd which-2.20
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf which-2.20

tar -xjvf /sources/dependencies/curl-7.20.0.tar.bz2
cd curl-7.20.0
./configure --prefix=/usr
make $CORES_TO_USE
make install
find docs -name "Makefile*" -o -name "*.1" -o -name "*.3" | xargs rm
install -v -d -m755 /usr/share/doc/curl-7.20.0
cp -v -R docs/* /usr/share/doc/curl-7.20.0
cd ..
rm -rvf curl-7.20.0

And some C++ stuff which I am a little in the dark about.

cd /sources/dependencies
wget http://downloads.sourceforge.net/boost/boost-jam-3.1.17.tgz
wget http://downloads.sourceforge.net/boost/boost_1_37_0.tar.bz2
cd /dev/shm
tar -xzvf /sources/dependencies/boost-jam-3.1.17.tgz
cd boost-jam-3.1.17
./build.sh
cd bin.linux* &&
cp -v bjam /usr/bin
cd ..
rm -rvf boost-jam-3.1.17

tar -xjvf /sources/dependencies/boost_1_37_0.tar.bz2
cd boost_1_37_0
./configure --prefix=/usr --with-toolset=gcc --with-bjam=/usr/bin/bjam &&
make $CORES_TO_USE
make install &&
ln -sfnv boost-1_37/boost /usr/include/boost
cd ..
rm -rvf boost_1_37_0

Some security libraries (and a stand alone SQLite database to support them:

cd /sources/dependencies
wget http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.6/src/nspr-4.8.6.tar.gz
wget http://www.linuxfromscratch.org/patches/blfs/svn/nspr-4.8.6-pkgconfig-1.patch
wget http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_12_4_RTM/src/nss-3.12.4.tar.gz
wget http://svn.cross-lfs.org/svn/repos/patches/nss/nss-3.12.4-fixes-1.patch
wget http://cross-lfs.org/~jciccone/nss-3.12-r5-config.in

cd /dev/shm

tar -xzvf /sources/dependencies/nspr-4.8.6.tar.gz
cd nspr-4.8.6
patch -Np1 -i /sources/dependencies/nspr-4.8.6-pkgconfig-1.patch &&
cd mozilla/nsprpub &&
./configure --prefix=/usr --with-mozilla --with-pthreads &&
make $CORES_TO_USE
make install &&
cp -v -LR dist/include/nspr /usr/include &&
rm -v -f /usr/bin/{prerr.properties,compile-et.pl}
cd ../../..
rm -rvf nspr-4.8.6

tar -xzvf /sources/dependencies/nss-3.12.4.tar.gz
cd nss-3.12.4
patch -Np0 -i /sources/dependencies/nss-3.12.4-fixes-1.patch &&
sed -i 's@\$(MKSHLIB) -o@\$(MKSHLIB) \$(LDFLAGS) -o@g' mozilla/security/coreconf/rules.mk &&
for dir in mozilla/security/{coreconf,dbm,nss}; do
  make -C $dir  BUILD_OPT=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 NSPR_INCLUDE_DIR=$(pkg-config --variable=includedir nspr) NSPR_LIB_DIR=$(pkg-config --variable=libdir nspr) FREEBL_NO_DEPEND=1 || break
done
for file in libsoftokn3.so libfreebl3.so libnss3.so libnssutil3.so libssl3.so libsmime3.so libnssckbi.so libnssdbm3.so; do
  install -m755 mozilla/dist/*.OBJ/lib/${file} /usr/lib
done
for file in libcrmf.a libnssb.a libnssckfw.a; do
  install -m644 mozilla/dist/*.OBJ/lib/${file} /usr/lib
done
for file in certutil cmsutil crlutil modutil pk12util signtool signver ssltap; do
  install -m755 mozilla/dist/*.OBJ/bin/${file} /usr/bin
done
install -m755 -d /usr/include/nss3
install -m644 mozilla/dist/public/nss/*.h /usr/include/nss3 &&
ln -sfv nss3 /usr/include/nss
cat > /usr/lib/pkgconfig/nss.pc << "EOF"
prefix=/usr
exec_prefix=/usr/bin
libdir=/usr/lib
includedir=/usr/include/nss3

Name: NSS
Description: Network Security Services
Version: 3.12.4
Requires: sqlite3 nspr >= 4.8
Libs: -L${libdir} -lssl3 -lsmime3 -lnss3 -lnssutil3
Cflags: -I${includedir}
EOF

chmod 644 /usr/lib/pkgconfig/nss.pc
ln -sfv nss.pc /usr/lib/pkgconfig/mozilla-nss.pc

install -v -m755 /sources/dependencies/nss-3.12-r5-config.in /usr/bin/nss-config &&
sed -i -e "s/@MOD_MAJOR_VERSION@/3/" -e "s/@MOD_MINOR_VERSION@/12/" -e "s/@MOD_PATCH_VERSION@/3/" -e "s/@prefix@/\/usr/" /usr/bin/nss-config

cd ..
rm -rvf nss-3.12.4

Lastly I am going to install some Java software including, stunningly, Java. Download the Java source from this link into the /sources/extras folder. Then run these commands:

cd /dev/shm
chmod +x /sources/extras/jdk-6u21-linux-i586.bin
/sources/extras/jdk-6u21-linux-i586.bin
cd jdk1.6.0_21
install -v -m755 -d /opt/jdk-6u21
mv -v * /opt/jdk-6u21
chown -v -R root:root /opt/jdk-6u21
ln -v -sf xawt/libmawt.so /opt/jdk-6u21/jre/lib/i386/
cd ..
sed -i 's@XINERAMA@FAKEEXTN@g' /opt/jdk-6u21/jre/lib/i386/xawt/libmawt.so
ln -v -nsf jdk-6u21 /opt/jdk

cat >> /etc/profile.d/30-jdk.sh << "EOF"
# Begin /etc/profile.d/30-jdk.sh

# Set JAVA_HOME directory
JAVA_HOME=/opt/jdk

# Adjust PATH
pathappend ${JAVA_HOME}/bin PATH

# Auto Java CLASSPATH
# Copy jar files to, or create symlinks in this directory
AUTO_CLASSPATH_DIR=/usr/lib/classpath
pathprepend . CLASSPATH
for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
pathappend $dir CLASSPATH
done

export JAVA_HOME CLASSPATH
unset AUTO_CLASSPATH_DIR
unset dir

# End /etc/profile.d/30-jdk.sh
EOF

source /etc/profile

JUnit is not, as you may be forgiven for assuming, a boy band. It is, instead, a small Java application that allows various tests to be run on other Java applications, such as Apache Ant which is a Java based alternative to [make] and OpenOffice.org, amongst others, is going to use it to compile.

cd /sources/dependencies
wget http://downloads.sourceforge.net/junit/junit4.8.1.zip
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/a/apache-ant-1.8.1-src.tar.bz2

cd /dev/shm
unzip /sources/dependencies/junit4.8.1.zip
cd junit4.8.1
install -v -m755 -d /usr/share/{,doc/}junit-4.8.1 &&
chown -R root:root . &&
cp -v -R junit* org  /usr/share/junit-4.8.1 &&
cp -v -R *.html *doc /usr/share/doc/junit-4.8.1
export CLASSPATH=$CLASSPATH:/usr/share/junit-4.8.1/junit-4.8.1.jar:/usr/share/junit-4.8.1
cd ..
rm -rvf junit4.8.1

tar -jxvf /sources/dependencies/apache-ant-1.8.1-src.tar.bz2
cd apache-ant-1.8.1
sed -i 's|${dist.dir}/etc|/etc/ant|'        build.xml &&
sed -i 's|/etc/ant.conf|/etc/ant/ant.conf|' src/script/ant &&
cp -v /usr/share/junit-4.8.1/junit-4.8.1.jar lib/optional/junit.jar
./build.sh -Ddist.dir=/opt/ant-1.8.1 dist &&
ln -v -sf /etc/ant /opt/ant-1.8.1/etc &&
ln -v -sf ant-1.8.1 /opt/ant
cd ..
rm -rvf apache-ant-1.8.1

Monday, 6 December 2010

Updated BLFS Packages - GTK

The reason for this update is two fold. Firstly I have nearly finished a stand alone post incorporating all the libraries, languages and programs that I found the applications I wanted to install (Firefox, OpenOffice et al) had as dependencies. If these are all installed in a one-er it makes it easier to go on and install the applications AND it makes it easier to update one post when there are version changes. Secondly, so much time had passed between my original post on GTK that that version was out of date. So, I need to bring GTK up to date. I will just be updating the All In One post, all the explanations set out in full in the main post still apply, but do not need to be rehearsed here.

So, the current installation idea is: Configuration, Toolchain, Actual Build, Hardware, Xorg, GTK, Shared Prerequisites, Desktop, and finally applications. Here is the new GTK. I had to go beyond BLFS and upgrade Glib and GTK+2 because they just did not work. In addition, Firefox in particular wanted the latest version of Cairo available, so I had to upgrade it, which meant that the Pixman version installed with Xorg was no longer good enough, so that needed updated as well. The latest version of GTK+2 wanted an updated pixbuf package, which I think used to be incorporated in GTK+2.

mkdir /sources/desktop
cd /sources/desktop
wget http://www.ijg.org/files/jpegsrc.v7.tar.gz
wget http://download.osgeo.org/libtiff/tiff-3.9.4.tar.gz
wget http://downloads.sourceforge.net/pcre/pcre-8.10.tar.bz2
wget http://cairographics.org/releases/pixman-0.21.2.tar.gz
wget http://cairographics.org/releases/cairo-1.10.0.tar.gz
wget http://ftp.gnome.org/pub/gnome/sources/glib/2.27/glib-2.27.3.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/pango/1.28/pango-1.28.1.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/atk/1.30/atk-1.30.0.tar.bz2
wget http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.22/gdk-pixbuf-2.22.1.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/gtk+/2.22/gtk+-2.22.1.tar.bz2

cd /dev/shm

tar -xzvf /sources/desktop/jpegsrc.v7.tar.gz
cd jpeg-7
./configure --prefix=/usr --enable-static --enable-shared
make
make install
cd ..
rm -rf jpeg-7
ldconfig

tar -xzvf /sources/desktop/tiff-3.9.4.tar.gz
cd tiff-3.9.4
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf tiff-3.9.4

tar -xjvf /sources/desktop/pcre-8.10.tar.bz2
cd pcre-8.10
./configure --prefix=/usr --docdir=/usr/share/doc/pcre-8.10 --enable-utf8 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2
make $CORES_TO_USE
make install
mv -v /usr/lib/libpcre.so.* /lib/
ln -v -sf ../../lib/libpcre.so.0 /usr/lib/libpcre.so
cd ..
rm -rvf pcre-8.10

tar -xzvf /sources/desktop/pixman-0.21.2.tar.gz
cd pixman-0.21.2
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf pixman-0.21.2

tar -xzvf /sources/desktop/cairo-1.10.0.tar.gz
cd cairo-1.10.0
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf cairo-1.10.0

tar -xjvf /sources/desktop/glib-2.27.3.tar.bz2
cd glib-2.27.3
./configure --prefix=/usr --with-pcre=system
make $CORES_TO_USE
make $CORES_TO_USE install
cat > /etc/profile.d/glib2-locale.sh << "EOF"
# Use the current locale charset for filenames
# in applications using GLib
export G_FILENAME_ENCODING=@locale
EOF
cd ..
rm -rvf glib-2.27.3

tar -xjvf /sources/desktop/pango-1.28.1.tar.bz2
cd pango-1.28.1
./configure --prefix=/usr --sysconfdir=/etc
make $CORES_TO_USE
make install
cd ..
rm -rvf pango-1.28.1

tar -xjvf /sources/desktop/atk-1.30.0.tar.bz2
cd atk-1.30.0
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf atk-1.30.0

tar -xjvf /sources/desktop/gdk-pixbuf-2.22.1.tar.bz2
cd gdk-pixbuf-2.22.1
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf gdk-pixbuf-2.22.1

tar -xjvf /sources/desktop/gtk+-2.22.1.tar.bz2
cd gtk+-2.22.1
./configure --prefix=/usr --sysconfdir=/etc &&
make $CORES_TO_USE
make install &&
install -v -m755 -d /usr/share/doc/gtk+-2.22.1/{faq,tutorial} &&
cp -v -R docs/faq/html/* /usr/share/doc/gtk+-2.22.1/faq &&
cp -v -R docs/tutorial/html/* /usr/share/doc/gtk+-2.22.1/tutorial &&
install -v -m644 docs/*.txt /usr/share/doc/gtk+-2.22.1
cd ..
rm -rvf gtk+-2.22.1

Version 2.22 of gtk+2 has problems with icons. In particular you need to install some icons to fill in some blanks. The easiest way to sort this is to install the gnome icon theme. We first of all need a program to make the theme names backwards compatible. Don't really know what this is about, but it also needs another XML::Type of Thing.

cd /sources/dependencies
wget http://cpan.org/authors/id/G/GR/GRANTM/XML-Simple-2.18.tar.gz
wget http://tango.freedesktop.org/releases/icon-naming-utils-0.8.90.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/gnome-icon-theme/2.30/gnome-icon-theme-2.30.3.tar.bz2

cd /dev/shm

tar -xzvf /sources/dependencies/XML-Simple-2.18.tar.gz
cd XML-Simple-2.18
perl Makefile.PL
make $CORES_TO_USE
make install
cd ..
rm -rvf XML-Simple-2.18

tar -xjvf /sources/dependencies/icon-naming-utils-0.8.90.tar.bz2
cd icon-naming-utils-0.8.90
./configure --prefix=/usr --libexecdir=/usr/lib/icon-naming-utils &&
make $CORES_TO_USE
make install
cd ..
rm -rvf icon-naming-utils-0.8.90

tar -xjvf /sources/dependencies/gnome-icon-theme-2.30.3.tar.bz2
cd gnome-icon-theme-2.30.3
./configure --prefix=/usr &&
make $CORES_TO_USE
make install
cd ..
rm -rvf gnome-icon-theme-2.30.3

You then need to create a configuration file for gtk to point it to the new icons we just installed.

cat > ~/.gtkrc-2.0 << "EOF"
gtk-icon-theme-name="gnome"
EOF

Friday, 3 December 2010

LFS - OpenOffice.org

mkdir /sources/ooo
cd /sources/ooo
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/a/apache-ant-1.8.0-src.tar.bz2
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/Archive-Zip-1.20.tar.gz
wget http://downloads.sourceforge.net/junit/junit4.8.1.zip
wget http://ftp.osuosl.org/pub/openoffice/stable/3.2.1/OOo_3.2.1_src_core.tar.bz2
wget http://ftp.osuosl.org/pub/openoffice/stable/3.2.1/OOo_3.2.1_src_system.tar.bz2
wget http://www.linuxfromscratch.org/patches/blfs/svn/OOo_3.2.1-build_with_db5-1.patch
wget ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/1.1.14/seamonkey-1.1.14.source.tar.bz2
wget ftp://ftp.osuosl.org/pub/openoffice/stable/3.2.1/OOo_3.2.1_src_l10n.tar.bz2
wget ftp://ftp.osuosl.org/pub/openoffice/stable/3.2.1/OOo_3.2.1_src_extensions.tar.bz2

JUnit is not, as you may be forgiven for assuming, a boy band. It is, instead, a small Java application that allows various tests to be run on other Java applications (such as the one we are about to install).

unzip /sources/ooo/junit4.8.1.zip
cd junit4.8.1
install -v -m755 -d /usr/share/{,doc/}junit-4.8.1 &&
chown -R root:root . &&
cp -v -R junit* org  /usr/share/junit-4.8.1 &&
cp -v -R *.html *doc /usr/share/doc/junit-4.8.1
export CLASSPATH=$CLASSPATH:/usr/share/junit-4.8.1/junit-4.8.1.jar:/usr/share/junit-4.8.1
cd ..
rm -rvf junit4.8.1

Apache Ant is a Java based alternative to [make] and OpenOffice.org is going to use it to compile.

tar -jxvf /sources/ooo/apache-ant-1.8.0-src.tar.bz2
cd apache-ant-1.8.0
sed -i 's|${dist.dir}/etc|/etc/ant|'        build.xml &&
sed -i 's|/etc/ant.conf|/etc/ant/ant.conf|' src/script/ant &&
cp -v /usr/share/junit-4.8.1/junit-4.8.1.jar lib/optional/junit.jar
./build.sh -Ddist.dir=/opt/ant-1.8.0 dist &&
ln -v -sf /etc/ant /opt/ant-1.8.0/etc &&
ln -v -sf ant-1.8.0 /opt/ant
cd ..
rm -rvf apache-ant-1.8.0

Next we come to one of my favourite ways BLFS has of fucking me off. If you look at the prerequisites for OpenOffice.org 3.2.1 in BLFS here you see Apache Ant, (good just installed that), GTK+2 (installed that ages ago), the Perl module XML::Parser (installed for Xorg), another one called Archive::Zip (right, need that), which (installed it to get lspci working with PowerTop), Zip and Unzip (both installed AGES ago).

Looks easy dunnit? Only one tiny Perl Module to install. Ah. Welcome to the wonders of Perl Module dependencies. Archive::Zip needs Compress::Zlib, which in turn needs ... ohforfuckssake. Just have a look at this:

cd /sources/ooo
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/IO-Compress-Base-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/Compress-Raw-Bzip2-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/IO-Compress-Bzip2-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/Compress-Raw-Zlib-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/IO-Compress-Zlib-2.005.tar.gz
wget http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules/Compress-Zlib-2.005.tar.gz

Incidentally I am using the Server Beach mirror for these files, because I have had problems in the past trying to find them. They are pretty tiny, so hopefully that's OK.

tar -xzvf /sources/ooo/IO-Compress-Base-2.005.tar.gz
cd  IO-Compress-Base-2.005
perl Makefile.PL &&
make &&
make test
make install
cd ..
rm -rvf  IO-Compress-Base-2.005

tar -xzvf /sources/ooo/Compress-Raw-Bzip2-2.005.tar.gz
cd  Compress-Raw-Bzip2-2.005
perl Makefile.PL &&
make &&
make test
make install
cd ..
rm -rvf  Compress-Raw-Bzip2-2.005

tar -xzvf /sources/ooo/IO-Compress-Bzip2-2.005.tar.gz
cd  IO-Compress-Bzip2-2.005
perl Makefile.PL &&
make &&
make test
make install
cd ..
rm -rvf  IO-Compress-Bzip2-2.005

tar -xzvf /sources/ooo/Compress-Raw-Zlib-2.005.tar.gz
cd  Compress-Raw-Zlib-2.005
sed -i -e "s|BUILD_ZLIB\s*= True|BUILD_ZLIB = False|" -e "s|INCLUDE\s*= ./zlib-src|INCLUDE    = /usr/include|" -e "s|LIB\s*= ./zlib-src|LIB        = /usr/lib|" config.in
perl Makefile.PL &&
make &&
make test
make install
cd ..
rm -rvf  Compress-Raw-Zlib-2.005

tar -xzvf /sources/ooo/IO-Compress-Zlib-2.005.tar.gz
cd  IO-Compress-Zlib-2.005
perl Makefile.PL &&
make &&
make test
make install
cd ..
rm -rvf  IO-Compress-Zlib-2.005

tar -xzvf /sources/ooo/Compress-Zlib-2.005.tar.gz
cd  Compress-Zlib-2.005
perl Makefile.PL &&
make &&
make test
make install
cd ..
rm -rvf  Compress-Zlib-2.005

tar -xzvf /sources/ooo/Archive-Zip-1.20.tar.gz
cd  Archive-Zip-1.20
perl Makefile.PL &&
make &&
make test
make install
cd ..
rm -rf  Archive-Zip-1.20

Buggeration, we also need gperf:

wget http://ftp.gnu.org/gnu/gperf/gperf-3.0.4.tar.gz
tar -xzvf gperf-3.0.4.tar.gz
cd gperf-3.0.4
./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.0.4 &&
make
make install &&
install -m644 -v doc/gperf.{dvi,ps,pdf,txt} /usr/share/doc/gperf-3.0.4 &&
pushd /usr/share/info &&
rm -v dir &&
for FILENAME in *; do
    install-info $FILENAME dir 2>/dev/null
done &&
popd
cd ..
rm -rvf gperf-3.0.4

And now for OpenOffice.org which you just cannot install from a ramdisk on a 32bit machine.

cd /sources/ooo
tar -xjvf OOo_3.2.1_src_system.tar.bz2
tar -xjvf OOo_3.2.1_src_core.tar.bz2
tar -xjvf OOo_3.2.1_src_extensions.tar.bz2
tar -xjvf OOo_3.2.1_src_l10n.tar.bz2
cd OOO320_m19
cp ../seamonkey-1.1.14.source.tar.bz2 moz/download/

Don't follow the instructions in BLFS, it gets the seamonkey filename wrong. Apparently OOo shits itself if you have certain environment variables set, so unset them and fire on a patch. In a rapidly developing theme the patch file name is also wrong on BLFS.

umask 0022 &&
unset LANG LC_ALL
patch -Np1 -i ../OOo_3.2.1-build_with_db5-1.patch
autoreconf

Now, set the configuration. I originally tried to set this with:
--with-system-libxml           \
but the system complained that:

to prevent incompatibilities between internal libxslt and libxml2, the office will be build with system-libxslt
checking which libxslt to use... external
checking for LIBXSLT... configure: error: Package requirements (libxslt) were not met:

No package 'libxslt' found

So I just did not tell OOO that I already had libxml installed to force it to use the version that it ships with in the source package.

PKG_CONFIG=/usr/bin/pkg-config ./configure \
--enable-graphite              \
--disable-lockdown             \
--disable-binfilter            \
--disable-fontooo              \
--disable-cups                 \
--enable-fontconfig            \
--disable-symbols              \
--disable-gnome-vfs            \
--disable-systray              \
--disable-odk                  \
--disable-qadevooo             \
--enable-cairo                 \
--disable-dbus                 \
--disable-gconf                \
--enable-gio                   \
--disable-pam                  \
--without-afms                 \
--without-fonts                \
--without-ppds                 \
--without-pam                  \
--with-system-stdlibs          \
--with-system-cairo            \
--with-system-expat            \
--with-system-zlib             \
--with-system-jpeg             \
--with-system-openssl          \
--with-system-python           \
--with-system-curl             \
--with-jdk-home=/opt/jdk       \
--with-java                    \
--with-ant-home=/opt/ant       \
--with-perl-home=/usr          \
--with-x                       \
--with-lang="en-GB"            \
--with-dict="en-GB"            \
--with-package-format=native   \
--with-vendor="Your name here"     \
--with-use-shell=bash

Now compile this all with:

source LinuxX86Env.Set.sh &&
./bootstrap &&
make $CORES_TO_USE

Oh, joy un-fucking-bound. I got this error message (buried in a pile of crap by the way):

/shlibsign: No such file or directory

I did a google search for that and it turned up this post (albeit for someone compiling OOo on Windows). Seems there is something wrong in the Seamonkey Makefile which means it can't define its source directory properly. I did a bit more searching and found this solution.

Now that looks like the contents of a patch file to me. The important lines for this problem are the following:

-SRCDIR = $(call core_abspath,.)
...
 +ifeq ($(OS_TARGET), Linux)
 + SRCDIR = .

Translated into english that means [-] remove the troublesome [SRCDIR] line, and [+] replace it [if] your [TARGET] [OS] [eq]uals [Linux] with [SRCDIR = .]. The patch is for a different version of the Seamonkey source though, and I am not sure how to download or apply it from where I found it even if it was for the version I have. So, best option is to just do the proposed changes by hand. You can do this in [nano] by running the following command:

nano /sources/ooo/OOO320_m19/nss/unxlngi6.pro/misc/build/mozilla/security/nss/cmd/shlibsign/Makefile

You then find [CTRL + W] the core_abspath line and turn it into [SRCDIR = .]. Save the file, and rerun the [make] command. But, of course, that didn't fucking work either. It was still complaining that it couldn't find some file. So I went to a new command prompt and ran the [find] command to get the absolute path to the file. I then re-ran the [nano] command to edit the Makefile and I just pasted in the full absolute path (minus the /[filename] bit at the end). And then it correctly built in:

real    930m58.090s
user    806m18.691s
sys     57m40.225s

930 MINUTES! And, it ran for a good 30-40 minutes before it crashed the first time due to the stupid path problem. So that's 960 minutes at least - a whole 16 HOURS to compile this! The sources folder (with all the working directories for the build) ended up taking up 8.8Gb of space. So no chance to compile on a ramdrive using a 32bit machine then.

Hope I got the settings right. Time to install it.

pushd instsetoo_native/unxlng?6.pro/OpenOffice/native/install/en-US/linux-2.6-*/buildroot/opt &&
cp -r -v openoffice.org3 /opt/openoffice-3.2.1 &&
cp -r -v openoffice.org/* /opt/openoffice-3.2.1 &&
ln -sf basis3.2 /opt/openoffice-3.2.1/basis-link &&
popd

Ok, those commands look a bit odd. The first one [pushd] basically says "Remember where we started and move to the following directory" The one at the end, popd, says, "OK, finished now - go back to where we started. The [&&} at the end of each line tells the system to run all of the commands or none of the commands. So if one fails, or there is a mistake, it doesn't run all of them. The other commands are the usual copy and link commands we have seen before. Next up is a brief linking loop:

for appl in sbase scalc sdraw simpress smath soffice spadmin swriter
do
    ln -v -sf /opt/openoffice-3.2.1/program/$appl /usr/bin
done

That basically gives the variable [$appl] the value [sbase] then runs the [l]i[n]k command in the next line, then changes the variable to [scalc] and runs the command again, and so on.

To install some shiny icons, we run:

pushd sysui/desktop/icons &&
install -v -m755 -d /usr/share/icons/{hicolor,locolor} &&
cp -r -v hicolor/* /usr/share/icons/hicolor &&
cp -r -v locolor/* /usr/share/icons/locolor &&
popd

That just makes a couple of directories and then populates them. Lastly, if you happen to be using .desktop files to organise your menu systems (which may be possible with Openbox, I am not sure) then you want to install the .desktop files for OpenOffice:

install -v -d -m755 /usr/share/applications &&
pushd /opt/openoffice-3.2.1/share/xdg/ &&
for appl in *.desktop
do
    sed -i '/Exec/d' $appl &&
    echo "Exec=/usr/bin/s`echo $appl | sed 's/.desktop//'`" >> $appl &&
    sed -i '/Icon/d' $appl &&
    echo "Icon=`echo "ooo-${appl}3.2" | sed 's/\.desktop//'`" >> $appl
done &&
sed -i 's@bin/sprinteradmin@bin/spadmin@' printeradmin.desktop &&
cp -v *.desktop /usr/share/applications &&
popd

That command is an amalgam of the ones we have just run. Firstly it creates a directory if it doesn't exist anyway. Then it uses pushd to save the current location and to move to another directory. In the directory it then runs a loop on every file in the new directory with a [.desktop] extension. The loop includes (aaaargh) sed commands. It looks like it is changing the default entries for [Exec] and [Icon] in the [.desktop] files. Must have a good reason for doing this. Oh! I see, the original .desktop files had an Exec line which tried to run [openoffice.org3 -writer %U] for instance. Sed replaces that with [/usr/bin/swriter] which is also the name of the link file we made above. It also tweaks the Icon line, but I know not why.

I do not get the final [sed] on the [printeradmin.desktop] file. It then just copies the files to the appropriate place. If you have installed the desktop-files-utils package (which I have not) then you can now run the following command to let it know to rebuild the menus:

update-desktop-database

We then need to install the dictionaries and any extensions we compiled (don't remember compiling any but hey ho):

cp -v dictionaries/unxlngi6.pro/bin/dict-*.oxt sdext/unxlngi6.pro/bin/*.oxt reportbuilder/unxlngi6.pro/bin/report-builder.oxt swext/unxlngi6.pro/bin/wiki-publisher.oxt /opt/openoffice-3.2.1/share/extension/install

When I ran this, it copied all the dictionaries, but could not find any other extensions. And we then need to install the extensions, which may need some manual input:

for ext in /opt/openoffice-3.2.1/share/extension/install/*.oxt
do
    /opt/openoffice-3.2.1/program/unopkg add --shared --verbose $ext
done

This gave me LOADS of dictionaries. I think I may have inadvertently installed ALL of them. I will have to look back at the [with-dict] option that I used - may have been wrong. Last step is to install a link so that you can view office documents from within Firefox:

ln -sv /opt/openoffice-3.2.1/program/libnpsoplugin.so /opt/firefox4b7/lib/firefox-4.0b7/plugins

Obviously, choose the proper path for your current firefox installation.

Et, voila.

Wednesday, 1 December 2010

Linux from Scratch - Radeon HD 6870

If one has recently purchased an AMD/ATI Radeon HD 6870, one will be pretty fucking pissed off with the lack of linux drivers for the same. However, one can do a bodge job as follows:

cd ~
wget https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/ati-driver-installer-10-11-x86.x86_64.run
chmod +x ati-driver-installer-10-11-x86.x86_64.run
cd /dev/shm
~/ati-driver-installer-10-11-x86.x86_64.run

Choose to install the driver, not build a package, and don't bother with the expert settings. Now, the problem is that the modules are installed to /usr/lib/xorg/modules and not the LFS default of /usr/lib/X11/modules. I considered farting around with symbolic links to sort everything out, but it turns out that Xorg has a brighter idea. You just add ANOTHER Modules Path to the xorg.conf that you are working with so the files section has:

ModulePath   "/usr/lib/X11/modules"
ModulePath   "/usr/lib/xorg/modules"

You then change the driver from 'intel' or 'vesa' or whatever, to 'fglrx':

Driver      "fglrx"

and bob's your proverbial mother's brother.

Tuesday, 30 November 2010

LFS - Powertop & acpi

Powertop is a system which is supposed to help you save battery life on a portable PC by identifying areas to optimise. Powertop requires lspci (optional) which in turn wants 'which', so:

wget ftp://ftp.gnu.org/gnu/which/which-2.20.tar.gz
tar -xzvf which-2.20.tar.gz
cd which-2.20
./configure --prefix=/usr &&
make
make install
cd ..
rm -rvf which-2.20

wget http://www.kernel.org/pub/software/utils/pciutils/pciutils-3.1.7.tar.bz2
tar -xjvf pciutils-3.1.7.tar.bz2
cd pciutils-3.1.7
make PREFIX=/usr ZLIB=no
make PREFIX=/usr install
make PREFIX=/usr install-lib
update-pciids
cd ..
rm -rvf pciutils-3.1.7

wget http://www.lesswatts.org/projects/powertop/download/powertop-1.13.tar.gz
tar -xzvf powertop-1.13.tar.gz
cd powertop-1.13
make
make install
cd ..
rm -rvf powertop-1.13.tar.gz

Just leave it running for 5+ minutes and you will get an estimate of usage.

Another useful power tool is acpi for getting battery information, and you install as follows:

wget http://sourceforge.net/projects/acpiclient/files/acpiclient/1.5/acpi-1.5.tar.gz/download
tar -xzvf acpi-1.5.tar.gz
cd acpi-1.5
./configure --prefix=/usr
make
make install
cd ..
rm -rvf acpi-1.5

Friday, 26 November 2010

Extra Openbox Menu Items

Some items to add to the Openbox menu:

Here is an entry for Firefox 4 beta:

<item label="firefox"><action name="Execute"><execute>/opt/firefox4/bin/firefox</execute></action></item>

Here is an entry to Suspend the machine to RAM. I cannot get this actual command to run, so I have to pop the command in a script and then run the script. There has to be a better way of doing this.

<item label="Suspend to RAM"><action name="Execute"><command>~/str.sh</command></action></item>

cat > ~/str.sh << "EOF"
echo mem > /sys/power/state
EOF

The next two items would be good in the system section - Powertop for useful battery information, and top for system process information.

<item label="Powertop"><action name="Execute"><command>xterm -e /usr/bin/powertop</command></action></item>

<item label="Top"><action name="Execute"><command>xterm -e /usr/bin/top -i</command></action></item>

Friday, 19 November 2010

LFS - Fonts

The standard font that X comes with is, bluntly, shit. So lets install some new fonts to brighten everything up.

Firstly, setup the directory to store the downloaded files in:

mkdir /sources/fonts
cd /sources/fonts

Next download a bog standard, and nice looking, free font, Dejavu. The commands basically 1. make a folder in /usr/share/fonts 2. copies all ttf files into that directory 3. runs the program fc-cache to load the ttf files.

wget http://sourceforge.net/projects/dejavu/files/dejavu/2.32/dejavu-fonts-ttf-2.32.tar.bz2/download
tar -jxvf dejavu-fonts-ttf-2.32.tar.bz2
cd dejavu-fonts-ttf-2.32/ttf
install -v -d -m755 /usr/share/fonts/dejavu &&
install -v -m644 *.ttf /usr/share/fonts/dejavu &&
fc-cache -v /usr/share/fonts/dejavu
cd ../../
rm -rf dejavu-fonts-ttf-2.32

Next we are going to install some Microsoft fonts - which are freely licensed. To do this we are going to need a bit of software to unpack the Microsoft archive:

wget http://www.cabextract.org.uk/cabextract-1.2.tar.gz
tar -xzvf cabextract-1.2.tar.gz
cd cabextract-1.2
./configure --prefix=/usr &&
make
make install
cd ..
rm -rf cabextract-1.2

Now we need to get the fonts:

wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/andale32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/arial32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/arialb32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/comic32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/courie32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/georgi32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/impact32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/times32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/trebuc32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/verdan32.exe/download
wget http://sourceforge.net/projects/corefonts/files/the%20fonts/final/webdin32.exe/download

We then install the fonts using a bit of a script to automate the repetitive commands. Apart from the cabextract command basically we are doing the same as the Dejavu commands above.

for msfont in andale32 arial32 arialb32 comic32 courie32 georgi32 impact32 times32 trebuc32 verdan32 webdin32
do
mkdir $msfont
cabextract $msfont.exe -d $msfont
cd $msfont
install -v -d -m755 /usr/share/fonts/$msfont
install -v -m644 *.TTF /usr/share/fonts/$msfont
install -v -m644 *.ttf /usr/share/fonts/$msfont
fc-cache -v /usr/share/fonts/$msfont
cd ..
rm -rf $msfont
done

I am not entirely sure if this last step actually does anything, but it is supposed to make a config file which anti aliases the fonts.

cat > ~/.fonts.conf << "EOF"
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="font">
   <edit name="autohint" mode="assign">
     <bool>true</bool>
   </edit>
 </match>
</fontconfig>
EOF

Friday, 22 October 2010

LFS - Firefox 4 Beta from Source

The new version of Firefox is nearly out, and I wanted to try it with my LFS system. I figured that it should not be too different to Firefox 3.6 which I have installed. I encountered two problems when installing FF4. Firstly, for some strange reason, it can't use the libpng that I have installed. I updated libpng to the latest version, but still nada. It also needed the yasm software which is some programming language stuff.

So:
cd /sources/extras
wget http://www.tortall.net/projects/yasm/releases/yasm-0.8.0.tar.gz
cd /dev/shm
tar -xzvf /sources/extras/yasm-0.8.0.tar.gz
cd yasm-0.8.0
CC="gcc -fPIC" ./configure --prefix=/usr
time make $CORES_TO_USE
make install

And then:

cd /sources/extras
wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/4.0b6/source/firefox-4.0b6.source.tar.bz2
cd /dev/shm
tar -xjvf /sources/extras/firefox-4.0b6.source.tar.bz2
cd moz*
cat > .mozconfig << "EOF"
ac_add_options --enable-application=browser
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../firefox-build
mk_add_options MOZ_MAKE_FLAGS="-j4"
ac_add_options --prefix=/opt/firefox4
ac_add_options --enable-optimize
ac_add_options --enable-system-cairo
ac_add_options --with-system-jpeg
#ac_add_options --with-system-png
ac_add_options --with-pthreads
ac_add_options --with-system-zlib
ac_add_options --disable-accessibility
ac_add_options --disable-crashreporter
ac_add_options --disable-dbus
ac_add_options --disable-gnomevfs
ac_add_options --disable-necko-wifi
ac_add_options --disable-installer
ac_add_options --disable-javaxpcom
ac_add_options --disable-tests
ac_add_options --disable-updater
ac_add_options --disable-libnotify
ac_add_options --enable-official-branding
ac_add_options --enable-safe-browsing
ac_add_options --enable-strip
EOF
Note - the "-j4" line. Make this j2 for a dual core, or leave it out altogether for single core. I have commented out the libpng line, because I will want it back if I ever find out what is screwed up. I have also changed the install directory so I can install it alongside FF3. Now run:
time make -f client.mk build
make -f client.mk install
cd ..
rm -rvf moz*
I think I may have found the problem with Flash 10. My system is missing some dependencies. Running [ldd] on the library reports the following as missing:
libssl3.so => not found
libsmime3.so => not found
libnss3.so => not found
libplds4.so => not found
libplc4.so => not found
libnspr4.so => not found
All of these libraries are in the Firefox folder - but are NOT available to the system as a whole. So I need to somehow tell the system it can look in the firefox folders to get these things. They way to do this is by adding the firefox path to following file:
cat >> /etc/ld.so.conf << "EOF"
# Extra Path so Firefox's libraries can be used by Flash10
/opt/firefox4/lib/firefox-4.0b6
# End of Extra Path.
EOF
OK. We now get a fucking different problem. It can't find the cURL library. Which it DOESN'T FUCKING ASK FOR when you [ldd] the fucker. OK.
wget http://curl.haxx.se/download/curl-7.20.0.tar.bz2
tar -xjvf curl-7.20.0.tar.bz2
cd curl-7.20.0
./configure --prefix=/usr
make $CORES_TO_USE
Holy fuck the [make check] is the best I have ever seen! It gives you an actual ETA of how long the test is going to take to run! It is awesome. And then it ruins everything by not giving you a final report. Bastard.
make install
find docs -name "Makefile*" -o -name "*.1" -o -name "*.3" | xargs rm
install -v -d -m755 /usr/share/doc/curl-7.20.0
cp -v -R docs/* /usr/share/doc/curl-7.20.0
And, finally, the fucker works. You just install Flashplayer 10 using the following instructions:
wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
tar -xzvf install_flash_player_10_linux.tar.gz
mkdir -v /opt/firefox4/lib/firefox-4.0b6/plugins
cp -v libflashplayer.so /opt/firefox4/lib/firefox-4.0b6/plugins
If you have already installed Java, just link it to the new plugins directory:
ln -sv /opt/jdk/jre/lib/i386/libnpjp2.so /opt/firefox4/lib/firefox-4.0b6/plugins

Friday, 1 October 2010

LFS - Firefox from Source

OK, I have buckled under the pressure of being sick fucking fed up of text only browsing. Actually, when I looked at it, with the packages I have installed, there are only two dependencies needed to get firefox up and running. So, firefox it is.

cd /sources/extras

The first dependency here is something to do with Interface Definition Language files. Apparently firefox needs to use them, whatever they actually are. Absolutely simply installation commands.
wget http://ftp.gnome.org/pub/gnome/sources/libIDL/0.8/libIDL-0.8.14.tar.bz2
tar -xjvf /sources/extras/libIDL-0.8.14.tar.bz2
cd libIDL-0.8.14
./configure --prefix=/usr &&
make
make install
cd ..
rm -rvf libIDL-0.8.14

Next up is Python. Frankly I am surprised it has taken until now for this to be installed. Python is another language like C or Perl.
wget http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2
wget http://www.linuxfromscratch.org/patches/blfs/svn/Python-2.6.4-bdb_4.8-1.patch
wget http://docs.python.org/ftp/python/doc/2.6/python-2.6-docs-html.tar.bz2
tar -xjvf /sources/extras/Python-2.6.4.tar.bz2
cd Python-2.6.4

We need to fix a potential build problem with a quick [sed]. I have no idea whatsoever what the patch is supposed to fix, BLFS is silent on the issue.
sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py
patch -Np1 -i /sources/extras/Python-2.6.4-bdb_4.8-1.patch
./configure --prefix=/usr --enable-shared
make
make test
make install
chmod -v 755 /usr/lib/libpython2.6.so.1.0

We also want to install Python's documentation, we downloaded it after all. We also need to set a system variable to get the documentation to work properly.
install -v -m755 -d /usr/share/doc/Python-2.6.4/html
tar --strip-components=1 --no-same-owner --no-same-permissions -C /usr/share/doc/Python-2.6.4/html -xvf /sources/extras/python-2.6-docs-html.tar.bz2
cat >> /etc/profile << "EOF"
export PYTHONDOCS=/usr/share/doc/Python-2.6.4/html
EOF
cd ..
rm -rvf Python-2.6.4

And now we come to Firefox itself. This is probably the most complicated build we have done up until now. In fact it is so complicated that we need to create a separate file just to feed the configuration options to the make command.
wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.8/source/firefox-3.6.8.source.tar.bz2
tar -xjvf /sources/extras/firefox-3.6.8.source.tar.bz2
cd moz*

The folder created by the unpacking is called [mozilla]-something or other. Using the previous command is a simple way to ensure that we definitely move into that folder, no matter what its specific name. Now lets set up the config file. There are two ways to go with firefox. It comes with quite a lot of its dependencies built in. If you have these packages installed in the system, it is best to use those versions. For the missing dependencies we could download and install the latest versions, but that is too much of a pain in the arse frankly. Some of the packages we can use, like cairo, jpeg, png, and zlib because we have installed those. If you are dealing with a more mature BLFS install, you may have more system packages you can enable.
cat > .mozconfig << "EOF"
ac_add_options --enable-application=browser
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../firefox-build
ac_add_options --prefix=/opt/firefox
ac_add_options --enable-optimize
ac_add_options --enable-system-cairo
ac_add_options --with-system-jpeg
ac_add_options --with-system-png
ac_add_options --with-pthreads
ac_add_options --with-system-zlib
ac_add_options --disable-accessibility
ac_add_options --disable-crashreporter
ac_add_options --disable-dbus
ac_add_options --disable-gnomevfs
ac_add_options --disable-necko-wifi
ac_add_options --disable-installer
ac_add_options --disable-javaxpcom
ac_add_options --disable-tests
ac_add_options --disable-updater
ac_add_options --disable-libnotify
ac_add_options --enable-official-branding
ac_add_options --enable-safe-browsing
ac_add_options --enable-strip
EOF

Now you run the compilation. This takes just over 20 minutes on my quad core, so it is a biggie. You might want to benchmark by [time]ing the build.
time make $CORES_TO_USE -f client.mk build
make -f client.mk install
cd ..
rm -rvf moz*

Now may be a good time to install two special firefox plugins: Flash and Java.

First Flash. In the first instance I will try flash 9, because Flashplayer 10 has compatibility problems with firefox.
wget http://fpdownload.macromedia.com/get/flashplayer/installers/archive/fp9_archive.zip
unzip /sources/extras/fp9_archive.zip
cd fp9_archive/9r246
tar -xzvf flashplayer9r246_linux.tar.gz
cd install_flash_player_9_linux
cp ./libflashplayer.so /opt/firefox/lib/firefox-3.6.8/plugins
cd ../../..
rm -rf  fp9_archive

Just in case they have fixed Flash 10, you can get it from here:
wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
tar -xzvf install_flash_player_10_linux.tar.gz
cp -v libflashplayer.so /opt/firefox/lib/firefox-3.6.8/plugins

For Java, you need to download the binary install file, which is only available from Sun's website. You should now be using Firefox to browse so just save the appropriate file into the /sources/extras folder from this link.

Then, from the directory you download this to, run:
chmod +x /sources/extras/jdk-6u21-linux-i586.bin
/sources/extras/jdk-6u21-linux-i586.bin
cd jdk1.6.0_21
install -v -m755 -d /opt/jdk-6u21
mv -v * /opt/jdk-6u21
chown -v -R root:root /opt/jdk-6u21
ln -v -sf xawt/libmawt.so /opt/jdk-6u21/jre/lib/i386/
cd ..
sed -i 's@XINERAMA@FAKEEXTN@g' /opt/jdk-6u21/jre/lib/i386/xawt/libmawt.so
ln -v -nsf jdk-6u21 /opt/jdk

Java needs quite complicated environment variables to be set, so we'll create a profile file:
cat >> /etc/profile.d/30-jdk.sh << "EOF"
# Begin /etc/profile.d/30-jdk.sh

# Set JAVA_HOME directory
JAVA_HOME=/opt/jdk

# Adjust PATH
pathappend ${JAVA_HOME}/bin PATH

# Auto Java CLASSPATH
# Copy jar files to, or create symlinks in this directory
AUTO_CLASSPATH_DIR=/usr/lib/classpath
pathprepend . CLASSPATH
for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
pathappend $dir CLASSPATH
done

export JAVA_HOME CLASSPATH
unset AUTO_CLASSPATH_DIR
unset dir

# End /etc/profile.d/30-jdk.sh
EOF

Either log out and in or run the following command to load the new environment settings:
source /etc/profile

The Java plugin for firefox needs to be installed by way of symbolic link, just copying it will not work for some reason:

ln -sv /opt/jdk/jre/lib/i386/libnpjp2.so /opt/firefox/lib/firefox-3.6.8/plugins