<?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 &#187; chown3d</title>
	<atom:link href="http://warped.org/blog/tag/chown3d/feed/" rel="self" type="application/rss+xml" />
	<link>http://warped.org/blog</link>
	<description>Max Baker -- A Man with a Hand</description>
	<lastBuildDate>Mon, 10 May 2010 03:26:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>chown3d Part 2 &#8211; GTK+ and GLIB in your own home directory</title>
		<link>http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/</link>
		<comments>http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 19:44:16 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[chown3d]]></category>
		<category><![CDATA[glib]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=34</guid>
		<description><![CDATA[ch0wned. adj. This is the state when you are a linux user and don't have root access. 
For today&#8217;s installment we go over getting some basic libraries up to shape.   If your Linux distro is old enough, you can&#8217;t use 3rd party binaries like Adobe Acrobat Reader (acroread), Firefox, and Flash because the [...]]]></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>
<p>For today&#8217;s installment we go over getting some basic libraries up to shape.   If your Linux distro is old enough, you can&#8217;t use 3rd party binaries like Adobe Acrobat Reader (acroread), Firefox, and Flash because the GTI+ and GLIB libraries that they are compiled against are just too damned old.   So we have to both install local copies, and have the applications find those copies instead of the system ones. </p>
<h2>On Versions</h2>
<p>It&#8217;s good to note that you can upgrade a <i>newer</i> version of most things, but don&#8217;t expect to always get the <i>newest</i> version.  Instead you need to find the next newest version that still works on your old Linux distro while satisfying the prerequisites for your favorite applications.</p>
<h2>GTK+ and GLIB and RHEL4</h2>
<p>Here are the packages I installed in order to get GTK+ and GLIB up to date enough to use Firefox, Pidgin, Thunderbird, Acrobat, and some other goodies on Red Hat EL4 (Fedora 4 should be similar) :</p>
<ol>
<li>atk-1.25.2.tar.bz2 &#8211; Needed by Pidgin
</li>
<li>pixman-0.13.2.tar.gz
</li>
<li>libxml2-2.6.30.tar.bz2 &#8211; Needed by Pidgin, the EL4 version is horribly broken and Gtalk / Jabber end up w/ a very weird send-only behavior
</li>
<li>pkg-config-0.23.tar.gz &#8211; Needed by most everything.  You will have a new package repository in $HOME/lib/pkg-config for your new libraries.
</li>
<li>cairo-1.8.6.tar.gz
</li>
<li>dbus-1.2.12.tar.gz
</li>
<li>dbus-glib-0.78.tar.gz
</li>
<li>glib-2.19.5.tar.bz2
</li>
<li>pango-1.22.4.tar.bz2
</li>
<li>zlib-1.2.3.tar.bz2 &#8211; RHEL4 version is crap.
</li>
<li>gtk+-2.14.7.tar.bz2
</li>
</ol>
<p>Order does count, but I don&#8217;t remember what order I compiled and installed these in.  Trial and error will tell.  Use <a HREF="http://warped.org/blog/2009/03/04/chown3d-a-linux-distro-in-your-home-directory/">config_gapp from Part 1</a> to compile.</p>
<p> You will need to do this on each of the above :</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 gtk+-2.14.7.tar.bz2
$ <span style="color: #7a0874; font-weight: bold;">cd</span> gtk+-2.14.7
$ ..<span style="color: #000000; font-weight: bold;">/</span>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>Remember this is installing these libraries into $HOME/lib using the config_gapp script. </p>
<p>Some of the libraries might take some extra args to make things happy.</p>
<ol>
<li>zlib &#8211; I need to add -fPIC to make mozilla happy

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #007800;">CFLAGS</span>=-fPIC ..<span style="color: #000000; font-weight: bold;">/</span>config_gapp</pre></div></div>

</li>
<li>gtk+-2.14.7 &#8211; I had to add &#8211;without-libjasper
<pre lang=bash>$ ../config_gapp --without-libjasper</pre>
</li>
</ol>
<p>Some blood sweat and tears later, and now you should be able to run a binary version of Firefox if you are on a 32-bit RHEL4 machine. </p>
<h2>Running Apps using the Libraries in your Home Directory</h2>
<p>In order to have applications grab the libraries in your home directory instead of the system ones, I use a wrapper script that sets up a bunch of needed environment variables.  I call this script &#8220;run_gapp&#8221; :</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>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install apps using local versions of libraries for this platform</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This script is for an x86_64 machine</span>
<span style="color: #666666; font-style: italic;"># Remove 64 anywhere below if you are on a 32-bit build</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>me
&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;">${LOC_HOME}</span>/include -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;">${LOC_HOME}</span>/include -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;">${LOC_HOME}</span>/include -I/usr/X11R6/include <span style="color: #007800;">$CXXFLAGS</span>&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;">${LOC_HOME}</span>/lib -L/usr/X11R6/lib -L/usr/lib64 <span style="color: #007800;">$LDFLAGS</span>&quot;</span>
<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;">${LOC_HOME}</span>/lib/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/pkgconfig:<span style="color: #007800;">$PKG_CONFIG_PATH</span>&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;">${LOC_HOME}</span>/lib:/usr/X11R6/lib64:/usr/lib64:<span style="color: #007800;">$LD_LIBRARY_PATH</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #ff0000;">&quot;$@&quot;</span></pre></div></div>

<p>Now to run a binary we just use the wrapper</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">run_gapp <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>firefox</pre></div></div>

<p>Next up we&#8217;ll explore building some applications like pidign, firefox, amarok, xine-lib and more.</p>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>chown3d &#8211; A Linux distro in your home directory</title>
		<link>http://warped.org/blog/2009/03/04/chown3d-a-linux-distro-in-your-home-directory/</link>
		<comments>http://warped.org/blog/2009/03/04/chown3d-a-linux-distro-in-your-home-directory/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 19:18:55 +0000</pubDate>
		<dc:creator>max</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[chown3d]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://warped.org/blog/?p=29</guid>
		<description><![CDATA[I&#8217;m coining a new term here : chown3d (or ch0wn3d depending on how l33t you are).    
ch0wned. adj. This is the state when you are a linux user and don't have root access. 
This is the case for a lot of people working Corporate jobs as engineers, including me.   I realized chr00ted is a more appropriate [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m coining a new term here : <b>chown3d</b> (or ch0wn3d depending on how l33t you are).    </p>
<p><tt>ch0wned. adj. This is the state when you are a linux user and don't have root access. </tt></p>
<p>This is the case for a lot of people working Corporate jobs as engineers, including me.   I realized chr00ted is a more appropriate term, but then I couldn&#8217;t work 0wned into it.</p>
<p>So this post is the first in a serious of HOWTOs about maintaining a Linux distro out of your home directory.  This allows you to download, compile, and use the latest software while being restricted to god-awful old version of Linux.   When I say old, I&#8217;m talking about my company just &#8220;upgraded&#8221; me from Red Hat Enterprise 3 (RHEL 3), circa 2003 to Red Hat Enterprise 4 (RHEL 4) circa 2006.   If I want to use a browser or e-mail client that has the latest security patches, forget it!</p>
<h2>Compiling</h2>
<p>About 90% of the open source apps out there use autoconf to setup compilation using gmake.   The first thing we need to do is tell it that we are going to install this directory into our home directory.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>me</pre></div></div>

<p>However, if you happen to have a lot of dependency libraries installed in your home directory we will need to setup a few environment variables too.   So instead I setup a shell script that sets-up the environment and calls configure.   I call this script &#8220;config_gapp&#8221;</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>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install apps using local versions of glib</span>
<span style="color: #666666; font-style: italic;"># into home directory</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This version setup for x86_64 full 64-bit</span>
<span style="color: #666666; font-style: italic;"># Remove &quot;64&quot; anywhere below for a 32-bit build.</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>me
&nbsp;
<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: #666666; font-style: italic;"># I try not to maintain my own gcc, but sometimes you gotta :</span>
<span style="color: #666666; font-style: italic;"># export CC=&quot;$LOCAL_HOME/bin/gcc&quot;</span>
<span style="color: #666666; font-style: italic;"># export GCC=$CC</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/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/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/usr/X11R6/include  <span style="color: #007800;">$CXXFLAGS</span>&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/lib64 -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: #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:/usr/lib64&quot;</span>
<span style="color: #666666; font-style: italic;">#export ACLOCAL_FLAGS=&quot;-I /home/maxb/share/aclocal&quot;</span>
&nbsp;
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$LOCAL_HOME</span> \
  <span style="color: #660033;">--x-includes</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>X11R6<span style="color: #000000; font-weight: bold;">/</span>include \
  <span style="color: #660033;">--x-libraries</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>X11R6<span style="color: #000000; font-weight: bold;">/</span>lib <span style="color: #ff0000;">&quot;$@&quot;</span></pre></div></div>

<p>The astute reader will notice that I have already compiled and installed my own copy of pkg-config because the one on EL4 is too old for most things to use.   I&#8217;ll cover that in the next post where I go over getting a somewhat modern version of the GTK+ and Glib libraries installed.  These are required for most anything modern like firefox, thunderbird, acrobat, and flash.</p>
]]></content:encoded>
			<wfw:commentRss>http://warped.org/blog/2009/03/04/chown3d-a-linux-distro-in-your-home-directory/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
