<?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>Spice World! &#187; Linux</title>
	<atom:link href="http://www.cyberspice.org.uk/blog/category/geek/open-source/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyberspice.org.uk/blog</link>
	<description>The life and times of a jet setting software engineer!</description>
	<lastBuildDate>Fri, 23 Jul 2010 10:25:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>T&#8217;info about Dash</title>
		<link>http://www.cyberspice.org.uk/blog/2009/12/24/tinfo-about-dash/</link>
		<comments>http://www.cyberspice.org.uk/blog/2009/12/24/tinfo-about-dash/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 12:45:15 +0000</pubDate>
		<dc:creator>cyberspice</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[dash]]></category>
		<category><![CDATA[libncurses]]></category>
		<category><![CDATA[libtinfo]]></category>
		<category><![CDATA[sh]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.cyberspice.org.uk/blog/?p=404</guid>
		<description><![CDATA[Once upon a time there was the Bourne command shell.  sh as it is known is core at the heart of any UNIXy type operating system and others too.  However for some it didn&#8217;t do enough so the Bourne Again shell, bash, was written and nearly every system ships with that.  These [...]]]></description>
			<content:encoded><![CDATA[<p>Once upon a time there was the Bourne command shell.  <strong>sh</strong> as it is known is core at the heart of any UNIXy type operating system and others too.  However for some it didn&#8217;t do enough so the Bourne Again shell, <strong>bash</strong>, was written and nearly every system ships with that.  These shells are not the same.  The have similar syntax but do not behave similarly.</p>
<p>There are other shells which have a completely different syntax and other scripting languages such as Perl and PHP so when writing a shell script you can indicate the correct interpreter using the <em>&#8216;hash bang bin bash&#8217;</em> comment to indicate you are using <strong>bash</strong>.  I.e.</p>
<pre>
#!/bin/bash
</pre>
<p>Some lazy programmers don&#8217;t indicate the exact shell they require and use </p>
<pre>
#!/bin/sh
</pre>
<p>to mean <strong>bash</strong> when it means <strong>sh</strong>.</p>
<p>Ubuntu, in their wisdom, have decided to go for <strong>dash</strong> as their shell.  It is an evolution of the Almquist shell and is smaller and lighter weight than <strong>bash</strong> however they install <strong>bash</strong> anyway.  <strong>dash</strong> and <strong>bash</strong> have the common subset of <strong>sh</strong> commands but are different.  So if you find you have a problem building or similar on Ubuntu it may be that the wrong shell is being used.  Ubuntu has a symlink as follows:</p>
<pre>
lrwxrwxrwx 1 root root       4 Mar 29  2009 sh -> dash
</pre>
<p>You may need to change this to point to dash as follows:</p>
<pre>
$ cd /bin
$ sudo rm sh
$ sudo ln -s bash sh
</pre>
<p>While we&#8217;re handling Ubuntu oddities building against NCurses, the terminal output library, can also be problematical.  A little while ago NCurses was split in to two libraries, <em>libncurses.so</em> and <em>libtinfo.so</em>.  Some badly written software will try and link explicitly with <em>libtinfo.so</em> directly rather than trying <em>libncurses.so</em> first.  Ubuntu does not split these two libraries but provides just the one <em>libncurses.so</em> library so if you have an issue with a missing <em>libtinfo.so</em> you will need to add symlinks in to your library directory as follows:</p>
<pre>
$ cd /usr/lib
$ ln -s libncurses.so.5 libtinfo.so.5
$ ln -s libtinfo.so.5 libtinfo.so
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberspice.org.uk/blog/2009/12/24/tinfo-about-dash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building PHP C extensions on Ubuntu 9.10</title>
		<link>http://www.cyberspice.org.uk/blog/2009/12/01/building-php-c-extensions-on-ubuntu-9-10/</link>
		<comments>http://www.cyberspice.org.uk/blog/2009/12/01/building-php-c-extensions-on-ubuntu-9-10/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 13:58:28 +0000</pubDate>
		<dc:creator>cyberspice</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.cyberspice.org.uk/blog/?p=395</guid>
		<description><![CDATA[I have just taken over maintenance of the PECL Direct IO extension as it has been unmaintained for a while.  Naturally the first thing I did before writing any new code was to check out the extension from SVN and try and build it.  Building the source was fine but when I tried [...]]]></description>
			<content:encoded><![CDATA[<p>I have just taken over maintenance of the PECL Direct IO extension as it has been unmaintained for a while.  Naturally the first thing I did before writing any new code was to check out the extension from SVN and try and build it.  Building the source was fine but when I tried <em>make test</em> it failed producing output like the following:</p>
<pre>
PHP Warning:  PHP Startup: Unable to load dynamic library 'modules/gd.so' -
modules/gd.so: cannot open shared object file: No such file or
directory in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' -
modules/gd.so: cannot open shared object file: No such file or
directory in Unknown on line 0
</pre>
<p>The default PHP package on Ubuntu 9.10 is fairly minimalist.  Most extensions are provided as separate packages which include an INI file and a dynamic library.  The dynamic library is stored in:</p>
<pre>
/usr/lib/php5/20060613+lfs
</pre>
<p>And the INI file for each extension is in: </p>
<pre>
/etc/php5/conf.d.
</pre>
<p>The <em>make tests</em> rule in the generated Makefile in the extension you are compiling modifies the path that PHP searches for extensions by to point to the modules directory within the extension source.  So PHP, which is used to run the tests, cannot find the extensions.</p>
<p>I&#8217;ve found the easiest way (if slightly hacky) to fix the <em>make test</em> failure is just to copy the .so files from the PHP5 extension directory in to the modules directory within the extension source.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberspice.org.uk/blog/2009/12/01/building-php-c-extensions-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
