<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>One hand clapping</title>
	<atom:link href="http://warped.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://warped.org/blog</link>
	<description>Max Baker -- A Man with a Hand</description>
	<lastBuildDate>Mon, 12 Mar 2012 18:25:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>ch0wn3d &#8211; Keeping your own Perl library and cpan in your home directory</title>
		<link>http://warped.org/blog/2011/04/08/ch0wn3d-perl-in-homedi/</link>
		<comments>http://warped.org/blog/2011/04/08/ch0wn3d-perl-in-homedi/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 22:01:02 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ch0wned]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=198</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a Linux user and don't have root access. Intro This tutorial is for people wanting to install perl modules using CPAN who do not have root access or wish to keep a network-central module repository that is separated from the local install. Downloads lib::local module on [...]]]></description>
			<content:encoded><![CDATA[<p><tt>ch0wned. adj. This is the state when you are a Linux user and don't have root access. </tt>
</p>
<h1>Intro</h1>
<p>
This tutorial is for people wanting to install perl modules using CPAN who do not have root access or wish to keep a network-central module repository that is separated from the local install.</p>
<h1>Downloads</h1>
<ul>
<li><a href="http://search.cpan.org/~apeiron/local-lib-1.008004/lib/local/lib.pm">lib::local module on CPAN</a></li>
</ul>
<h1>Installing</h1>
<ol>
<li>Unpackage lib::local
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz local-lib-<span style="color: #000000;">1.008004</span>.tar.gz</pre></div></div>

</p>
</li>
<li>Choose a library directory
<p>
I use a value of $HOME which installs the modules into $HOME/lib/perl5
</p>
</li>
<li>Install lib::local into the above spot
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> lib-local-<span style="color: #000000;">1.008004</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> Makefile.PL <span style="color: #660033;">--bootstrap</span>=<span style="color: #007800;">$HOME</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> 
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

</p>
</li>
</ol>
<h1>Running CPAN</h1>
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">perl</span> -I<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>perl5 -Mlocal::<span style="color: #007800;">lib</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> -I<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>perl5 -Mlocal::<span style="color: #007800;">lib</span>=<span style="color: #007800;">$HOME</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> shell
cpan<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">install</span> Awesome::Module::From::CPAN</pre></div></div>

<p>Now you can install modules from CPAN as normal as shown above.  You might want to put the first two lines into a shell script named &#8220;my_cpan&#8221; or something.
</p>
<h1>Specifying your library path in your Perl scripts</h1>
<h1>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> lib <span style="color: #ff0000;">'/home/you/lib/perl5'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Awesome<span style="color: #339933;">::</span><span style="color: #006600;">Module</span><span style="color: #339933;">::</span><span style="color: #006600;">From</span><span style="color: #339933;">::</span><span style="color: #006600;">CPAN</span><span style="color: #339933;">;</span></pre></div></div>

</h1>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2011/04/08/ch0wn3d-perl-in-homedi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ch0wn3d &#8211; Firefox 4 in Redhat 5 (EL5) / CentOS 5 / CentOS 5.5</title>
		<link>http://warped.org/blog/2011/03/29/firefox4_redhat_5/</link>
		<comments>http://warped.org/blog/2011/03/29/firefox4_redhat_5/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 00:06:38 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ch0wned]]></category>
		<category><![CDATA[el5]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=193</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a Linux user and don't have root access. Intro The latest Firefox 4 Beta (rc2) requires GCC 4.x and a libstdc++ to match. Unfortunately, Redhat EL5 and CentOS 5 / CentOS 5.5 do not meet this requirement, no matter how many packages you update. But, luckily [...]]]></description>
			<content:encoded><![CDATA[<p><tt>ch0wned. adj. This is the state when you are a Linux user and don't have root access. </tt>
</p>
<h1>Intro</h1>
<p>
The latest Firefox 4 Beta (rc2) requires GCC 4.x and a libstdc++ to match.   Unfortunately, Redhat EL5 and CentOS 5 / CentOS 5.5 do not meet this requirement, no matter how many packages you update.   But, luckily for us our friend rkl found a solution and <a href="http://forums.mozillazine.org/viewtopic.php?f=23&#038;t=2075033">posted it on mozillazine</a>.  Much to our dismay, the mozilla developers have decided to stop supporting these old of libraries in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=621704">bug 621704</a>.
</p>
<h1>Downloads</h1>
<ul>
<li><a href="https://www.mozilla.com/products/download.html?product=firefox-4.0&#038;os=linux&#038;lang=en-US">Firefox 4 Binary Version</a></li>
<li><a href="http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/9/Fedora/i386/os/Packages/libstdc++-4.3.0-8.i386.rpm">libstdc++-4.3.0-8.i386.rpm</a></li>
</ul>
<h1>Installing</h1>
<ol>
<li>Unpackage Firefox
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvfj firefox-4.0rc2.tar.bz2
<span style="color: #c20cb9; font-weight: bold;">mv</span> firefox firefox-4.0rc2</pre></div></div>

</p>
</li>
<li>Unpackage RPM and copy library file into firefox directory
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> tmp
<span style="color: #7a0874; font-weight: bold;">cd</span> tmp
rpm2cpio ..<span style="color: #000000; font-weight: bold;">/</span>libstdc++-4.3.0-<span style="color: #000000;">8</span>.i386.rpm <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cpio</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">--make-directories</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libstdc++.so.6.0.10 ..<span style="color: #000000; font-weight: bold;">/</span>firefox-4.0rc2<span style="color: #000000; font-weight: bold;">/</span>libstdc++.so.6</pre></div></div>

</p>
</li>
</ol>
<h1>Running</h1>
<p>Firefox should run just fine now :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">firefox-4.0rc2<span style="color: #000000; font-weight: bold;">/</span>firefox <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2011/03/29/firefox4_redhat_5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ch0wned &#8211; Getting a Logitech G500 Mouse and all its Buttons Working in Redhat EL5</title>
		<link>http://warped.org/blog/2011/02/04/ch0wned-logitech-g500-mouse-all-buttons-in-redhat-el5/</link>
		<comments>http://warped.org/blog/2011/02/04/ch0wned-logitech-g500-mouse-all-buttons-in-redhat-el5/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 02:13:52 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[ch0wned]]></category>
		<category><![CDATA[g500]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[logitech]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=173</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a Linux user and don't have root access. Ok, so technically for this edition of ch0wned you need to have root :-P Hint &#8211; Sys admins usually like beer. Intro You have a Logitech G500 or other multi-button mouse and want to get all the buttons [...]]]></description>
			<content:encoded><![CDATA[<p><tt>ch0wned. adj. This is the state when you are a Linux user and don't have root access. </tt>   Ok, so technically for this edition of ch0wned you need to have root :-P  Hint &#8211; Sys admins usually like beer.</p>
<h1>Intro</h1>
<p>You have a Logitech G500 or other multi-button mouse and want to get all the buttons working.  These mice use the evdev driver in xserver.  Unfortunately, Redhat EL5 ships with a very buggy version 1.0.0.5-5 !!!  We will replace that with a slightly-less buggy version 1.1.2.</p>
<h1>Prerequisites</h1>
<ul>
<li>yum install xorg-x11-server-sdk</li>
<li>Evdev 1.1.2 <a href='http://warped.org/blog/wp-content/uploads/2011/02/xserver-xorg-input-evdev_1.1.2.orig_.tar.gz'>Locally</a> or from <a href="http://xserver-xorg-input-evdev.sourcearchive.com/">http://xserver-xorg-input-evdev.sourcearchive.com/</a></li>
</ul>
<h2>Building</h2>
<ol>
<li>evdev

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz xserver-xorg-input-evdev_1.1.2.orig.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> xf86-input-evdev-1.1.2
.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>If you have any problems in that stage, make sure you&#8217;ve installed the xserver devel package.
</li>
</ol>
<h1>Installing</h1>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>xorg<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>input<span style="color: #000000; font-weight: bold;">/</span>evdev_drv.so <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>evdev_drv.so.SAVEME
<span style="color: #7a0874; font-weight: bold;">cd</span> xf86-input-evdev-1.1.2
<span style="color: #c20cb9; font-weight: bold;">cp</span> src<span style="color: #000000; font-weight: bold;">/</span>.libs<span style="color: #000000; font-weight: bold;">/</span>evdev_drv.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>xorg<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>input<span style="color: #000000; font-weight: bold;">/</span>evdev_drv.so</pre></div></div>

<p>If you have stability problems later, copy the original driver back over your new one.</p>
<h2>Configuring</h2>
<ol>
<li>/etc/X11/xorg.conf

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Section <span style="color: #ff0000;">&quot;ServerLayout&quot;</span>
...
    InputDevice    <span style="color: #ff0000;">&quot;FakeMouse&quot;</span>
    InputDevice    <span style="color: #ff0000;">&quot;LogitechG500&quot;</span> <span style="color: #ff0000;">&quot;CorePointer&quot;</span>
    InputDevice    <span style="color: #ff0000;">&quot;Keyboard0&quot;</span> <span style="color: #ff0000;">&quot;CoreKeyboard&quot;</span>
...
EndSection
&nbsp;
<span style="color: #666666; font-style: italic;"># xorg 7.1 can't handle evdev as the main device.  this is a hack to have it not create a fake device</span>
<span style="color: #666666; font-style: italic;"># http://www.chromakode.com/blog/2007/09/19/logitech-lx7-in-ubuntu-edgy-ihatekludgers/</span>
Section <span style="color: #ff0000;">&quot;InputDevice&quot;</span>
    Identifier     <span style="color: #ff0000;">&quot;FakeMouse&quot;</span>
    Driver         <span style="color: #ff0000;">&quot;void&quot;</span>
EndSection
Section <span style="color: #ff0000;">&quot;InputDevice&quot;</span>
&nbsp;
    Identifier     <span style="color: #ff0000;">&quot;LogitechG500&quot;</span>
    Driver         <span style="color: #ff0000;">&quot;evdev&quot;</span>
    Option         <span style="color: #ff0000;">&quot;Protocol&quot;</span> <span style="color: #ff0000;">&quot;auto&quot;</span>
    Option         <span style="color: #ff0000;">&quot;Device&quot;</span> <span style="color: #ff0000;">&quot;/dev/input/event0&quot;</span>
   <span style="color: #666666; font-style: italic;"># If X keeps crashing then you need to change /dev/input/eventX to the right slot.</span>
   <span style="color: #666666; font-style: italic;"># Check /proc/bus/input/devices to find the right one</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Apparently you can't assign two buttons to the same function anymore.  Suckage.</span>
    <span style="color: #666666; font-style: italic;">#Option &quot;ButtonMapping&quot; &quot;1 2 3 4 5 9 8 7 6 2  11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32&quot;</span>
    <span style="color: #666666; font-style: italic;"># https://bugs.freedesktop.org/show_bug.cgi?id=16723</span>
    <span style="color: #666666; font-style: italic;"># Option         &quot;ButtonMapping&quot; &quot;1 2 3 4 5 6 7 4 5 2&quot;</span>
    <span style="color: #666666; font-style: italic;"># Swapping Middle button w/ left thumb...  and l/r scroll wheel w/ l/r left thumb</span>
    <span style="color: #666666; font-style: italic;">#                       1 2  3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32</span>
    <span style="color: #666666; font-style: italic;">#Option &quot;ButtonMapping&quot; &quot;1 10 3 4 5 9 8 7 6 2  11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32&quot;</span>
    <span style="color: #666666; font-style: italic;"># oh except for the following..</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Apparently the evdev driver that comes w/ EL5 (version 1.x) sucks.</span>
    <span style="color: #666666; font-style: italic;"># NONE of these options are recognized</span>
    <span style="color: #666666; font-style: italic;">#Option         &quot;Emulate3Buttons&quot; &quot;no&quot;</span>
    <span style="color: #666666; font-style: italic;">#Option        &quot;Buttons&quot; &quot;10&quot;</span>
    <span style="color: #666666; font-style: italic;">#Option        &quot;ZAxisMapping&quot; &quot;4 5&quot;</span>
    <span style="color: #666666; font-style: italic;">#Option         &quot;EmulateWheel&quot; &quot;TRUE&quot;</span>
    <span style="color: #666666; font-style: italic;">#Option         &quot;EmulateWheelButton&quot; &quot;10&quot;</span>
    <span style="color: #666666; font-style: italic;">#Option &quot;ZAxisMapping&quot; &quot;4 5&quot;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Solution : Run xmodmap from the commandline :</span>
    <span style="color: #666666; font-style: italic;">#xmodmap -e &quot;pointer = 1 3 10 4 5 8 9 7 6 2 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32&quot;</span>
    <span style="color: #666666; font-style: italic;"># Or add to Xmodmap</span>
EndSection</pre></div></div>

<p>Notice the line that says</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Option         <span style="color: #ff0000;">&quot;Device&quot;</span> <span style="color: #ff0000;">&quot;/dev/input/event0&quot;</span></pre></div></div>

<p>This is where you are telling X where your mouse is plugged into.  Unfortunately it may move around between reboots if you are not lucky.<br />
To find out where it is <tt> cat /proc/bus/input/devices </tt> and look for the mouse entries&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">I: <span style="color: #007800;">Bus</span>=0003 <span style="color: #007800;">Vendor</span>=046d <span style="color: #007800;">Product</span>=c068 <span style="color: #007800;">Version</span>=<span style="color: #000000;">5802</span>
N: <span style="color: #007800;">Name</span>=<span style="color: #ff0000;">&quot;Logitech G500&quot;</span>
P: <span style="color: #007800;">Phys</span>=usb-0000:00:1d.1-<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>input0
S: <span style="color: #007800;">Sysfs</span>=<span style="color: #000000; font-weight: bold;">/</span>class<span style="color: #000000; font-weight: bold;">/</span>input<span style="color: #000000; font-weight: bold;">/</span>input0
H: <span style="color: #007800;">Handlers</span>=mouse0 event0 
B: <span style="color: #007800;">EV</span>=<span style="color: #000000;">7</span>
B: <span style="color: #007800;">KEY</span>=ffff0000 <span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000;">0</span>
B: <span style="color: #007800;">REL</span>=<span style="color: #000000;">143</span>
&nbsp;
I: <span style="color: #007800;">Bus</span>=0003 <span style="color: #007800;">Vendor</span>=046d <span style="color: #007800;">Product</span>=c068 <span style="color: #007800;">Version</span>=<span style="color: #000000;">5802</span>
N: <span style="color: #007800;">Name</span>=<span style="color: #ff0000;">&quot;Logitech G500&quot;</span>
P: <span style="color: #007800;">Phys</span>=usb-0000:00:1d.1-<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>input1
S: <span style="color: #007800;">Sysfs</span>=<span style="color: #000000; font-weight: bold;">/</span>class<span style="color: #000000; font-weight: bold;">/</span>input<span style="color: #000000; font-weight: bold;">/</span>input1
H: <span style="color: #007800;">Handlers</span>=kbd event1 
B: <span style="color: #007800;">EV</span>=10000f
B: <span style="color: #007800;">KEY</span>=c0002 <span style="color: #000000;">40000000000</span> <span style="color: #000000;">1</span> 10f8000078007 ffe639fad84157ff febeffdfffefffff fffffffffffffffe
B: <span style="color: #007800;">REL</span>=<span style="color: #000000;">40</span>
B: <span style="color: #007800;">ABS</span>=<span style="color: #000000;">100000000</span></pre></div></div>

<p>Look for the entry that DOES NOT have <tt>Handlers=kbd</tt>.
</li>
<li>/etc/X11/Xmodmap
<pre>
! See notes in xorg.conf - max's fancy logitech mouse
! Swap L/R scroll w/ L/R thumb; swap middle->thumb
! old exdev - 2/3 swapped, 8/9 swapped
!pointer = 1 3 10 4 5 8 9 7 6 2 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
!pointer = 1 10 3 4 5 8 9 7 6 2 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
! Swap L/R scroll w/ L/R thumb; swap middle->thumb, switch thumb buttons
pointer = 1 10 3 4 5 9 8 2 6 7 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
</pre>
<p>This is where you can remap buttons on your mouse!   Unfortunately the button mapping between version 1.0.0 and 1.1.2 of evdev have<br />
some buttons crossed up.  Trial and error are the name of the game.    For me using 1.1.2 the final listing above does the following</p>
<ul>
<li>Swap the middle-click and biggest thumb button.  You use this a lot in CAD work for electrical engineering.  It&#8217;s a lot easier on your hands to not have to try to click the moving scroll wheel, especially when it&#8217;s in &#8220;free-ball&#8221; mode.</li>
<li>Swap the right/left scroll-wheel with the up-down on the thumb.    Now the thumb can be used to scroll left and right and the mouse wheel can be used to do history back/forward in Firefox.  This just works out of the box in FF3 for me on RHEL EL5.</li>
<li>Mouse acceleration just seems to work too, no settings needed. There is some program out there that lets you reclaim the little acceleration +/- buttons, but i&#8217;ve never tried it.</li>
</ul>
<p>The way you test it is to run the program <tt>xev</tt>.  Then click in the little white box that appears and see a bunch of gibberish on the console</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ButtonPress event, serial <span style="color: #000000;">32</span>, synthetic NO, window 0x2000002,
    root 0x28c, subw 0x2000003, <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #000000;">4086723575</span>, <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">47</span>,<span style="color: #000000;">40</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, root:<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1159</span>,<span style="color: #000000;">65</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>,
    state 0x0, button <span style="color: #000000;">1</span>, same_screen YES
&nbsp;
EnterNotify event, serial <span style="color: #000000;">32</span>, synthetic NO, window 0x2000002,
    root 0x28c, subw 0x0, <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #000000;">4086723575</span>, <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">47</span>,<span style="color: #000000;">40</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, root:<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1159</span>,<span style="color: #000000;">65</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>,
    mode NotifyGrab, detail NotifyInferior, same_screen YES,
    focus YES, state <span style="color: #000000;">256</span>
&nbsp;
KeymapNotify event, serial <span style="color: #000000;">32</span>, synthetic NO, window 0x0,
    keys:  <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   
           <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   <span style="color: #000000;">0</span>   
&nbsp;
ButtonRelease event, serial <span style="color: #000000;">32</span>, synthetic NO, window 0x2000002,
    root 0x28c, subw 0x2000003, <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #000000;">4086723710</span>, <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">47</span>,<span style="color: #000000;">40</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, root:<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1159</span>,<span style="color: #000000;">65</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>,
    state 0x100, button <span style="color: #000000;">1</span>, same_screen YES</pre></div></div>

<p>This was me pushing the left button (1) and releasing it.  Do this with all the buttons and you can see how your remap is working.
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2011/02/04/ch0wned-logitech-g500-mouse-all-buttons-in-redhat-el5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phone + Endomondo + Google Earth = Geeks Workout</title>
		<link>http://warped.org/blog/2010/05/09/phone-endomondo-google-earth-geeks-workout/</link>
		<comments>http://warped.org/blog/2010/05/09/phone-endomondo-google-earth-geeks-workout/#comments</comments>
		<pubDate>Mon, 10 May 2010 03:26:25 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Bikes]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[biking]]></category>
		<category><![CDATA[endomondo]]></category>
		<category><![CDATA[gps]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=135</guid>
		<description><![CDATA[Overview Let&#8217;s say you want to track a run, hike or bike using your smart phone and GPS. Now let&#8217;s say you want to brag about it on facebook, store stats, and then make little fly-over tours in Google Earth. Enter EndoMondo a web site for tracking such things using GPS. It has the best [...]]]></description>
			<content:encoded><![CDATA[<h1>Overview</h1>
<p>Let&#8217;s say you want to track a run, hike or bike using your smart phone and GPS.  Now let&#8217;s say you want to brag about it on facebook, store stats, and then make little fly-over tours in Google Earth.
</p>
<p>Enter <a href="http://www.endomondo.com">EndoMondo</a> a web site for tracking such things using GPS.  It has the best GPS logger for Android as far as I can tell, and also has clients for &#8220;<a href="http://www.endomondo.com/help">Android, Blackberry, iPhone, Java, Symbian S60, Windows Mobile 6.1 and newer&#8221;</a>.  And if that&#8217;s not enough it will just import GPS files from your watch or stand-alone GPS.
</p>
<ol>
<li>Install the Endomondo app on your phone</li>
<li>Log your trek using the Endomondo application for your phone or your GPS.</li>
<li>Go to the endomondo.com website and Choose export from the log:<br />
<br /><a href="http://warped.org/blog/wp-content/uploads/2010/05/gps_log.png"><img src="http://warped.org/blog/wp-content/uploads/2010/05/gps_log-300x209.png" alt="Endomondo" title="Endomondo" width="300" height="209" class="alignnone size-medium wp-image-136" /></a>
</li>
<li>Export to .gpx format :<br />
<br /><a href="http://warped.org/blog/wp-content/uploads/2010/05/gps_export.png"><img src="http://warped.org/blog/wp-content/uploads/2010/05/gps_export-300x192.png" alt="gps_export" title="gps_export" width="300" height="192" class="alignnone size-medium wp-image-141" /></a>
</li>
<li>Now you need to translate the Garamond .gpx XML file into Google Earth&#8217;s .kml format.   At some point Endomondo will add this export feature straight in, but until then use the fabulous <a href="http://www.gpsvisualizer.com/convert_input">GPS Visualizer File Converter</a>.   Click &#8220;upload the file&#8221; and then choose output type of &#8220;Google Earth KML&#8221;.</li>
<li>Now double click the file to open it in Google Earth.  Once in there you may want to change your Tour settings in Options.<br />
<br /><a href="http://warped.org/blog/wp-content/uploads/2010/05/google_earth_touring.png"><img src="http://warped.org/blog/wp-content/uploads/2010/05/google_earth_touring-300x232.png" alt="google_earth_touring" title="google_earth_touring" width="300" height="232" class="alignnone size-medium wp-image-148" /></a><br />
<br />Try starting with 10 degrees, 500 meters and Speed of 250.
</li>
<li>Now let&#8217;s start the tour.  Once you have opened the .KML file you then double-click on the trek in &#8220;Tracks&#8221;,  then Click the little tour icon nearby, then you can start and stop the tour in the scroll bar thinger at the bottom.  The three red arrows show you the steps:<br />
<a href="http://warped.org/blog/wp-content/uploads/2010/05/google_earth_go.png"><img src="http://warped.org/blog/wp-content/uploads/2010/05/google_earth_go-300x284.png" alt="google_earth_go" title="google_earth_go" width="300" height="284" class="alignnone size-medium wp-image-149" /></a><br />
You can then send that .KML file to anyone or post it to Facebook.
</li>
</ol>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2010/05/09/phone-endomondo-google-earth-geeks-workout/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ch0wned &#8211; Adding  Open Office 3.x and Java on EL4 for X86_64 in your homedir</title>
		<link>http://warped.org/blog/2010/04/07/ch0wned-adding-open-office-3-x-and-java-on-el4-for-x86_64-in-your-homedir/</link>
		<comments>http://warped.org/blog/2010/04/07/ch0wned-adding-open-office-3-x-and-java-on-el4-for-x86_64-in-your-homedir/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 17:11:52 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ch0wned]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[open office]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=132</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a Linux user and don't have root access. Intro Continuing my install series, here&#8217;s how you get OpenOffice 3 and Java w/ the Browser plugin working out of your homedirectory on an old linux install (EL4) without root access. I assume you already have a working [...]]]></description>
			<content:encoded><![CDATA[<p><tt>ch0wned. adj. This is the state when you are a Linux user and don't have root access. </tt>
</p>
<h1>Intro</h1>
<p>
Continuing my install series, here&#8217;s how you get OpenOffice 3 and Java w/ the Browser plugin working out of your homedirectory on an old linux install (EL4) without root access.  I assume you already have <a href="http://warped.org/blog/2010/04/06/ch0wned-building-your-own-firefox-on-el4-for-x86_64-in-your-homedir/">a working 64-bit firefox compiled</a>.
</p>
<p>
This guide assumes you&#8217;re leaving off from my previous post : <a href="http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/">http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/</a>  where you&#8217;ve setup a script called config_gapp.
</p>
<h1>Downloads</h1>
<ul>
<li>OOo_3.2.0_LinuxX86-64_install_wJRE_en-US.tar.gz</li>
<li>jdk-6u19-linux-x64.bin</li>
</ul>
<h1>Building</h1>
<ol>
<li>Open Office
<p>
After unpackaging open office run ./setup in the directory it creates.  Select $HOME/share/oo-3.2 as a destination and now you will run into your first error:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> error: can<span style="color: #ff0000;">'t create transaction lock on /var/lock/rpm/transaction</span></pre></div></div>

<p>This is due to a <a href="https://bugzilla.redhat.com/show_bug.cgi?id=222194">janky version of RPM that comes with EL4 and maybe EL5</a>.  Create the file ~/.rpmmacros with the following line :</p>

<div class="wp_syntax"><div class="code"><pre class="spec" style="font-family:monospace;">%_rpmlock_path %{_dbpath}/__db.000</pre></div></div>

<p>Now go run ./setup again.  Choose Advanced, uncheck &#8220;Gnome Integration&#8221;.  Here you will run into the second error :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Package Name: ooobasis3.2-core04-3.2.0-<span style="color: #000000;">9483</span>.x86_64.rpm 
&nbsp;
rpm <span style="color: #660033;">--upgrade</span> <span style="color: #660033;">--ignoresize</span> <span style="color: #660033;">-vh</span> <span style="color: #660033;">--relocate</span> <span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">opt</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>oo <span style="color: #660033;">--dbpath</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>oo<span style="color: #000000; font-weight: bold;">/</span>.RPM_OFFICE_DATABASE OOO320_m12_native_packed-<span style="color: #000000;">1</span>_en-US.9483<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>ooobasis3.2-core04-3.2.0-<span style="color: #000000;">9483</span>.x86_64.rpm 
Returns: <span style="color: #000000;">1</span> 
Error during installation  
error: Failed dependencies: libfreetype.so.6<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> is needed by ooobasis3.2-core04-3.2.0-<span style="color: #000000;">9483</span>.x86_64</pre></div></div>

<p>But since we know we already have this dependency installed in from my previous ch0wned post in $HOME, we can work around this.  Create a file $HOME/bin/rpm that will override this for the time being:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rpm <span style="color: #660033;">--nodeps</span> <span style="color: #ff0000;">&quot;$@&quot;</span></pre></div></div>

<p>And now you can re-run setup a 3rd time, select advanced, deselect gnome integration and GO.  Last step is to create some symlinks to the sbase / scalc / sdraw / swriter / smath / soffice executables in your $HOME/bin directory.   You may need to create a small wrapper that calls them with run_gapp.  Be sure to remove that $HOME/bin/rpm script when you&#8217;re done.
</p>
</li>
<li>Java x86_64 w/ Firefox Plugin
<p>
Download the .bin copy of the JDK.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x jdk<span style="color: #000000; font-weight: bold;">*</span>
.<span style="color: #000000; font-weight: bold;">/</span>jdk<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> jdk<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>share 
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>jdk<span style="color: #000000; font-weight: bold;">*/</span>bin<span style="color: #000000; font-weight: bold;">/</span>j<span style="color: #000000; font-weight: bold;">*</span> .</pre></div></div>

<p>Now for the browser plugin part</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>.mozilla<span style="color: #000000; font-weight: bold;">/</span>plugins
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> ~<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>jdk<span style="color: #000000; font-weight: bold;">*/</span>jre<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>amd64<span style="color: #000000; font-weight: bold;">/</span>libnpjp2.so .</pre></div></div>

<p>Restart your browser and go to &#8220;about:plugins&#8221; et viola.
</p>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2010/04/07/ch0wned-adding-open-office-3-x-and-java-on-el4-for-x86_64-in-your-homedir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ch0wned &#8211; Building your own Thunderbird 3 on EL4 for X86_64 in your homedir</title>
		<link>http://warped.org/blog/2010/04/06/ch0wned-building-your-own-thunderbird-3-on-el4-for-x86_64-in-your-homedir/</link>
		<comments>http://warped.org/blog/2010/04/06/ch0wned-building-your-own-thunderbird-3-on-el4-for-x86_64-in-your-homedir/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 23:47:04 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ch0wned]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=128</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a Linux user and don't have root access. Intro Having just gone through my guide on installing Firefox now you&#8217;re ready to do basically the same thing for Thunderbird. This guide assumes you&#8217;re leaving off from my previous post : http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/ where you&#8217;ve setup a script [...]]]></description>
			<content:encoded><![CDATA[<p><tt>ch0wned. adj. This is the state when you are a Linux user and don't have root access. </tt></p>
<h1>Intro</h1>
<p>Having just gone through my <a href="http://warped.org/blog/2010/04/06/ch0wned-building-your-own-firefox-on-el4-for-x86_64-in-your-homedir/">guide on installing Firefox</a> now you&#8217;re ready to do basically the same thing for Thunderbird.
</p>
<p>
This guide assumes you&#8217;re leaving off from my previous post : <a href="http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/">http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/</a>  where you&#8217;ve setup a script called config_gapp.
</p>
<h1>Prerequisites</h1>
<ul>
<li>firefox-3.6.2.source.tar.bz2 </li>
<li>nss-3.12.6-with-nspr-4.8.4.tar.gz</li>
<li>sqlite-amalgamation-3.6.23.1.tar.gz</li>
<li>Python-2.5.5.tar.bz2</li>
<li><a href="http://www.linuxfromscratch.org/blfs/view/svn/general/nspr.html">NSPR Patch from Standalone Linux</a> (READ THIS!)</li>
<li><a href="http://www.linuxfromscratch.org/blfs/view/svn/postlfs/nss.html">NSS Patch from Standalone Linux</a> (READ THIS!)</li>
<li>My Patch for OSS</li>
</ul>
<h2>Building</h2>
<p>Follow <a href="http://warped.org/blog/2010/04/06/ch0wned-building-your-own-firefox-on-el4-for-x86_64-in-your-homedir/">my guide on installing Firefox</a> for all the prereqs.</p>
<h1>Thunderbird 3.0 Building</h1>
<h2>Configuring</h2>
<p>Make a file called mozconfig-tbird</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mk_add_options <span style="color: #007800;">MOZ_OBJDIR</span>=<span style="color: #000000; font-weight: bold;">@</span>TOPSRCDIR<span style="color: #000000; font-weight: bold;">@/</span>objdir-tb-release
mk_add_options <span style="color: #007800;">MOZ_MAKE_FLAGS</span>=<span style="color: #ff0000;">&quot;-j4&quot;</span>
&nbsp;
ac_add_options <span style="color: #660033;">--enable-application</span>=mail
ac_add_options <span style="color: #660033;">--enable-official-branding</span>
ac_add_options <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>thunderbird
<span style="color: #666666; font-style: italic;"># required for make package for tbird now?</span>
ac_add_options <span style="color: #660033;">--enable-static</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Optimization</span>
ac_add_options <span style="color: #660033;">--disable-tests</span>
ac_add_options <span style="color: #660033;">--disable-debug</span>
ac_add_options <span style="color: #660033;">--enable-optimize</span>=<span style="color: #ff0000;">&quot;-O2 -funroll-loops -fexpensive-optimizations&quot;</span>
ac_add_options <span style="color: #660033;">--enable-strip</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Features</span>
ac_add_options <span style="color: #660033;">--disable-accessibility</span>
ac_add_options <span style="color: #660033;">--disable-updater</span>
ac_add_options <span style="color: #660033;">--disable-installer</span>
<span style="color: #666666; font-style: italic;">#ac_add_options --enable-safe-browsing</span>
ac_add_options <span style="color: #660033;">--enable-xinerama</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Libraries / Dependencies</span>
ac_add_options <span style="color: #660033;">--disable-libnotify</span>
ac_add_options <span style="color: #660033;">--disable-gnomevfs</span>
ac_add_options <span style="color: #660033;">--enable-default-toolkit</span>=cairo-gtk2
ac_add_options <span style="color: #660033;">--enable-system-cairo</span>
ac_add_options <span style="color: #660033;">--with-system-nss</span>
ac_add_options <span style="color: #660033;">--with-nss-prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span>
ac_add_options <span style="color: #660033;">--with-system-nspr</span>
ac_add_options <span style="color: #660033;">--with-nspr-prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span>
ac_add_options <span style="color: #660033;">--enable-system-sqlite</span></pre></div></div>

<h2>Building</h2>
<p>I had to patch firefox to use OSS instead of ALSA because EL4 doesn&#8217;t have a working ALSA by default.  If you have ALSA working, you may not have to do this step.  I got the guts of this patch from somewhere, but I can&#8217;t find it now, thanks whoever you are!</p>
<p>
The patch is on my build firefox page referenced above.
</p>
<p>The following is a fork of my config_gapp script.  There are some tricky bits because I&#8217;ve left off some -L&#8217;s to avoid the NSS and NSPR libs that are installed in /usr/lib64.
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">LOCAL_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$LOCAL_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #007800;">$PATH</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CPPFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$LOCAL_HOME</span>/include -I<span style="color: #007800;">$LOCAL_HOME</span>/include/nss -I/usr/X11R6/include <span style="color: #007800;">$CPPFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$LOCAL_HOME</span>/include -I<span style="color: #007800;">$LOCAL_HOME</span>/include/nss -I/usr/X11R6/include <span style="color: #007800;">$CFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CXXFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$LOCAL_HOME</span>/include -I<span style="color: #007800;">$LOCAL_HOME</span>/include/nss  -I/usr/X11R6/include  <span style="color: #007800;">$CXXFLAGS</span>&quot;</span>
<span style="color: #666666; font-style: italic;">#export LDFLAGS=&quot;-L$LOCAL_HOME/lib -L/usr/lib64 -L/usr/X11R6/lib64 $LDFLAGS&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LDFLAGS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$LOCAL_HOME</span>/lib -L/usr/X11R6/lib64 <span style="color: #007800;">$LDFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PKG_CONFIG</span>=<span style="color: #007800;">$LOCAL_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pkg-config
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PKG_CONFIG_PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$LOCAL_HOME</span>/lib/pkgconfig:/usr/lib64/pkgconfig:<span style="color: #007800;">$PKG_CONFIG_PATH</span>&quot;</span>
<span style="color: #666666; font-style: italic;">#export LD_LIBRARY_PATH=&quot;$LOCAL_HOME/lib:/usr/X11R6/lib64:/usr/lib64&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$LOCAL_HOME</span>/lib:/usr/X11R6/lib64&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># NOTE: I had to hardcode the path for some reason</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MOZCONFIG</span>=<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>mozconfig-tbird
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">-j</span> <span style="color: #000000;">4</span> <span style="color: #660033;">-f</span> client.mk build 
&nbsp;
<span style="color: #666666; font-style: italic;"># make package</span>
<span style="color: #666666; font-style: italic;"># look in dist/*.tar.bz2</span></pre></div></div>

<h2>Installing</h2>
<p>First you make a .tar.bz2, then you go install it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> objdir-tb-release
<span style="color: #c20cb9; font-weight: bold;">make</span> package
<span style="color: #c20cb9; font-weight: bold;">cp</span> mozilla<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/*</span>.tar.bz2 <span style="color: #000000; font-weight: bold;">/</span>somewhere
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>share
<span style="color: #c20cb9; font-weight: bold;">tar</span> xvfj <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>that<span style="color: #000000; font-weight: bold;">/*</span>.tar.bz2</pre></div></div>

<p>Now make a wrapper script $HOME/bin/thunderbird :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exec</span> run_gapp <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>thunderbird<span style="color: #000000; font-weight: bold;">/</span>thunderbird <span style="color: #ff0000;">&quot;$@&quot;</span></pre></div></div>

<h2>Errors</h2>
<p>Here are some of the error messages I encountered along the way that were solved w/ the prerequisites and patch.  Hopefully this helps future googlers.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">nsUrlClassifierDBService.cpp:<span style="color: #7a0874; font-weight: bold;">&#40;</span>.text+0x678<span style="color: #7a0874; font-weight: bold;">&#41;</span>: undefined reference to <span style="color: #000000; font-weight: bold;">`</span>inflateInit_<span style="color: #ff0000;">'
nsUrlClassifierDBService.cpp:(.text+0x69c): undefined reference to `inflate'</span>
nsUrlClassifierDBService.cpp:<span style="color: #7a0874; font-weight: bold;">&#40;</span>.text+0x6d4<span style="color: #7a0874; font-weight: bold;">&#41;</span>: undefined reference to <span style="color: #000000; font-weight: bold;">`</span>inflateEnd<span style="color: #ff0000;">'</span></pre></div></div>

<p>Changed thunderbird-3.0.4/objdir-tb-release/mozilla/toolkit/components/build/Makefile to add libz to the compile.  I&#8217;m sure there&#8217;s a classier way of doing this.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">EXTRA_DSO_LDOPTS += \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>LIBS_DIR<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>EXTRA_DSO_LIBS<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MOZ_UNICHARUTIL_LIBS<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MOZ_COMPONENT_LIBS<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MOZ_JS_LIBS<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    $<span style="color: #7a0874; font-weight: bold;">&#40;</span>NULL<span style="color: #7a0874; font-weight: bold;">&#41;</span> \
    <span style="color: #660033;">-lz</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>thunderbird-3.0.4<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #000000; font-weight: bold;">/</span>c-sdk<span style="color: #000000; font-weight: bold;">/</span>ldap<span style="color: #000000; font-weight: bold;">/</span>libraries<span style="color: #000000; font-weight: bold;">/</span>libprldap<span style="color: #000000; font-weight: bold;">/</span>ldappr-public.c:<span style="color: #000000;">45</span>:<span style="color: #000000;">27</span>: <span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>nss<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>pprio.h: Permission denied</pre></div></div>

<p>Fix yer permissions. duh.  </p>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2010/04/06/ch0wned-building-your-own-thunderbird-3-on-el4-for-x86_64-in-your-homedir/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ch0wned &#8211; Building your own Firefox on EL4 for X86_64 in your homedir</title>
		<link>http://warped.org/blog/2010/04/06/ch0wned-building-your-own-firefox-on-el4-for-x86_64-in-your-homedir/</link>
		<comments>http://warped.org/blog/2010/04/06/ch0wned-building-your-own-firefox-on-el4-for-x86_64-in-your-homedir/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 22:45:10 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=91</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a Linux user and don't have root access. Intro So you want Firefox 3.new on your EL4 workstation and don&#8217;t have root access? Worse off it&#8217;s an x86_64 machine? This is not for the faint of heart, and you will run into some snags, but hopefully [...]]]></description>
			<content:encoded><![CDATA[<p><tt>ch0wned. adj. This is the state when you are a Linux user and don't have root access. </tt></p>
<h1>Intro</h1>
<p>So you want Firefox 3.new on your EL4 workstation and don&#8217;t have root access?  Worse off it&#8217;s an x86_64 machine?   This is not for the faint of heart, and you will run into some snags, but hopefully with my help you can make it work.</p>
<p>
This guide assumes you&#8217;re leaving off from my previous post : <a href="http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/">http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/</a>  where you&#8217;ve setup a script called config_gapp.
</p>
<h1>Prerequisites</h1>
<ul>
<li>firefox-3.6.2.source.tar.bz2 </li>
<li>nss-3.12.6-with-nspr-4.8.4.tar.gz</li>
<li>sqlite-amalgamation-3.6.23.1.tar.gz</li>
<li>Python-2.5.5.tar.bz2</li>
<li><a href="http://www.linuxfromscratch.org/blfs/view/svn/general/nspr.html">NSPR Patch from Standalone Linux</a> (READ THIS!)</li>
<li><a href="http://www.linuxfromscratch.org/blfs/view/svn/postlfs/nss.html">NSS Patch from Standalone Linux</a> (READ THIS!)</li>
<li>My Patches</li>
</ul>
<h2>Building</h2>
<ol>
<li>SQL Lite
<p>Make sure you get the &#8220;amalgamation&#8221; package.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">config_gapp
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

</p>
</li>
<li>NSPR
<p>Cheers to the Linux from Scratch gurus.  See above link.<br />
Apply this patch using &#8220;patch -p1 < file.patch" .  You might have to change 1 to another number.  I did this on the above newer version of NSPR/NSS w/out a problem.
</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;">Submitted By: DJ Lucas <span style="">&#40;</span>dj at linuxfromscratch dot org<span style="">&#41;</span>
Date: <span style="">2009</span>-08-<span style="">28</span>
Initial Package Version: <span style="">4.8</span>
Upstream Status: not applicable
Origin: self
Description: Adds pkg-config file for nspr.
&nbsp;
diff -Naur nspr-<span style="">4.8</span>-orig/mozilla/nsprpub/config/config.mk nspr-<span style="">4.8</span>/mozilla/nsprpub/config/config.mk
<span style="color: #888822;">--- nspr-4.8-orig/mozilla/nsprpub/config/config.mk	2005-04-29 16:02:53.000000000 -0500</span>
<span style="color: #888822;">+++ nspr-4.8/mozilla/nsprpub/config/config.mk	2009-08-28 15:42:46.000000000 -0500</span>
<span style="color: #440088;">@@ -162,3 +162,4 @@</span>
 RELEASE_INCLUDE_DIR = $<span style="">&#40;</span>RELEASE_DIR<span style="">&#41;</span>/$<span style="">&#40;</span>BUILD_NUMBER<span style="">&#41;</span>/$<span style="">&#40;</span>OBJDIR_NAME<span style="">&#41;</span>/include
 RELEASE_BIN_DIR = $<span style="">&#40;</span>RELEASE_DIR<span style="">&#41;</span>/$<span style="">&#40;</span>BUILD_NUMBER<span style="">&#41;</span>/$<span style="">&#40;</span>OBJDIR_NAME<span style="">&#41;</span>/bin
 RELEASE_LIB_DIR = $<span style="">&#40;</span>RELEASE_DIR<span style="">&#41;</span>/$<span style="">&#40;</span>BUILD_NUMBER<span style="">&#41;</span>/$<span style="">&#40;</span>OBJDIR_NAME<span style="">&#41;</span>/lib
<span style="color: #00b000;">+RELEASE_PC_DIR = $<span style="">&#40;</span>RELEASE_LIB_DIR<span style="">&#41;</span>/pkgconfig</span>
diff -Naur nspr-<span style="">4.8</span>-orig/mozilla/nsprpub/config/Makefile.in nspr-<span style="">4.8</span>/mozilla/nsprpub/config/Makefile.in
<span style="color: #888822;">--- nspr-4.8-orig/mozilla/nsprpub/config/Makefile.in	2009-03-03 16:04:23.000000000 -0600</span>
<span style="color: #888822;">+++ nspr-4.8/mozilla/nsprpub/config/Makefile.in	2009-08-28 15:42:46.000000000 -0500</span>
<span style="color: #440088;">@@ -52,9 +52,10 @@</span>
&nbsp;
 # autoconf.mk must be deleted last <span style="">&#40;</span>from the top-level directory<span style="">&#41;</span>
 # because it is included by every makefile.
<span style="color: #991111;">-DIST_GARBAGE	= nsprincl.mk nsprincl.sh nspr-config</span>
<span style="color: #00b000;">+DIST_GARBAGE	= nsprincl.mk nsprincl.sh nspr-config nspr.pc</span>
&nbsp;
 RELEASE_BINS	= nspr-config
<span style="color: #00b000;">+RELEASE_PC	= nspr.pc</span>
&nbsp;
 include $<span style="">&#40;</span>topsrcdir<span style="">&#41;</span>/config/config.mk
&nbsp;
diff -Naur nspr-<span style="">4.8</span>-orig/mozilla/nsprpub/config/nspr.pc.in nspr-<span style="">4.8</span>/mozilla/nsprpub/config/nspr.pc.in
<span style="color: #888822;">--- nspr-4.8-orig/mozilla/nsprpub/config/nspr.pc.in	1969-12-31 18:00:00.000000000 -0600</span>
<span style="color: #888822;">+++ nspr-4.8/mozilla/nsprpub/config/nspr.pc.in	2009-08-28 15:43:13.000000000 -0500</span>
<span style="color: #440088;">@@ -0,0 +1,11 @@</span>
<span style="color: #00b000;">+prefix=@prefix@</span>
<span style="color: #00b000;">+exec_prefix=@exec_prefix@</span>
<span style="color: #00b000;">+libdir=@libdir@</span>
<span style="color: #00b000;">+includedir=@includedir@</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+Name: NSPR</span>
<span style="color: #00b000;">+Description: The Netscape Portable Runtime</span>
<span style="color: #00b000;">+Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@</span>
<span style="color: #00b000;">+Libs: -L$<span style="">&#123;</span>libdir<span style="">&#125;</span> -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ -lpthread </span>
<span style="color: #00b000;">+Cflags: -I$<span style="">&#123;</span>includedir<span style="">&#125;</span></span>
<span style="color: #00b000;">+</span>
diff -Naur nspr-<span style="">4.8</span>-orig/mozilla/nsprpub/config/rules.mk nspr-<span style="">4.8</span>/mozilla/nsprpub/config/rules.mk
<span style="color: #888822;">--- nspr-4.8-orig/mozilla/nsprpub/config/rules.mk	2009-05-01 18:08:01.000000000 -0500</span>
<span style="color: #888822;">+++ nspr-4.8/mozilla/nsprpub/config/rules.mk	2009-08-28 15:42:46.000000000 -0500</span>
<span style="color: #440088;">@@ -211,7 +211,7 @@</span>
 	rm -rf $<span style="">&#40;</span>wildcard *.OBJ *.OBJD<span style="">&#41;</span> dist $<span style="">&#40;</span>ALL_TRASH<span style="">&#41;</span> $<span style="">&#40;</span>DIST_GARBAGE<span style="">&#41;</span>
 	+$<span style="">&#40;</span>LOOP_OVER_DIRS<span style="">&#41;</span>
&nbsp;
<span style="color: #991111;">-install:: $<span style="">&#40;</span>RELEASE_BINS<span style="">&#41;</span> $<span style="">&#40;</span>RELEASE_HEADERS<span style="">&#41;</span> $<span style="">&#40;</span>RELEASE_LIBS<span style="">&#41;</span></span>
<span style="color: #00b000;">+install:: $<span style="">&#40;</span>RELEASE_BINS<span style="">&#41;</span> $<span style="">&#40;</span>RELEASE_HEADERS<span style="">&#41;</span> $<span style="">&#40;</span>RELEASE_LIBS<span style="">&#41;</span> $<span style="">&#40;</span>RELEASE_PC<span style="">&#41;</span></span>
 ifdef RELEASE_BINS
 	$<span style="">&#40;</span>NSINSTALL<span style="">&#41;</span> -t -m 0755 $<span style="">&#40;</span>RELEASE_BINS<span style="">&#41;</span> $<span style="">&#40;</span>DESTDIR<span style="">&#41;</span>$<span style="">&#40;</span>bindir<span style="">&#41;</span>
 endif
<span style="color: #440088;">@@ -221,6 +221,9 @@</span>
 ifdef RELEASE_LIBS
 	$<span style="">&#40;</span>NSINSTALL<span style="">&#41;</span> -t -m 0755 $<span style="">&#40;</span>RELEASE_LIBS<span style="">&#41;</span> $<span style="">&#40;</span>DESTDIR<span style="">&#41;</span>$<span style="">&#40;</span>libdir<span style="">&#41;</span>/$<span style="">&#40;</span>lib_subdir<span style="">&#41;</span>
 endif
<span style="color: #00b000;">+ifdef RELEASE_PC</span>
<span style="color: #00b000;">+	$<span style="">&#40;</span>NSINSTALL<span style="">&#41;</span> -t -m 0644 $<span style="">&#40;</span>RELEASE_PC<span style="">&#41;</span> $<span style="">&#40;</span>DESTDIR<span style="">&#41;</span>$<span style="">&#40;</span>libdir<span style="">&#41;</span>/pkgconfig/</span>
<span style="color: #00b000;">+endif</span>
 	+$<span style="">&#40;</span>LOOP_OVER_DIRS<span style="">&#41;</span>
&nbsp;
 release:: export
<span style="color: #440088;">@@ -272,6 +275,23 @@</span>
 	fi
 	cp $<span style="">&#40;</span>RELEASE_HEADERS<span style="">&#41;</span> $<span style="">&#40;</span>RELEASE_HEADERS_DEST<span style="">&#41;</span>
 endif
<span style="color: #00b000;">+ifdef RELEASE_PC</span>
<span style="color: #00b000;">+	@echo &quot;Copying pkg-config files to release directory&quot;</span>
<span style="color: #00b000;">+	@if test -z &quot;$<span style="">&#40;</span>BUILD_NUMBER<span style="">&#41;</span>&quot;; then \</span>
<span style="color: #00b000;">+		echo &quot;BUILD_NUMBER must be defined&quot;; \</span>
<span style="color: #00b000;">+		false; \</span>
<span style="color: #00b000;">+	else \</span>
<span style="color: #00b000;">+		true; \</span>
<span style="color: #00b000;">+	fi</span>
<span style="color: #00b000;">+	@if test ! -d $<span style="">&#40;</span>RELEASE_PC_DEST<span style="">&#41;</span>; then \</span>
<span style="color: #00b000;">+		rm -rf $<span style="">&#40;</span>RELEASE_PC_DEST<span style="">&#41;</span>; \</span>
<span style="color: #00b000;">+		$<span style="">&#40;</span>NSINSTALL<span style="">&#41;</span> -D $<span style="">&#40;</span>RELEASE_PC_DEST<span style="">&#41;</span>;\</span>
<span style="color: #00b000;">+	else \</span>
<span style="color: #00b000;">+		true; \</span>
<span style="color: #00b000;">+	fi</span>
<span style="color: #00b000;">+	cp $<span style="">&#40;</span>RELEASE_PC<span style="">&#41;</span> $<span style="">&#40;</span>RELEASE_PC_DEST<span style="">&#41;</span></span>
<span style="color: #00b000;">+endif</span>
<span style="color: #00b000;">+</span>
 	+$<span style="">&#40;</span>LOOP_OVER_DIRS<span style="">&#41;</span>
&nbsp;
 alltags:
diff -Naur nspr-<span style="">4.8</span>-orig/mozilla/nsprpub/configure nspr-<span style="">4.8</span>/mozilla/nsprpub/configure
<span style="color: #888822;">--- nspr-4.8-orig/mozilla/nsprpub/configure	2009-05-08 08:12:31.000000000 -0500</span>
<span style="color: #888822;">+++ nspr-4.8/mozilla/nsprpub/configure	2009-08-28 15:42:46.000000000 -0500</span>
<span style="color: #440088;">@@ -6037,6 +6037,7 @@</span>
 config/nsprincl.mk
 config/nsprincl.sh
 config/nspr-config
<span style="color: #00b000;">+config/nspr.pc</span>
 lib/Makefile 
 lib/ds/Makefile 
 lib/libc/Makefile 
diff -Naur nspr-<span style="">4.8</span>-orig/mozilla/nsprpub/configure.in nspr-<span style="">4.8</span>/mozilla/nsprpub/configure.in
<span style="color: #888822;">--- nspr-4.8-orig/mozilla/nsprpub/configure.in	2009-05-01 18:08:00.000000000 -0500</span>
<span style="color: #888822;">+++ nspr-4.8/mozilla/nsprpub/configure.in	2009-08-28 15:42:46.000000000 -0500</span>
<span style="color: #440088;">@@ -2871,6 +2871,7 @@</span>
 config/nsprincl.mk
 config/nsprincl.sh
 config/nspr-config
<span style="color: #00b000;">+config/nspr.pc</span>
 lib/Makefile 
 lib/ds/Makefile 
 lib/libc/Makefile</pre></div></div>

</p>
<p>Once patched, run this script to configure and build NSPR</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh </span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> mozilla<span style="color: #000000; font-weight: bold;">/</span>nsprpub
config_gapp \
            <span style="color: #660033;">--with-mozilla</span> \
            <span style="color: #660033;">--with-pthreads</span> \
            <span style="color: #660033;">--enable-64bit</span> \
            <span style="color: #660033;">--disable-debug</span> \
            <span style="color: #660033;">--enable-optimize</span>=<span style="color: #ff0000;">&quot;-O2&quot;</span>
&nbsp;
run_gapp <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">-j4</span>
&nbsp;
run_gapp <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-f</span> <span style="color: #660033;">-LR</span> dist<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>nspr <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>include</pre></div></div>

</li>
<li>NSS
<p>Again cheers to DJ for this gem. Apply it.</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;">Submitted By: DJ Lucas <span style="">&#40;</span>dj at linuxfromscratch dot org<span style="">&#41;</span>
Date: <span style="">2009</span>-09-05
Initial Package Version: 3.12.4
Upstream Status: not applicable
Origin: self
Description: Adds auto-generated nss.pc and nss-config script, and allows
             building without nspr in the source tree.
&nbsp;
diff -Naur nss-3.12.4-orig/mozilla/security/nss/config/Makefile nss-3.12.4/mozilla/security/nss/config/Makefile
<span style="color: #888822;">--- nss-3.12.4-orig/mozilla/security/nss/config/Makefile	1969-12-31 18:00:00.000000000 -0600</span>
<span style="color: #888822;">+++ nss-3.12.4/mozilla/security/nss/config/Makefile	2009-08-31 19:15:20.000000000 -0500</span>
<span style="color: #440088;">@@ -0,0 +1,40 @@</span>
<span style="color: #00b000;">+CORE_DEPTH = ../..</span>
<span style="color: #00b000;">+DEPTH      = ../..</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+include $<span style="">&#40;</span>CORE_DEPTH<span style="">&#41;</span>/coreconf/config.mk</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+NSS_MAJOR_VERSION = `grep &quot;NSS_VMAJOR&quot; ../lib/nss/nss.h | awk '<span style="">&#123;</span>print $$3<span style="">&#125;</span>'`</span>
<span style="color: #00b000;">+NSS_MINOR_VERSION = `grep &quot;NSS_VMINOR&quot; ../lib/nss/nss.h | awk '<span style="">&#123;</span>print $$3<span style="">&#125;</span>'`</span>
<span style="color: #00b000;">+NSS_PATCH_VERSION = `grep &quot;NSS_VPATCH&quot; ../lib/nss/nss.h | awk '<span style="">&#123;</span>print $$3<span style="">&#125;</span>'`</span>
<span style="color: #00b000;">+PREFIX = /usr</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+all: export libs</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+export:</span>
<span style="color: #00b000;">+	# Create the nss.pc file</span>
<span style="color: #00b000;">+	mkdir -p $<span style="">&#40;</span>DIST<span style="">&#41;</span>/lib/pkgconfig</span>
<span style="color: #00b000;">+	sed -e &quot;s,@prefix@,$<span style="">&#40;</span>PREFIX<span style="">&#41;</span>,&quot; \</span>
<span style="color: #00b000;">+	    -e &quot;s,@exec_prefix@,\$$<span style="">&#123;</span>prefix<span style="">&#125;</span>,&quot; \</span>
<span style="color: #00b000;">+	    -e &quot;s,@libdir@,\$$<span style="">&#123;</span>prefix<span style="">&#125;</span>/lib,&quot; \</span>
<span style="color: #00b000;">+	    -e &quot;s,@includedir@,\$$<span style="">&#123;</span>prefix<span style="">&#125;</span>/include/nss,&quot; \</span>
<span style="color: #00b000;">+	    -e &quot;s,@NSS_MAJOR_VERSION@,$<span style="">&#40;</span>NSS_MAJOR_VERSION<span style="">&#41;</span>,g&quot; \</span>
<span style="color: #00b000;">+	    -e &quot;s,@NSS_MINOR_VERSION@,$<span style="">&#40;</span>NSS_MINOR_VERSION<span style="">&#41;</span>,&quot; \</span>
<span style="color: #00b000;">+	    -e &quot;s,@NSS_PATCH_VERSION@,$<span style="">&#40;</span>NSS_PATCH_VERSION<span style="">&#41;</span>,&quot; \</span>
<span style="color: #00b000;">+	    nss.pc.in &gt; nss.pc</span>
<span style="color: #00b000;">+	chmod 0644 nss.pc</span>
<span style="color: #00b000;">+	ln -sf ../../../../security/nss/config/nss.pc $<span style="">&#40;</span>DIST<span style="">&#41;</span>/lib/pkgconfig</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+	# Create the nss-config script</span>
<span style="color: #00b000;">+	mkdir -p $<span style="">&#40;</span>DIST<span style="">&#41;</span>/bin</span>
<span style="color: #00b000;">+	sed -e &quot;s,@prefix@,$<span style="">&#40;</span>PREFIX<span style="">&#41;</span>,&quot; \</span>
<span style="color: #00b000;">+	    -e &quot;s,@NSS_MAJOR_VERSION@,$<span style="">&#40;</span>NSS_MAJOR_VERSION<span style="">&#41;</span>,&quot; \</span>
<span style="color: #00b000;">+	    -e &quot;s,@NSS_MINOR_VERSION@,$<span style="">&#40;</span>NSS_MINOR_VERSION<span style="">&#41;</span>,&quot; \</span>
<span style="color: #00b000;">+	    -e &quot;s,@NSS_PATCH_VERSION@,$<span style="">&#40;</span>NSS_PATCH_VERSION<span style="">&#41;</span>,&quot; \</span>
<span style="color: #00b000;">+	    nss-config.in &gt; nss-config</span>
<span style="color: #00b000;">+	chmod 0755 nss-config</span>
<span style="color: #00b000;">+	ln -sf ../../../security/nss/config/nss-config $<span style="">&#40;</span>DIST<span style="">&#41;</span>/bin</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+libs:</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+dummy: all export libs</span>
<span style="color: #00b000;">+</span>
diff -Naur nss-3.12.4-orig/mozilla/security/nss/config/nss-config.in nss-3.12.4/mozilla/security/nss/config/nss-config.in
<span style="color: #888822;">--- nss-3.12.4-orig/mozilla/security/nss/config/nss-config.in	1969-12-31 18:00:00.000000000 -0600</span>
<span style="color: #888822;">+++ nss-3.12.4/mozilla/security/nss/config/nss-config.in	2009-08-31 19:16:56.000000000 -0500</span>
<span style="color: #440088;">@@ -0,0 +1,153 @@</span>
<span style="color: #00b000;">+#!/bin/sh</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+prefix=@prefix@</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+major_version=@NSS_MAJOR_VERSION@</span>
<span style="color: #00b000;">+minor_version=@NSS_MINOR_VERSION@</span>
<span style="color: #00b000;">+patch_version=@NSS_PATCH_VERSION@</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+usage<span style="">&#40;</span><span style="">&#41;</span></span>
<span style="color: #00b000;">+<span style="">&#123;</span></span>
<span style="color: #00b000;">+	cat &lt; &lt;EOF</span>
<span style="color: #00b000;">+Usage: nss-config <span style="">&#91;</span>OPTIONS<span style="">&#93;</span> <span style="">&#91;</span>LIBRARIES<span style="">&#93;</span></span>
<span style="color: #00b000;">+Options:</span>
<span style="color: #00b000;">+	<span style="">&#91;</span>--prefix<span style="">&#91;</span>=DIR<span style="">&#93;</span><span style="">&#93;</span></span>
<span style="color: #00b000;">+	<span style="">&#91;</span>--exec-prefix<span style="">&#91;</span>=DIR<span style="">&#93;</span><span style="">&#93;</span></span>
<span style="color: #00b000;">+	<span style="">&#91;</span>--includedir<span style="">&#91;</span>=DIR<span style="">&#93;</span><span style="">&#93;</span></span>
<span style="color: #00b000;">+	<span style="">&#91;</span>--libdir<span style="">&#91;</span>=DIR<span style="">&#93;</span><span style="">&#93;</span></span>
<span style="color: #00b000;">+	<span style="">&#91;</span>--version<span style="">&#93;</span></span>
<span style="color: #00b000;">+	<span style="">&#91;</span>--libs<span style="">&#93;</span></span>
<span style="color: #00b000;">+	<span style="">&#91;</span>--cflags<span style="">&#93;</span></span>
<span style="color: #00b000;">+Dynamic Libraries:</span>
<span style="color: #00b000;">+	nss</span>
<span style="color: #00b000;">+	nssutil</span>
<span style="color: #00b000;">+	smime</span>
<span style="color: #00b000;">+	ssl</span>
<span style="color: #00b000;">+	softokn</span>
<span style="color: #00b000;">+EOF</span>
<span style="color: #00b000;">+	exit $1</span>
<span style="color: #00b000;">+<span style="">&#125;</span></span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+if test $# -eq <span style="">0</span>; then</span>
<span style="color: #00b000;">+	usage 1 1&gt;&amp;2</span>
<span style="color: #00b000;">+fi</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+lib_nss=yes</span>
<span style="color: #00b000;">+lib_nssutil=yes</span>
<span style="color: #00b000;">+lib_smime=yes</span>
<span style="color: #00b000;">+lib_ssl=yes</span>
<span style="color: #00b000;">+lib_softokn=yes</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+while test $# -gt <span style="">0</span>; do</span>
<span style="color: #00b000;">+  case &quot;$1&quot; in</span>
<span style="color: #00b000;">+  -*=*<span style="">&#41;</span> optarg=`echo &quot;$1&quot; | sed 's/<span style="">&#91;</span>-_a-zA-Z0-<span style="">9</span><span style="">&#93;</span>*=//'` ;;</span>
<span style="color: #00b000;">+  *<span style="">&#41;</span> optarg= ;;</span>
<span style="color: #00b000;">+  esac</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+  case $1 in</span>
<span style="color: #00b000;">+    --prefix=*<span style="">&#41;</span></span>
<span style="color: #00b000;">+      prefix=$optarg</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --prefix<span style="">&#41;</span></span>
<span style="color: #00b000;">+      echo_prefix=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --exec-prefix=*<span style="">&#41;</span></span>
<span style="color: #00b000;">+      exec_prefix=$optarg</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --exec-prefix<span style="">&#41;</span></span>
<span style="color: #00b000;">+      echo_exec_prefix=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --includedir=*<span style="">&#41;</span></span>
<span style="color: #00b000;">+      includedir=$optarg</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --includedir<span style="">&#41;</span></span>
<span style="color: #00b000;">+      echo_includedir=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --libdir=*<span style="">&#41;</span></span>
<span style="color: #00b000;">+      libdir=$optarg</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --libdir<span style="">&#41;</span></span>
<span style="color: #00b000;">+      echo_libdir=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --version<span style="">&#41;</span></span>
<span style="color: #00b000;">+      echo $<span style="">&#123;</span>major_version<span style="">&#125;</span>.$<span style="">&#123;</span>minor_version<span style="">&#125;</span>.$<span style="">&#123;</span>patch_version<span style="">&#125;</span></span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --cflags<span style="">&#41;</span></span>
<span style="color: #00b000;">+      echo_cflags=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    --libs<span style="">&#41;</span></span>
<span style="color: #00b000;">+      echo_libs=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    nss<span style="">&#41;</span></span>
<span style="color: #00b000;">+      lib_nss=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    nssutil<span style="">&#41;</span></span>
<span style="color: #00b000;">+      lib_nssutil=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    smime<span style="">&#41;</span></span>
<span style="color: #00b000;">+      lib_smime=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    ssl<span style="">&#41;</span></span>
<span style="color: #00b000;">+      lib_ssl=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    softokn<span style="">&#41;</span></span>
<span style="color: #00b000;">+      lib_softokn=yes</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+    *<span style="">&#41;</span></span>
<span style="color: #00b000;">+      usage 1 1&gt;&amp;2</span>
<span style="color: #00b000;">+      ;;</span>
<span style="color: #00b000;">+  esac</span>
<span style="color: #00b000;">+  shift</span>
<span style="color: #00b000;">+done</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+# Set variables that may be dependent upon other variables</span>
<span style="color: #00b000;">+if test -z &quot;$exec_prefix&quot;; then</span>
<span style="color: #00b000;">+    exec_prefix=`pkg-config --variable=exec_prefix nss`</span>
<span style="color: #00b000;">+fi</span>
<span style="color: #00b000;">+if test -z &quot;$includedir&quot;; then</span>
<span style="color: #00b000;">+    includedir=`pkg-config --variable=includedir nss`</span>
<span style="color: #00b000;">+fi</span>
<span style="color: #00b000;">+if test -z &quot;$libdir&quot;; then</span>
<span style="color: #00b000;">+    libdir=`pkg-config --variable=libdir nss`</span>
<span style="color: #00b000;">+fi</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+if test &quot;$echo_prefix&quot; = &quot;yes&quot;; then</span>
<span style="color: #00b000;">+    echo $prefix</span>
<span style="color: #00b000;">+fi</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+if test &quot;$echo_exec_prefix&quot; = &quot;yes&quot;; then</span>
<span style="color: #00b000;">+    echo $exec_prefix</span>
<span style="color: #00b000;">+fi</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+if test &quot;$echo_includedir&quot; = &quot;yes&quot;; then</span>
<span style="color: #00b000;">+    echo $includedir</span>
<span style="color: #00b000;">+fi</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+if test &quot;$echo_libdir&quot; = &quot;yes&quot;; then</span>
<span style="color: #00b000;">+    echo $libdir</span>
<span style="color: #00b000;">+fi</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+if test &quot;$echo_cflags&quot; = &quot;yes&quot;; then</span>
<span style="color: #00b000;">+    echo -I$includedir</span>
<span style="color: #00b000;">+fi</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+if test &quot;$echo_libs&quot; = &quot;yes&quot;; then</span>
<span style="color: #00b000;">+      libdirs=&quot;-L$libdir&quot;</span>
<span style="color: #00b000;">+      if test -n &quot;$lib_nss&quot;; then</span>
<span style="color: #00b000;">+	libdirs=&quot;$libdirs -lnss$<span style="">&#123;</span>major_version<span style="">&#125;</span>&quot;</span>
<span style="color: #00b000;">+      fi</span>
<span style="color: #00b000;">+      if test -n &quot;$lib_nssutil&quot;; then</span>
<span style="color: #00b000;">+        libdirs=&quot;$libdirs -lnssutil$<span style="">&#123;</span>major_version<span style="">&#125;</span>&quot;</span>
<span style="color: #00b000;">+      fi</span>
<span style="color: #00b000;">+      if test -n &quot;$lib_smime&quot;; then</span>
<span style="color: #00b000;">+	libdirs=&quot;$libdirs -lsmime$<span style="">&#123;</span>major_version<span style="">&#125;</span>&quot;</span>
<span style="color: #00b000;">+      fi</span>
<span style="color: #00b000;">+      if test -n &quot;$lib_ssl&quot;; then</span>
<span style="color: #00b000;">+	libdirs=&quot;$libdirs -lssl$<span style="">&#123;</span>major_version<span style="">&#125;</span>&quot;</span>
<span style="color: #00b000;">+      fi</span>
<span style="color: #00b000;">+      if test -n &quot;$lib_softokn&quot;; then</span>
<span style="color: #00b000;">+        libdirs=&quot;$libdirs -lsoftokn$<span style="">&#123;</span>major_version<span style="">&#125;</span>&quot;</span>
<span style="color: #00b000;">+      fi</span>
<span style="color: #00b000;">+      echo $libdirs</span>
<span style="color: #00b000;">+fi      </span>
<span style="color: #00b000;">+</span>
diff -Naur nss-3.12.4-orig/mozilla/security/nss/config/nss.pc.in nss-3.12.4/mozilla/security/nss/config/nss.pc.in
<span style="color: #888822;">--- nss-3.12.4-orig/mozilla/security/nss/config/nss.pc.in	1969-12-31 18:00:00.000000000 -0600</span>
<span style="color: #888822;">+++ nss-3.12.4/mozilla/security/nss/config/nss.pc.in	2009-08-31 19:15:20.000000000 -0500</span>
<span style="color: #440088;">@@ -0,0 +1,12 @@</span>
<span style="color: #00b000;">+prefix=@prefix@</span>
<span style="color: #00b000;">+exec_prefix=@exec_prefix@</span>
<span style="color: #00b000;">+libdir=@libdir@</span>
<span style="color: #00b000;">+includedir=@includedir@</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+Name: NSS</span>
<span style="color: #00b000;">+Description: Network Security Services</span>
<span style="color: #00b000;">+Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@</span>
<span style="color: #00b000;">+Requires: nspr &gt;= 4.8</span>
<span style="color: #00b000;">+Libs: -L@libdir@ -lnss@NSS_MAJOR_VERSION@ -lnssutil@NSS_MAJOR_VERSION@ -lsmime@NSS_MAJOR_VERSION@ -lssl@NSS_MAJOR_VERSION@ -lsoftokn@NSS_MAJOR_VERSION@</span>
<span style="color: #00b000;">+Cflags: -I$<span style="">&#123;</span>includedir<span style="">&#125;</span></span>
<span style="color: #00b000;">+</span>
diff -Naur nss-3.12.4-orig/mozilla/security/nss/Makefile nss-3.12.4/mozilla/security/nss/Makefile
<span style="color: #888822;">--- nss-3.12.4-orig/mozilla/security/nss/Makefile	2008-12-02 17:24:39.000000000 -0600</span>
<span style="color: #888822;">+++ nss-3.12.4/mozilla/security/nss/Makefile	2009-08-31 19:15:20.000000000 -0500</span>
<span style="color: #440088;">@@ -78,7 +78,7 @@</span>
 # <span style="">&#40;</span><span style="">7</span><span style="">&#41;</span> Execute &quot;local&quot; rules. <span style="">&#40;</span>OPTIONAL<span style="">&#41;</span>.                              #
 #######################################################################
&nbsp;
<span style="color: #991111;">-nss_build_all: build_coreconf build_nspr build_dbm all</span>
<span style="color: #00b000;">+nss_build_all: build_coreconf build_dbm all</span>
&nbsp;
 nss_clean_all: clobber_coreconf clobber_nspr clobber_dbm clobber
&nbsp;
<span style="color: #440088;">@@ -140,12 +140,6 @@</span>
 	--with-dist-prefix='$<span style="">&#40;</span>NSPR_PREFIX<span style="">&#41;</span>' \
 	--with-dist-includedir='$<span style="">&#40;</span>NSPR_PREFIX<span style="">&#41;</span>/include'
&nbsp;
<span style="color: #991111;">-build_nspr: $<span style="">&#40;</span>NSPR_CONFIG_STATUS<span style="">&#41;</span></span>
<span style="color: #991111;">-	cd $<span style="">&#40;</span>CORE_DEPTH<span style="">&#41;</span>/../nsprpub/$<span style="">&#40;</span>OBJDIR_NAME<span style="">&#41;</span> ; $<span style="">&#40;</span>MAKE<span style="">&#41;</span></span>
<span style="color: #991111;">-</span>
<span style="color: #991111;">-clobber_nspr: $<span style="">&#40;</span>NSPR_CONFIG_STATUS<span style="">&#41;</span></span>
<span style="color: #991111;">-	cd $<span style="">&#40;</span>CORE_DEPTH<span style="">&#41;</span>/../nsprpub/$<span style="">&#40;</span>OBJDIR_NAME<span style="">&#41;</span> ; $<span style="">&#40;</span>MAKE<span style="">&#41;</span> clobber</span>
<span style="color: #991111;">-</span>
 build_dbm:
 ifndef NSS_DISABLE_DBM
 	cd $<span style="">&#40;</span>CORE_DEPTH<span style="">&#41;</span>/dbm ; $<span style="">&#40;</span>MAKE<span style="">&#41;</span> export libs
diff -Naur nss-3.12.4-orig/mozilla/security/nss/manifest.mn nss-3.12.4/mozilla/security/nss/manifest.mn
<span style="color: #888822;">--- nss-3.12.4-orig/mozilla/security/nss/manifest.mn	2008-04-04 15:36:59.000000000 -0500</span>
<span style="color: #888822;">+++ nss-3.12.4/mozilla/security/nss/manifest.mn	2009-08-31 19:15:20.000000000 -0500</span>
<span style="color: #440088;">@@ -42,6 +42,6 @@</span>
&nbsp;
 RELEASE = nss
&nbsp;
<span style="color: #991111;">-DIRS = lib cmd</span>
<span style="color: #00b000;">+DIRS = lib cmd config</span></pre></div></div>

<p>I had to add the following line to nss-3.12.6/mozilla/security/coreconf/location.mk to get it to find the newly installed NSPR.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">INCLUDES += -I<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>include</pre></div></div>

<p>Then run this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">BUILD_OPT</span>=<span style="color: #000000;">1</span> 
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">NSS_USE_SYSTEM_SQLITE</span>=<span style="color: #000000;">1</span> 
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">NSPR_INCLUDE_DIR</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>nspr 
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">USE_SYSTEM_ZLIB</span>=<span style="color: #000000;">1</span> 
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ZLIB_LIBS</span>=-lz 
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">USE_64</span>=<span style="color: #000000;">1</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#patch -Np1 -i ../nss-3.12.5-standalone-1.patch </span>
&nbsp;
run_gapp \
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">-C</span> mozilla<span style="color: #000000; font-weight: bold;">/</span>security<span style="color: #000000; font-weight: bold;">/</span>nss nss_build_all</pre></div></div>

<p>Then run this to install it :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">LOC_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">NSS_LINUXDIR</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span>mozilla<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>Linux<span style="color: #000000; font-weight: bold;">*`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;NSS_LINUXDIR=<span style="color: #007800;">$NSS_LINUXDIR</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> mozilla<span style="color: #000000; font-weight: bold;">/</span>dist
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-m755</span> <span style="color: #007800;">$NSS_LINUXDIR</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/*</span>.so <span style="color: #007800;">$LOC_HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib 
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-m644</span> <span style="color: #007800;">$NSS_LINUXDIR</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000; font-weight: bold;">*</span>.chk,libcrmf.a<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #007800;">$LOC_HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib 
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-m755</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$LOC_HOME</span><span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>nss 
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-m755</span> <span style="color: #007800;">$NSS_LINUXDIR</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>certutil,nss-config,pk12util<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #007800;">$LOC_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin 
<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-m644</span> <span style="color: #007800;">$NSS_LINUXDIR</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>pkgconfig<span style="color: #000000; font-weight: bold;">/</span>nss.pc <span style="color: #007800;">$LOC_HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>pkgconfig 
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-RL</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>public,private<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>nss<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #007800;">$LOC_HOME</span><span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>nss 
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">644</span> <span style="color: #007800;">$LOC_HOME</span><span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>nss<span style="color: #000000; font-weight: bold;">/*</span></pre></div></div>

</p>
</li>
<li>Python
<p>See my other post here : <a href="http://warped.org/blog/2010/04/02/ch0wned-installing-taskcoach-and-all-its-depenencies-in-home-for-el4/">http://warped.org/blog/2010/04/02/ch0wned-installing-taskcoach-and-all-its-depenencies-in-home-for-el4/</a>
</p>
</li>
</ol>
<h1>Firefox</h1>
<h2>Configuring</h2>
<p>Make a file called mozconfig-firefox or some such.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">BUILD_OFFICIAL</span>=<span style="color: #000000;">1</span>
mk_add_options <span style="color: #007800;">BUILD_OFFICIAL</span>=<span style="color: #000000;">1</span>
mk_add_options <span style="color: #007800;">MOZ_CO_PROJECT</span>=browser
<span style="color: #666666; font-style: italic;"># the following line uses 4 CPUs to build</span>
<span style="color: #666666; font-style: italic;">#mk_add_options MOZ_MAKE_FLAGS=&quot;-j4&quot;</span>
&nbsp;
ac_add_options <span style="color: #660033;">--enable-application</span>=browser
ac_add_options <span style="color: #660033;">--enable-official-branding</span>
ac_add_options <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>firefox
&nbsp;
<span style="color: #666666; font-style: italic;"># Optimization</span>
ac_add_options <span style="color: #660033;">--disable-tests</span>
ac_add_options <span style="color: #660033;">--disable-debug</span>
ac_add_options <span style="color: #660033;">--enable-optimize</span>=<span style="color: #ff0000;">&quot;-O2 -funroll-loops -fexpensive-optimizations&quot;</span>
ac_add_options <span style="color: #660033;">--enable-strip</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Features</span>
ac_add_options <span style="color: #660033;">--disable-accessibility</span>
ac_add_options <span style="color: #660033;">--disable-updater</span>
ac_add_options <span style="color: #660033;">--disable-installer</span>
ac_add_options <span style="color: #660033;">--enable-safe-browsing</span>
ac_add_options <span style="color: #660033;">--enable-xinerama</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Libraries / Dependencies</span>
ac_add_options <span style="color: #660033;">--disable-libnotify</span>
ac_add_options <span style="color: #660033;">--disable-gnomevfs</span>
ac_add_options <span style="color: #660033;">--enable-default-toolkit</span>=cairo-gtk2
ac_add_options <span style="color: #660033;">--enable-system-cairo</span>
ac_add_options <span style="color: #660033;">--with-system-nss</span>
ac_add_options <span style="color: #660033;">--with-nss-prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span>
ac_add_options <span style="color: #660033;">--with-system-nspr</span>
ac_add_options <span style="color: #660033;">--with-nspr-prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span>
ac_add_options <span style="color: #660033;">--enable-system-sqlite</span></pre></div></div>

<h2>Building</h2>
<p>I had to patch firefox to use OSS instead of ALSA because EL4 doesn&#8217;t have a working ALSA by default.  If you have ALSA working, you may not have to do this step.  I got the guts of this patch from somewhere, but I can&#8217;t find it now, thanks whoever you are!</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;">diff -ur firefox-3.6.2-orig/media/libsydneyaudio/src/Makefile.in firefox-3.6.2/media/libsydneyaudio/src/Makefile.in
<span style="color: #888822;">--- firefox-3.6.2-orig/media/libsydneyaudio/src/Makefile.in	2010-03-16 02:56:36.000000000 -0700</span>
<span style="color: #888822;">+++ firefox-3.6.2/media/libsydneyaudio/src/Makefile.in	2010-04-01 10:13:27.000000000 -0700</span>
<span style="color: #440088;">@@ -47,7 +47,7 @@</span>
&nbsp;
 ifeq <span style="">&#40;</span>$<span style="">&#40;</span>OS_ARCH<span style="">&#41;</span>,Linux<span style="">&#41;</span>
 CSRCS		= \
<span style="color: #991111;">-		sydney_audio_alsa.c \</span>
<span style="color: #00b000;">+		sydney_audio_oss.c \</span>
 		$<span style="">&#40;</span>NULL<span style="">&#41;</span>
 endif
&nbsp;
diff -ur firefox-3.6.2-orig/media/libsydneyaudio/src/sydney_audio_oss.c firefox-3.6.2/media/libsydneyaudio/src/sydney_audio_oss.c
<span style="color: #888822;">--- firefox-3.6.2-orig/media/libsydneyaudio/src/sydney_audio_oss.c	2010-03-16 02:56:36.000000000 -0700</span>
<span style="color: #888822;">+++ firefox-3.6.2/media/libsydneyaudio/src/sydney_audio_oss.c	2010-04-01 10:15:40.000000000 -0700</span>
<span style="color: #440088;">@@ -47,11 +47,11 @@</span>
 #include &quot;sydney_audio.h&quot;
&nbsp;
 // for versions newer than 3.6.1
<span style="color: #991111;">-#define OSS_VERSION<span style="">&#40;</span>x, y, z<span style="">&#41;</span> <span style="">&#40;</span>x &lt; &lt; <span style="">16</span> | y &lt;&lt; <span style="">8</span> | z<span style="">&#41;</span></span>
<span style="color: #00b000;">+#define OSS_VERSION_<span style="">&#40;</span>x, y, z<span style="">&#41;</span> <span style="">&#40;</span>x &lt;&lt; <span style="">16</span> | y &lt;&lt; <span style="">8</span> | z<span style="">&#41;</span></span>
 // support only versions newer than 3.6.1
<span style="color: #991111;">-#define SUPP_OSS_VERSION OSS_VERSION<span style="">&#40;</span>3,6,1<span style="">&#41;</span></span>
<span style="color: #00b000;">+#define SUPP_OSS_VERSION OSS_VERSION_<span style="">&#40;</span>3,6,1<span style="">&#41;</span></span>
&nbsp;
<span style="color: #991111;">-#if <span style="">&#40;</span>SOUND_VERSION &lt; SUPP_OSS_VERSION<span style="">&#41;</span></span>
<span style="color: #00b000;">+#if <span style="">&#40;</span>SOUND_VERSION &lt; SUPP_OSS_VERSION_<span style="">&#41;</span></span>
 #error Unsupported OSS Version
 #else
&nbsp;
<span style="color: #440088;">@@ -127,7 +127,7 @@</span>
         case SA_PCM_FORMAT_S16_BE:
             *fmt = AFMT_S16_BE;
             break;
<span style="color: #991111;">-#if SOUND_VERSION &gt;= OSS_VERSION<span style="">&#40;</span>4,0,0<span style="">&#41;</span></span>
<span style="color: #00b000;">+#if SOUND_VERSION &gt;= OSS_VERSION_<span style="">&#40;</span>4,0,0<span style="">&#41;</span></span>
         /* <span style="">24</span>-bit formats <span style="">&#40;</span>LSB aligned in <span style="">32</span> bit word<span style="">&#41;</span> */
         case SA_PCM_FORMAT_S24_LE:
             *fmt = AFMT_S24_LE;
<span style="color: #440088;">@@ -563,6 +563,8 @@</span>
 #if <span style="">0</span> /* TODO */
   AudioOutputUnitStop<span style="">&#40;</span>s-&gt;output_unit<span style="">&#41;</span>;
 #endif
<span style="color: #00b000;">+  close<span style="">&#40;</span>s-&gt;output_fd<span style="">&#41;</span>;</span>
<span style="color: #00b000;">+  s-&gt;output_fd = -<span style="">1</span>;</span>
   pthread_mutex_unlock<span style="">&#40;</span>&amp;s-&gt;mutex<span style="">&#41;</span>;
   return SA_SUCCESS;
 <span style="">&#125;</span>
<span style="color: #440088;">@@ -581,10 +583,11 @@</span>
    * The audio device resets its mSampleTime counter after pausing,
    * so we need to clear our tracking value to keep that in sync.
    */
<span style="color: #991111;">-  s-&gt;bytes_played = <span style="">0</span>;</span>
<span style="color: #00b000;">+  //s-&gt;bytes_played = <span style="">0</span>;</span>
 #if <span style="">0</span> /* TODO */
   AudioOutputUnitStart<span style="">&#40;</span>s-&gt;output_unit<span style="">&#41;</span>;
 #endif
<span style="color: #00b000;">+  sa_stream_open<span style="">&#40;</span>s<span style="">&#41;</span>;</span>
   pthread_mutex_unlock<span style="">&#40;</span>&amp;s-&gt;mutex<span style="">&#41;</span>;
   return SA_SUCCESS;
 <span style="">&#125;</span>
<span style="color: #440088;">@@ -615,7 +618,7 @@</span>
   if <span style="">&#40;</span>s == NULL || s-&gt;output_fd == -<span style="">1</span><span style="">&#41;</span> <span style="">&#123;</span>
     return SA_ERROR_NO_INIT;
   <span style="">&#125;</span>
<span style="color: #991111;">-#if SOUND_VERSION &gt;= OSS_VERSION<span style="">&#40;</span>4,0,0<span style="">&#41;</span></span>
<span style="color: #00b000;">+#if SOUND_VERSION &gt;= OSS_VERSION_<span style="">&#40;</span>4,0,0<span style="">&#41;</span></span>
   int mvol = <span style="">&#40;</span><span style="">&#40;</span>int<span style="">&#41;</span><span style="">&#40;</span><span style="">100</span>*vol<span style="">&#41;</span><span style="">&#41;</span> | <span style="">&#40;</span><span style="">&#40;</span>int<span style="">&#41;</span><span style="">&#40;</span><span style="">100</span>*vol<span style="">&#41;</span> &lt; &lt; <span style="">8</span><span style="">&#41;</span>;
   if <span style="">&#40;</span>ioctl<span style="">&#40;</span>s-&gt;output_fd, SNDCTL_DSP_SETPLAYVOL, &amp;mvol<span style="">&#41;</span> &lt; <span style="">0</span><span style="">&#41;</span><span style="">&#123;</span>
     return SA_ERROR_SYSTEM;
<span style="color: #440088;">@@ -637,7 +640,7 @@</span>
   if <span style="">&#40;</span>s == NULL || s-&gt;output_fd == -<span style="">1</span><span style="">&#41;</span> <span style="">&#123;</span>
     return SA_ERROR_NO_INIT;
   <span style="">&#125;</span>
<span style="color: #991111;">-#if SOUND_VERSION &gt;= OSS_VERSION<span style="">&#40;</span>4,0,0<span style="">&#41;</span></span>
<span style="color: #00b000;">+#if SOUND_VERSION &gt;= OSS_VERSION_<span style="">&#40;</span>4,0,0<span style="">&#41;</span></span>
   int mvol;
   if <span style="">&#40;</span>ioctl<span style="">&#40;</span>s-&gt;output_fd, SNDCTL_DSP_SETPLAYVOL, &amp;mvol<span style="">&#41;</span> &lt; <span style="">0</span><span style="">&#41;</span><span style="">&#123;</span>
     return SA_ERROR_SYSTEM;</pre></div></div>

<p>The following is a fork of my config_gapp script.  There are some tricky bits because I&#8217;ve left off some -L&#8217;s to avoid the NSS and NSPR libs that are installed in /usr/lib64.</p>
</pre>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">LOCAL_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$LOCAL_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #007800;">$PATH</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CPPFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$LOCAL_HOME</span>/include -I<span style="color: #007800;">$LOCAL_HOME</span>/include/nss -I/usr/X11R6/include <span style="color: #007800;">$CPPFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$LOCAL_HOME</span>/include -I<span style="color: #007800;">$LOCAL_HOME</span>/include/nss -I/usr/X11R6/include <span style="color: #007800;">$CFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CXXFLAGS</span>=<span style="color: #ff0000;">&quot;-I<span style="color: #007800;">$LOCAL_HOME</span>/include -I<span style="color: #007800;">$LOCAL_HOME</span>/include/nss  -I/usr/X11R6/include  <span style="color: #007800;">$CXXFLAGS</span>&quot;</span>
<span style="color: #666666; font-style: italic;">#export LDFLAGS=&quot;-L$LOCAL_HOME/lib -L/usr/lib64 -L/usr/X11R6/lib64 $LDFLAGS&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LDFLAGS</span>=<span style="color: #ff0000;">&quot;-L<span style="color: #007800;">$LOCAL_HOME</span>/lib -L/usr/X11R6/lib64 <span style="color: #007800;">$LDFLAGS</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PKG_CONFIG</span>=<span style="color: #007800;">$LOCAL_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>pkg-config
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PKG_CONFIG_PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$LOCAL_HOME</span>/lib/pkgconfig:/usr/lib64/pkgconfig:<span style="color: #007800;">$PKG_CONFIG_PATH</span>&quot;</span>
<span style="color: #666666; font-style: italic;">#export LD_LIBRARY_PATH=&quot;$LOCAL_HOME/lib:/usr/X11R6/lib64:/usr/lib64&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$LOCAL_HOME</span>/lib:/usr/X11R6/lib64&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MOZCONFIG</span>=..<span style="color: #000000; font-weight: bold;">/</span>mozconfig-firefox
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">-j</span> <span style="color: #000000;">4</span> <span style="color: #660033;">-f</span> client.mk build</pre></div></div>

<h2>Installing</h2>
<p>First you make a .tar.bz2, then you go install it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> package
<span style="color: #c20cb9; font-weight: bold;">cp</span> dist<span style="color: #000000; font-weight: bold;">/*</span>.tar.bz2 <span style="color: #000000; font-weight: bold;">/</span>somewhere
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>share
<span style="color: #c20cb9; font-weight: bold;">tar</span> xvfj <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>that<span style="color: #000000; font-weight: bold;">/*</span>.tar.bz2</pre></div></div>

<p>Now make a wrapper script $HOME/bin/firefox :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exec</span> run_gapp <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>firefox<span style="color: #000000; font-weight: bold;">/</span>firefox <span style="color: #ff0000;">&quot;$@&quot;</span></pre></div></div>

<h2>Errors</h2>
<p>Here are some of the error messages I encountered along the way that were solved w/ the prerequisites and patch.  Hopefully this helps future googlers.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>staticlib<span style="color: #000000; font-weight: bold;">/</span>components<span style="color: #000000; font-weight: bold;">/</span>libpipnss.a<span style="color: #7a0874; font-weight: bold;">&#40;</span>nsNSSCallbacks.o<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>.text+0x150a<span style="color: #7a0874; font-weight: bold;">&#41;</span>: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #000000; font-weight: bold;">`</span>RegisterMyOCSPAIAInfoCallback<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">':
: undefined reference to `CERT_RegisterAlternateOCSPAIAInfoCallBack'</span>
..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>staticlib<span style="color: #000000; font-weight: bold;">/</span>components<span style="color: #000000; font-weight: bold;">/</span>libpipnss.a<span style="color: #7a0874; font-weight: bold;">&#40;</span>nsNSSCallbacks.o<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>.text+0x154d<span style="color: #7a0874; font-weight: bold;">&#41;</span>: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #000000; font-weight: bold;">`</span>UnregisterMyOCSPAIAInfoCallback<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">':
: undefined reference to `CERT_RegisterAlternateOCSPAIAInfoCallBack'</span>
..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>staticlib<span style="color: #000000; font-weight: bold;">/</span>components<span style="color: #000000; font-weight: bold;">/</span>libpipnss.a<span style="color: #7a0874; font-weight: bold;">&#40;</span>nsNSSCallbacks.o<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>.text+0x2aa9<span style="color: #7a0874; font-weight: bold;">&#41;</span>: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #000000; font-weight: bold;">`</span>HandshakeCallback<span style="color: #7a0874; font-weight: bold;">&#40;</span>PRFileDesc<span style="color: #000000; font-weight: bold;">*</span>, void<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">':
: undefined reference to `SSL_HandshakeNegotiatedExtension'</span>
collect2: <span style="color: #c20cb9; font-weight: bold;">ld</span> returned <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">exit</span> status
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>libxul.so<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span>
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Leaving directory <span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mbaker<span style="color: #000000; font-weight: bold;">/</span>firefox-3.6.2<span style="color: #000000; font-weight: bold;">/</span>toolkit<span style="color: #000000; font-weight: bold;">/</span>library<span style="color: #ff0000;">'
make[3]: *** [libs_tier_toolkit] Error 2
make[3]: Leaving directory `/opt/local/mbaker/firefox-3.6.2'</span>
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>tier_toolkit<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">2</span>
<span style="color: #c20cb9; font-weight: bold;">make</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: Leaving directory <span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mbaker<span style="color: #000000; font-weight: bold;">/</span>firefox-3.6.2<span style="color: #ff0000;">'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/opt/local/mbaker/firefox-3.6.2'</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>build<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">2</span></pre></div></div>

<p>That one was solved by installing NSS and NSPR separately with the linux-from-scratch patches.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">error: system NSPR does not support PR_STATIC_ASSERT</pre></div></div>

<p>Look in config.log and then fix your permissions in $HOME/include/nss.  </p>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2010/04/06/ch0wned-building-your-own-firefox-on-el4-for-x86_64-in-your-homedir/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ch0wned &#8211; Building Amarok 1.4.10 in $HOME on Redhat EL4/EL5</title>
		<link>http://warped.org/blog/2010/04/05/ch0wned-building-amarok-1-4-10-in-home-on-redhat-el4/</link>
		<comments>http://warped.org/blog/2010/04/05/ch0wned-building-amarok-1-4-10-in-home-on-redhat-el4/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 00:49:40 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=94</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a linux user and don't have root access. Intro All I wanted to do was play Internet radio via a SOCKS proxy. Is that too much to ask for on Redhat EL4? Apparently so. So after many hours of frustration, here is how you get Amarok [...]]]></description>
			<content:encoded><![CDATA[<p><tt>ch0wned. adj. This is the state when you are a linux user and don't have root access. </tt></p>
<h1>Intro</h1>
<p>All I wanted to do was play Internet radio via a SOCKS proxy.  Is that too much to ask for on Redhat EL4?  Apparently so.  So after many hours of frustration, here is how you get Amarok 1.x (1.4.10 was the last one made) to compile and run from your homedir on Linux 2.ANCIENT.  </p>
<p>UPDATE 1/28/2011: Updated for EL5 too!</p>
<p>
This guide assumes you&#8217;re leaving off from my previous post : <a href="http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/">http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/</a>  where you&#8217;ve setup a script called config_gapp.
</p>
<h1>Prerequisites</h1>
<ul>
<li>amarok-1.4.10.tar.bz2</li>
<li>binutils-2.20.1.tar.bz2 (EL4 Only)</li>
<li>xine-lib-1.1.18.1.tar.bz2</li>
<li>taglib-1.6.1.tar.gz</li>
<li>ruby-devel package or ruby 1.8+ installed in $HOME</li>
<li>ffmpeg-0.5.1.tar.bz2</li>
<li>My Patches (EL4 or /dev/dsp1 only)</li>
</ul>
<h1>Building</h1>
<p>For taglib, ffmpeg, and binutils:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">config_gapp
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> taglib-1.6.1<span style="color: #000000; font-weight: bold;">/</span>taglib.pc ~<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>pkgconfig</pre></div></div>

<p>For xine-lib :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">config_gapp <span style="color: #660033;">--without-speex</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>For amarok:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">config_gapp</pre></div></div>

<p>Then apply this patch for EL4 only:</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;">diff -ru amarok-1.4.10/amarok/src/mediadevice/generic/genericmediadevice.cpp amarok-1.4.10-max/amarok/src/mediadevice/generic/genericmediadevice.cpp
<span style="color: #888822;">--- amarok-1.4.10/amarok/src/mediadevice/generic/genericmediadevice.cpp	2008-08-13 14:21:51.000000000 -0700</span>
<span style="color: #888822;">+++ amarok-1.4.10-max/amarok/src/mediadevice/generic/genericmediadevice.cpp	2010-04-05 16:21:11.000000000 -0700</span>
<span style="color: #440088;">@@ -557,7 +557,7 @@</span>
     args<span style="">&#91;</span>&quot;artist&quot;<span style="">&#93;</span> = artist;
     args<span style="">&#91;</span>&quot;albumartist&quot;<span style="">&#93;</span> = albumartist;
     args<span style="">&#91;</span>&quot;initial&quot;<span style="">&#93;</span> = albumartist.mid<span style="">&#40;</span> <span style="">0</span>, <span style="">1</span> <span style="">&#41;</span>.upper<span style="">&#40;</span><span style="">&#41;</span>;
<span style="color: #991111;">-    args<span style="">&#91;</span>&quot;filetype&quot;<span style="">&#93;</span> = mb.url<span style="">&#40;</span><span style="">&#41;</span>.pathOrURL<span style="">&#40;</span><span style="">&#41;</span>.section<span style="">&#40;</span> &quot;.&quot;, -<span style="">1</span> <span style="">&#41;</span>.lower<span style="">&#40;</span><span style="">&#41;</span>;</span>
<span style="color: #00b000;">+    args<span style="">&#91;</span>&quot;filetype&quot;<span style="">&#93;</span> = mb.url<span style="">&#40;</span><span style="">&#41;</span>.url<span style="">&#40;</span><span style="">&#41;</span>.section<span style="">&#40;</span> &quot;.&quot;, -<span style="">1</span> <span style="">&#41;</span>.lower<span style="">&#40;</span><span style="">&#41;</span>;</span>
     QString track;
     if <span style="">&#40;</span> mb.track<span style="">&#40;</span><span style="">&#41;</span> <span style="">&#41;</span>
         track.sprintf<span style="">&#40;</span> &quot;%02d&quot;, mb.track<span style="">&#40;</span><span style="">&#41;</span> <span style="">&#41;</span>;
<span style="color: #440088;">@@ -657,7 +657,7 @@</span>
&nbsp;
     if<span style="">&#40;</span> !kioCopyTrack<span style="">&#40;</span> bundle.url<span style="">&#40;</span><span style="">&#41;</span>, desturl <span style="">&#41;</span> <span style="">&#41;</span>
     <span style="">&#123;</span>
<span style="color: #991111;">-        debug<span style="">&#40;</span><span style="">&#41;</span> &lt; &lt; &quot;Failed to copy track: &quot; &lt;&lt; bundle.url<span style="">&#40;</span><span style="">&#41;</span>.pathOrURL<span style="">&#40;</span><span style="">&#41;</span> &lt;&lt; &quot; to &quot; &lt;&lt; desturl.pathOrURL<span style="">&#40;</span><span style="">&#41;</span> &lt;&lt; endl;</span>
<span style="color: #00b000;">+        debug<span style="">&#40;</span><span style="">&#41;</span> &lt;&lt; &quot;Failed to copy track: &quot; &lt;&lt; bundle.url<span style="">&#40;</span><span style="">&#41;</span>.url<span style="">&#40;</span><span style="">&#41;</span> &lt;&lt; &quot; to &quot; &lt;&lt; desturl.url<span style="">&#40;</span><span style="">&#41;</span> &lt;&lt; endl;</span>
         return <span style="">0</span>;
     <span style="">&#125;</span>
&nbsp;
<span style="color: #440088;">@@ -833,7 +833,7 @@</span>
 void
 GenericMediaDevice::dirListerClear<span style="">&#40;</span> const KURL &amp;url <span style="">&#41;</span>
 <span style="">&#123;</span>
<span style="color: #991111;">-    QString directory = url.pathOrURL<span style="">&#40;</span><span style="">&#41;</span>;</span>
<span style="color: #00b000;">+    QString directory = url.path<span style="">&#40;</span><span style="">&#41;</span>;</span>
     GenericMediaFile *vmf = m_mfm<span style="">&#91;</span>directory<span style="">&#93;</span>;
     if<span style="">&#40;</span> vmf <span style="">&#41;</span>
         vmf-&gt;deleteAll<span style="">&#40;</span> false <span style="">&#41;</span>;
<span style="color: #440088;">@@ -842,7 +842,7 @@</span>
 void
 GenericMediaDevice::dirListerDeleteItem<span style="">&#40;</span> KFileItem *fileitem <span style="">&#41;</span>
 <span style="">&#123;</span>
<span style="color: #991111;">-    QString filename = fileitem-&gt;url<span style="">&#40;</span><span style="">&#41;</span>.pathOrURL<span style="">&#40;</span><span style="">&#41;</span>;</span>
<span style="color: #00b000;">+    QString filename = fileitem-&gt;url<span style="">&#40;</span><span style="">&#41;</span>.path<span style="">&#40;</span><span style="">&#41;</span>;</span>
     GenericMediaFile *vmf = m_mfm<span style="">&#91;</span>filename<span style="">&#93;</span>;
     if<span style="">&#40;</span> vmf <span style="">&#41;</span>
         vmf-&gt;deleteAll<span style="">&#40;</span> true <span style="">&#41;</span>;
diff -ru amarok-1.4.10/amarok/src/plugin/plugin.h amarok-1.4.10-max/amarok/src/plugin/plugin.h
<span style="color: #888822;">--- amarok-1.4.10/amarok/src/plugin/plugin.h	2008-08-13 14:21:51.000000000 -0700</span>
<span style="color: #888822;">+++ amarok-1.4.10-max/amarok/src/plugin/plugin.h	2010-04-05 16:07:18.000000000 -0700</span>
<span style="color: #440088;">@@ -9,9 +9,11 @@</span>
&nbsp;
 #define AMAROK_EXPORT_PLUGIN<span style="">&#40;</span> classname <span style="">&#41;</span> \
     extern &quot;C&quot; <span style="">&#123;</span> \
<span style="color: #991111;">-          KDE_EXPORT Amarok::Plugin* create_plugin<span style="">&#40;</span><span style="">&#41;</span> <span style="">&#123;</span> return new classname; <span style="">&#125;</span> \</span>
<span style="color: #00b000;">+           __attribute__ <span style="">&#40;</span><span style="">&#40;</span>visibility<span style="">&#40;</span>&quot;default&quot;<span style="">&#41;</span><span style="">&#41;</span><span style="">&#41;</span> Amarok::Plugin* create_plugin<span style="">&#40;</span><span style="">&#41;</span> <span style="">&#123;</span> return new classname; <span style="">&#125;</span> \</span>
     <span style="">&#125;</span>
&nbsp;
<span style="color: #00b000;">+          //KDE_EXPORT Amarok::Plugin* create_plugin<span style="">&#40;</span><span style="">&#41;</span> <span style="">&#123;</span> return new classname; <span style="">&#125;</span> </span>
<span style="color: #00b000;">+</span>
 #include &lt;qmap .h&gt;
 #include &lt;qstring .h&gt;
&nbsp;
<span style="color: #888822;">--- amarok-1.4.10/amarok/src/amarokcore/amarokconfig.cpp	2010-04-05 17:19:09.000000000 -0700</span>
<span style="color: #888822;">+++ amarok-1.4.10-max/amarok/src/amarokcore/amarokconfig.cpp	2010-04-05 15:46:37.000000000 -0700</span>
<span style="color: #440088;">@@ -465,8 +465,8 @@</span>
   KConfigSkeleton::ItemBool  *itemMonitorChanges;
   itemMonitorChanges = new KConfigSkeleton::ItemBool<span style="">&#40;</span> currentGroup<span style="">&#40;</span><span style="">&#41;</span>, QString::fromLatin1<span style="">&#40;</span> &quot;Monitor Changes&quot; <span style="">&#41;</span>, mMonitorChanges, true <span style="">&#41;</span>;
   addItem<span style="">&#40;</span> itemMonitorChanges, QString::fromLatin1<span style="">&#40;</span> &quot;MonitorChanges&quot; <span style="">&#41;</span> <span style="">&#41;</span>;
<span style="color: #991111;">-  KConfigSkeleton::ItemPathList  *itemCollectionFolders;</span>
<span style="color: #991111;">-  itemCollectionFolders = new KConfigSkeleton::ItemPathList<span style="">&#40;</span> currentGroup<span style="">&#40;</span><span style="">&#41;</span>, QString::fromLatin1<span style="">&#40;</span> &quot;Collection Folders&quot; <span style="">&#41;</span>, mCollectionFolders <span style="">&#41;</span>;</span>
<span style="color: #00b000;">+  KConfigSkeleton::ItemString *itemCollectionFolders;</span>
<span style="color: #00b000;">+  itemCollectionFolders = new KConfigSkeleton::ItemString <span style="">&#40;</span> currentGroup<span style="">&#40;</span><span style="">&#41;</span>, QString::fromLatin1<span style="">&#40;</span> &quot;Collection Folders&quot; <span style="">&#41;</span>, mCollectionFolders <span style="">&#41;</span>;</span>
   addItem<span style="">&#40;</span> itemCollectionFolders, QString::fromLatin1<span style="">&#40;</span> &quot;CollectionFolders&quot; <span style="">&#41;</span> <span style="">&#41;</span>;
&nbsp;
   setCurrentGroup<span style="">&#40;</span> QString::fromLatin1<span style="">&#40;</span> &quot;MySql&quot; <span style="">&#41;</span> <span style="">&#41;</span>;
&nbsp;
<span style="color: #991111;">&lt;/qstring&gt;&lt;/qmap&gt;</span></pre></div></div>

<p>Then go ahead with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<h2>Using /dev/dsp1 in Amarok 1.4</h2>
<p>Let&#8217;s say you have an external soundcard or headphone amp plugged in USB and the thing registers as /dev/dsp1.  </p>
<p>You will need to modify xine-lib to handle this :</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;"><span style="color: #888822;">--- xine-lib-1.1.18.1/src/audio_out/audio_oss_out.c.orig        2011-01-28 14:52:17.000000000 -0800</span>
<span style="color: #888822;">+++ xine-lib-1.1.18.1/src/audio_out/audio_oss_out.c     2011-01-28 15:07:03.000000000 -0800</span>
<span style="color: #440088;">@@ -662,7 +662,7 @@</span>
  * If not, the function returns <span style="">0</span>.
  */
 static int probe_audio_devices<span style="">&#40;</span>oss_driver_t *this<span style="">&#41;</span> <span style="">&#123;</span>
<span style="color: #991111;">-  const char *base_names<span style="">&#91;</span><span style="">2</span><span style="">&#93;</span> = <span style="">&#123;</span>&quot;/dev/dsp&quot;, &quot;/dev/sound/dsp&quot;<span style="">&#125;</span>;</span>
<span style="color: #00b000;">+  const char *base_names<span style="">&#91;</span><span style="">2</span><span style="">&#93;</span> = <span style="">&#123;</span>&quot;/dev/dsp&quot;, &quot;/dev/dsp1&quot;<span style="">&#125;</span>;</span>
   int base_num, i;
   int audio_fd, rate;
   int best_rate;
<span style="color: #440088;">@@ -707,7 +707,7 @@</span>
   int              audio_fd;
   int              num_channels, status, arg;
   static char     *sync_methods<span style="">&#91;</span><span style="">&#93;</span> = <span style="">&#123;</span>&quot;auto&quot;, &quot;getodelay&quot;, &quot;getoptr&quot;, &quot;softsync&quot;, &quot;probebuffer&quot;, NULL<span style="">&#125;</span>;
<span style="color: #991111;">-  static char     *devname_opts<span style="">&#91;</span><span style="">&#93;</span> = <span style="">&#123;</span>&quot;auto&quot;, &quot;/dev/dsp&quot;, &quot;/dev/sound/dsp&quot;, NULL<span style="">&#125;</span>;</span>
<span style="color: #00b000;">+  static char     *devname_opts<span style="">&#91;</span><span style="">&#93;</span> = <span style="">&#123;</span>&quot;auto&quot;, &quot;/dev/dsp&quot;, &quot;/dev/dsp1&quot;, NULL<span style="">&#125;</span>;</span>
   int devname_val, devname_num;
   /* for usability reasons, keep this in sync with audio_alsa_out.c */
   static char     *speaker_arrangement<span style="">&#91;</span><span style="">&#93;</span> = <span style="">&#123;</span>&quot;Mono <span style="">1.0</span>&quot;, &quot;Stereo <span style="">2.0</span>&quot;, &quot;Headphones <span style="">2.0</span>&quot;, &quot;Stereo <span style="">2.1</span>&quot;,</pre></div></div>

<p>Then choose  Amarok &#8211; Engine &#8211; Xine &#8211; OSS Device Configuration &#8211; Device = /dev/sound/dsp1.  Enjoy.   If you did the above steps and then got to this step, you will need to &#8216;make clean&#8217; and &#8216;config_gapp&#8217; again in xinelib and amarok.</p>
<h2>Errors</h2>
<p>Here are some of the error messages I encountered along the way that were solved w/ the prerequisites and patch.  Hopefully this helps future googlers.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">ld</span>: .libs<span style="color: #000000; font-weight: bold;">/</span>xine.o: relocation R_X86_64_PC32 against <span style="color: #000000; font-weight: bold;">`</span>xine_event_send<span style="color: #ff0000;">' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value</span></pre></div></div>

<p>Needs a newer version of binutils that handles X86_64 better.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">amarokconfig.cpp: In constructor <span style="color: #000000; font-weight: bold;">`</span>AmarokConfig::AmarokConfig<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">':
amarokconfig.cpp:468: error: `ItemPathList'</span> is not a member of <span style="color: #000000; font-weight: bold;">`</span>KConfigSkeleton<span style="color: #ff0000;">'
amarokconfig.cpp:468: error: `itemCollectionFolders'</span> was not declared <span style="color: #000000; font-weight: bold;">in</span> this scope
amarokconfig.cpp:<span style="color: #000000;">469</span>: error: <span style="color: #000000; font-weight: bold;">`</span>class KConfigSkeleton::ItemPathList<span style="color: #ff0000;">' has not been declared</span></pre></div></div>

<p>This is due to the old version of KDE 3.3 on EL4.  Needs the patch above to amarokconfig.cpp.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">void-engine.cpp:<span style="color: #000000;">22</span>: error: visibility arg must be one of <span style="color: #ff0000;">&quot;default&quot;</span>, <span style="color: #ff0000;">&quot;hidden&quot;</span>, <span style="color: #ff0000;">&quot;protected&quot;</span> or <span style="color: #ff0000;">&quot;internal&quot;</span></pre></div></div>

<p>Again, some ancient KDE 3.3 bug that is fixed by the patch above.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">genericmediadevice.cpp: In member <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #000000; font-weight: bold;">`</span>QString GenericMediaDevice::buildDestination<span style="color: #7a0874; font-weight: bold;">&#40;</span>const QString<span style="color: #000000; font-weight: bold;">&amp;</span>, const MetaBundle<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">':
genericmediadevice.cpp:560: error: '</span>const class KURL<span style="color: #ff0000;">' has no member named '</span>pathOrURL<span style="color: #ff0000;">'
genericmediadevice.cpp: In member function `virtual MediaItem* GenericMediaDevice::copyTrackToDevice(const MetaBundle&amp;)'</span>:
genericmediadevice.cpp:<span style="color: #000000;">660</span>: error: <span style="color: #ff0000;">'const class KURL'</span> has no member named <span style="color: #ff0000;">'pathOrURL'</span>
genericmediadevice.cpp:<span style="color: #000000;">660</span>: error: <span style="color: #ff0000;">'const class KURL'</span> has no member named <span style="color: #ff0000;">'pathOrURL'</span>
genericmediadevice.cpp: In member <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #000000; font-weight: bold;">`</span>void GenericMediaDevice::dirListerClear<span style="color: #7a0874; font-weight: bold;">&#40;</span>const KURL<span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">':
genericmediadevice.cpp:836: error: '</span>const class KURL<span style="color: #ff0000;">' has no member named '</span>pathOrURL<span style="color: #ff0000;">'
genericmediadevice.cpp: In member function `void GenericMediaDevice::dirListerDeleteItem(KFileItem*)'</span>:
genericmediadevice.cpp:<span style="color: #000000;">845</span>: error: <span style="color: #ff0000;">'const class KURL'</span> has no member named <span style="color: #ff0000;">'pathOrURL'</span></pre></div></div>

<p>More ancient KDE 3.3 stuff &#8212; pathOrURL() doesn&#8217;t exist yet, so we use either url() or path().</p>
<p>
Last thing : doc/ was giving me issue, so I removed it from the Makefile under TOPSUBDIRS.</p>
<h1>Running</h1>
<p>I kept getting errors about &#8220;no sound-engine plugins found&#8221; until I added the two paths to $KDEDIRS as below :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">KDEDIRS</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>kde3:<span style="color: #007800;">$HOME</span>:<span style="color: #000000; font-weight: bold;">/</span>usr
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exec</span> run_gapp amarok <span style="color: #ff0000;">&quot;$@&quot;</span></pre></div></div>
</p>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2010/04/05/ch0wned-building-amarok-1-4-10-in-home-on-redhat-el4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ch0wned &#8211; Installing TaskCoach and all its depenencies in $HOME for EL4/EL5</title>
		<link>http://warped.org/blog/2010/04/02/ch0wned-installing-taskcoach-and-all-its-depenencies-in-home-for-el4/</link>
		<comments>http://warped.org/blog/2010/04/02/ch0wned-installing-taskcoach-and-all-its-depenencies-in-home-for-el4/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 21:48:37 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=96</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a linux user and don't have root access. Installing TaskCoach and its dependencies in $HOME for EL4/EL5 This guide assumes you&#8217;re leaving off from my previous post : http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/ where you&#8217;ve setup a script called config_gapp. Update: 2/1/2011 &#8211; Added EL5 . Irony : Spending a [...]]]></description>
			<content:encoded><![CDATA[<p><tt>ch0wned. adj. This is the state when you are a linux user and don't have root access. </tt></p>
<h1>Installing TaskCoach and its dependencies in $HOME for EL4/EL5</h1>
<p>This guide assumes you&#8217;re leaving off from my previous post : <a href="http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/">http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/</a>  where you&#8217;ve setup a script called config_gapp.</p>
<p>Update: 2/1/2011 &#8211; Added EL5 .  Irony : Spending a half-day trying to install an application that&#8217;s going to make you more productive.<br />
Update: 3/12/2012 &#8211; Latest Version and $HOME install of python 2.6</p>
<h2>Requirements</h2>
<ul>
<li>Python-2.6.7.tar.bz2 / python26
</li>
<li>wxPython-src-2.8.12.1.tar.bz2
</li>
<li>TaskCoach-1.3.9.tar.gz
</li>
</ul>
<h2>Directions</h2>
<ol>
<li>Python
<p>Install it like normal unless you have a modern distro that has a decent install of Python 2.5, in which case you will need to install the following things into $HOME.  Not sure how to do that in Python, so you might as well have your own local version.  If you have EL5, you may have the &#8216;python26&#8242; package installed in which you can use that and can skip this step.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">config_gapp \
   <span style="color: #660033;">--enable-shared</span> \
   <span style="color: #660033;">--enable-unicode</span>=ucs4
<span style="color: #c20cb9; font-weight: bold;">make</span> 
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

</li>
<li>wxWidgets (included w/ wxPython)<br />
EL4 Only : Install the following patch from <a href="http://groups.google.com/group/wxPython-users/browse_thread/thread/129ba27e2f868c3c?pli=1">This Thread</a> :</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;"><span style="color: #888822;">--- wxPython/src/gtk/_gdi_wrap.cpp.orig 2009-08-08 16:26:48.000000000 +0200</span>
<span style="color: #888822;">+++ wxPython/src/gtk/_gdi_wrap.cpp      2009-08-08 16:32:50.000000000 +0200</span>
<span style="color: #440088;">@@ -4195,6 +4195,10 @@</span>
     virtual wxGraphicsBrush CreateRadialGradientBrush<span style="">&#40;</span>wxDouble , wxDouble , wxDouble , wxDouble , wxDouble ,
                                                       const wxColour &amp;, const wxColour &amp;<span style="">&#41;</span>  <span style="">&#123;</span> return wxNullGraphicsBrush; <span style="">&#125;</span>
     virtual wxGraphicsFont CreateFont<span style="">&#40;</span> const wxFont &amp; , const wxColour &amp; <span style="">&#41;</span> <span style="">&#123;</span> return wxNullGraphicsFont; <span style="">&#125;</span>
<span style="color: #00b000;">+</span>
<span style="color: #00b000;">+    // patch required as explained in</span>
<span style="color: #00b000;">+    // http://groups.google.com/group/wxPython-users/browse_thread/thread/129ba27e2f<span style="color: #440088;">868c3</span>c?pli=1</span>
<span style="color: #00b000;">+    wxGraphicsBitmap CreateBitmap<span style="">&#40;</span> const wxBitmap &amp;bitmap <span style="">&#41;</span> const <span style="">&#123;</span> return wxNullGraphicsBitmap; <span style="">&#125;</span> </span>
 <span style="">&#125;</span>;</pre></div></div>

<p>For EL4  run :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">config_gapp <span style="color: #660033;">--enable-unicode</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> contrib<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>gizmos</pre></div></div>

<p>For EL5 using installed python26  run :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">config_gapp <span style="color: #660033;">--enable-unicode</span> <span style="color: #660033;">--enable-compat24</span> <span style="color: #660033;">--enable-compat26</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> contrib<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>gizmos <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>If you later get errors about &#8220;the library and executable don&#8217;t match&#8221;, you may need to tweak the &#8211;enable-compat* flags above till it works.
</li>
<li>wxPython

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> wxPython
<span style="color: #c20cb9; font-weight: bold;">vim</span> config.py
  BUILD_GLCANVAS = <span style="color: #000000;">0</span> <span style="color: #666666; font-style: italic;"># If true, build the contrib/glcanvas extension module</span>
  BUILD_OGL = <span style="color: #000000;">0</span>      <span style="color: #666666; font-style: italic;"># If true, build the contrib/ogl extension module</span>
  BUILD_STC = <span style="color: #000000;">0</span>      <span style="color: #666666; font-style: italic;"># If true, build the contrib/stc extension module</span>
  BUILD_GIZMOS = <span style="color: #000000;">1</span>   <span style="color: #666666; font-style: italic;"># Build a module for the gizmos contrib library</span>
<span style="color: #666666; font-style: italic;"># EL4 w/ self-installed python25</span>
run_gapp python2.5 setup.py build_ext
run_gapp python2.5 setup.py <span style="color: #c20cb9; font-weight: bold;">install</span>  <span style="color: #660033;">--home</span>=<span style="color: #007800;">$HOME</span>
<span style="color: #666666; font-style: italic;"># EL5 w/ system installed python26</span>
<span style="color: #666666; font-style: italic;"># python26 setup.py build_ext</span>
<span style="color: #666666; font-style: italic;"># python26 setup.py install --home=$HOME</span>
<span style="color: #666666; font-style: italic;"># EL5 w/ self-installed python26</span>
run_gapp python2.6 setup.py build_ext
run_gapp python2.6 setup.py <span style="color: #c20cb9; font-weight: bold;">install</span>  <span style="color: #660033;">--home</span>=<span style="color: #007800;">$HOME</span></pre></div></div>

</li>
<li>TaskCoach Install

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># EL4  w/ self-install python:</span>
<span style="color: #666666; font-style: italic;">#run_gapp python2.5 setup.py build</span>
<span style="color: #666666; font-style: italic;">#run_gapp python2.5 setup.py install</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># For system installed python26 I needed to specify the above installed libraries in my $PYTHONPATH :</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PYTHONPATH</span>=<span style="color: #007800;">$LIB</span><span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>python:<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>wx-<span style="color: #000000;">2.8</span>-gtk2-unicode<span style="color: #000000; font-weight: bold;">/</span>wxPython:<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>wx-<span style="color: #000000;">2.8</span>-gtk2-unicode<span style="color: #000000; font-weight: bold;">/</span>wx:<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>wx-<span style="color: #000000;">2.8</span>-gtk2-unicode
&nbsp;
<span style="color: #666666; font-style: italic;"># EL5  w/ self-install python:</span>
run_gapp python2.6 setup.py build
run_gapp python2.6 setup.py <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--home</span>=<span style="color: #007800;">$HOME</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EL5 w/ system python26</span>
<span style="color: #666666; font-style: italic;">#python26 setup.py build</span>
<span style="color: #666666; font-style: italic;">#python26 setup.py install --home=$HOME</span></pre></div></div>

</li>
<li>TaskCoach Wrapper Script

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># EL4 / EL5 w/ self-install python2.5</span>
run_gapp <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>taskcoach.py
&nbsp;
<span style="color: #666666; font-style: italic;"># EL5 w/ system python26</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PYTHONPATH</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>python:<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>python
python26 <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>taskcoach.py
&nbsp;
<span style="color: #666666; font-style: italic;"># EL5 w/ self python</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PYTHONPATH</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>python:<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>python
python2.6 <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>taskcoach.py</pre></div></div>

</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2010/04/02/ch0wned-installing-taskcoach-and-all-its-depenencies-in-home-for-el4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spam / Ham Learning folders for VirtualMin / Maildir-based systems</title>
		<link>http://warped.org/blog/2009/12/17/spam-ham-learning-folders-for-virtualmin-maildir-based-systems/</link>
		<comments>http://warped.org/blog/2009/12/17/spam-ham-learning-folders-for-virtualmin-maildir-based-systems/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 19:56:51 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=88</guid>
		<description><![CDATA[I&#8217;ve created a simple script that will monitor folders called &#8216;ham&#8217; and &#8216;spam&#8217; for new entries. Once found, the &#8216;ham&#8217; folder will send the message to sa-learn --ham, strip off the headers, and return it to the inbox. The spam folder will simply run sa-learn --spam on the message. Any additions are welcome! Download : [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a simple script that will monitor folders called &#8216;ham&#8217; and &#8216;spam&#8217; for new entries.   Once found, the &#8216;ham&#8217; folder will send the message to <tt>sa-learn --ham</tt>, strip off the headers, and return it to the inbox.   The spam folder will simply run <tt>sa-learn --spam</tt> on the message.</p>
<p>Any additions are welcome!<br />
<a href='http://warped.org/linux/spam_folders' >Download : spam_folders script</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl -w</span>
<span style="color: #666666; font-style: italic;"># spam_folder - Turns the 'ham' and 'spam' folders </span>
<span style="color: #666666; font-style: italic;">#               into training folders for spam assassin</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># For VirtualMin</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Max Baker &lt;max @warped.org&gt; 12/17/09</span>
<span style="color: #666666; font-style: italic;"># No license retained, distribute and modify freely</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> File<span style="color: #339933;">::</span><span style="color: #006600;">Glob</span> <span style="color: #009966; font-style: italic;">qw/bsd_glob/</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> File<span style="color: #339933;">::</span><span style="color: #006600;">Temp</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> File<span style="color: #339933;">::</span><span style="color: #006600;">Copy</span> <span style="color: #009966; font-style: italic;">qw/copy/</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Config</span>
<span style="color: #0000ff;">$sa_learn</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'/usr/bin/sa-learn'</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sa</span>       <span style="color: #339933;">=</span> <span style="color: #ff0000;">'/usr/bin/spamassassin'</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">@spam</span>  <span style="color: #339933;">=</span> bsd_glob<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/home/*/homes/*/Maildir/.spam/cur/*&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">@ham</span>   <span style="color: #339933;">=</span> bsd_glob<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/home/*/homes/*/Maildir/.ham/cur/*&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Mark everything in spam folder that's not already marked as spam</span>
<span style="color: #666666; font-style: italic;">#  (trust spamassassin header)</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$s</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@spam</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">next</span> <span style="color: #b1b100;">if</span> is_marked<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$s</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;$sa_learn --spam <span style="color: #000099; font-weight: bold;">\&quot;</span>$s<span style="color: #000099; font-weight: bold;">\&quot;</span> &gt; /dev/null&quot;</span><span style="color: #009900;">&#41;</span> 
        <span style="color: #b1b100;">and</span> <span style="color: #000066;">warn</span> <span style="color: #ff0000;">&quot;sa-learn errored on $s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Mark everything in ham folder as ham, strip off junk and move into</span>
<span style="color: #666666; font-style: italic;"># inbox</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$h</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@ham</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;"># Strip off headers</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$tmp</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> File<span style="color: #339933;">::</span><span style="color: #006600;">Temp</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$tmp_file</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$tmp</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">filename</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;$sa -d <span style="color: #000099; font-weight: bold;">\&quot;</span>$h<span style="color: #000099; font-weight: bold;">\&quot;</span> &gt; $tmp_file&quot;</span><span style="color: #009900;">&#41;</span> 
        <span style="color: #b1b100;">and</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;$sa errored on $h<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Unmark as spam</span>
    <span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;$sa_learn --ham $tmp_file &gt; /dev/null&quot;</span><span style="color: #009900;">&#41;</span> 
        <span style="color: #b1b100;">and</span> <span style="color: #000066;">warn</span> <span style="color: #ff0000;">&quot;$sa_learn errored on $tmp_file<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Remove from ham</span>
    <span style="color: #000066;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$h</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Can't remove $h. $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Move to inbox</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$new_h</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$h</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$new_h</span> <span style="color: #339933;">=~</span> <span style="color: #000066;">s</span><span style="color: #339933;">,</span>Maildir<span style="color: #339933;">/.</span><span style="color: #0000ff;">*cur</span><span style="color: #339933;">/,</span>Maildir<span style="color: #339933;">/</span>cur<span style="color: #339933;">/,;</span>
    copy<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$tmp_file</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$new_h</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Can't move message to inbox. $tmpfile -&gt; $new_h.  $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># is_marked() - Looks to see if spam assassin has already tagged this,</span>
<span style="color: #000000; font-weight: bold;">sub</span> is_marked <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$s</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">open</span> <span style="color: #009900;">&#40;</span>S<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&lt; $s&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">return</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$is</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009999;">&lt;S&gt;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^X-Spam-Flag: YES/i</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">$is</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">last</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066;">close</span> S<span style="color: #339933;">;</span>
    <span style="color: #000066;">return</span> <span style="color: #0000ff;">$is</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>max<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2009/12/17/spam-ham-learning-folders-for-virtualmin-maildir-based-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

