Installing Firefox plugins in FreeBSD (and yes, even flash and java are working)

Posted in FreeBSD Tutorials on November 5th, 2009 by admin

I often hear from people who don’t use FreeBSD that it’s an operating system only dedicated to server/production purposes.
In a way, yes, FreeBSD is not as user-friendly than popular Linux distributions and it’s sometimes hard to get what you want working the way you want but I don’t think that people who use FreeBSD would be satisfied with an apt-get everything_you_need-any-version ;)
Computers are now expected to browse the web correctly, allowing you to watch youtube video, play flash games and be flooded by plugin-based ads..
Of course, FreeBSD can!

You must have Mozilla Firefox installed:

# cd /usr/ports/www/firefox35 && make config-recursive install clean

Since some of the plugins are using linux emulation, we have to install it and get it running ;

# cd /usr/ports/emulators/linux_base-f10/ && make config-recursive install clean

If you don’t have the linux kernel module loaded, linux_base-f10 won’t build:

# kldload linux

You also have to get it loaded every time you start your computer by adding this line to /etc/rc.conf:

linux_enable="YES"

Since we will need it later, let’s mount the linux proc filesystem at boot time.
Add this line to /etc/fstab:

linproc /usr/compat/linux/proc linprocfs rw 0 0

Reboot is not needed to mount the linux proc filesystem:

# mount /usr/compat/linux/proc

Second step is to install nspluginwrapper, a tool that helps you link plugins to your current browser (i.e. firefox):

# cd /usr/ports/www/nspluginwrapper && make config-recursive install clean

Ok let’s start with Flash Player 9, I also have tested flash 10 and it was working for me but I prefer flash 9 for some retro-compatibility issues.
First we have to install it from the ports:

# cd /usr/ports/www/linux-flashplugin9 && make install clean

I have Mplayer already installed with a large bunch of options activated (i’ll maybe cover it in a future post), that’s why I want to install mplayer plugin.
Although most of the videos on Internet are in flv (flash) format, there are still some exotic format videos and mplayer will play them:

# /usr/ports/www/mplayer-plugin && make config-recursive install clean

If you don’t want to be asked to download each time you open a link to a pdf, linux emulation of Adobe Reader support a plugin which allows embedded view of pdf files in firefox.
For some reason I was unable to get acroread9 working with firefox, so let’s install acroread8

# /usr/ports/print/acroread8 && make install clean

librsvg is an open source SVG rendering library which (probably) provides to Firefox a better handling of SVG graphics but I cover this plugin’s installation only because I like to read the funny description in about:plugins ;)

# cd /usr/ports/graphics/librsvg2 && make config-recursive install clean

Java plugin can also be useful but compilation of this port is long and painful.

# /usr/ports/java/jdk16 && make config-recursive install clean

As you can see, the FreeBSD port system don’t fetch neither build this port !
Due to license restriction, you will have to fetch manually almost every needed file, and even create an account on Sun website to be able to get them all. :P
Here is the list of the files I had do download manually and move to /urs/ports/distfiles/:

http://www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-src-b05-jrl-24_sep_2007.jar
http://www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-bin-b05-jrl-24_sep_2007.jar
http://www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-mozilla_headers-b05-unix-24_sep_2007.jar
http://www.FreeBSDFoundation.org/cgi-bin/download?download=diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2

from http://java.sun.com/javase/downloads/index.jsp:

tzupdater-1_3_18-2009k.zip

from http://www.eyesbeyond.com/freebsddom/java/jdk16.html:

bsd-jdk16-patches-4.tar.bz2

nspluginwrapper will now link all the plugins it finds with your user’s specific firefox plugin folder, so you have to use it with each user your want to be able to access new plugins:

% nspluginwrapper -v -a -i
% nspluginwrapper -i /usr/local/Adobe/Reader8/ENU/Adobe/Reader8/Browser/intellinux/nppdf.so

The second line is needed because nspluginwrapper didn’t find Adobe Reader plugin.

Unfortunately, nspluginwrapper was unable to link the Java plugin so I created a symlink:

% ln -s /usr/local/jdk1.6.0/jre/plugin/i386/ns7/libjavaplugin_oji.so ~/.mozilla/plugins/

(Re-)start firefox3 and you should be able to list all those plugins by giving about:plugins in the navigation bar.

Oh, I almost forgot it but I encountered a strange problem using libflashplayer.so, Flash wasn’t working properly (no sound on some machines and no Flash at all for some others) and by checking the needed dependencies with Linux ldd I noticed that Flash library is unable to find libssl.so.5.
By checking in /usr/compat/linux/lib/, libssl.so.0.9.8g is present though and symlinking it as libssl.so.5 just don’t work. :P
In desperation I copied it:

# cp /usr/compat/linux/lib/libssl.so.0.9.8g /usr/compat/linux/lib/libssl.so.5

And it works! Another mystery of Linux compatibily, I guess… ;)

Enjoy!

Tags: ,