Making the Tidy moduleSubmitted by mtesauro on Sun, 04/26/2009 - 00:16 |
Get the source for Tidy
Go to the website for Tidy and you'll see a link to the CVS. Probably the easiest way to get the source is to check it out from CVS with the following commands: (you can just hit enter for the password)
cvs -d:pserver:anonymous@tidy.cvs.sourceforge.net:/cvsroot/tidy login
cvs -z3 -d:pserver:anonymous@tidy.cvs.sourceforge.net:/cvsroot/tidy co -P tidy
At the time of this writing, the Tidy site mentions MD5 sums to verify packages but I couldn't find them. Grr - bad project! Luckily there isn't that much source for the project and its fairly safe pulling directly from the CVS repository.
Compile the source
Since we're doing this from source, its best to download the source into a running version of the Live CD. We can then do the compilation there to make sure the Live CD has all the necessary dependencies.
First get the source into the Live CD. Once you've got the Live CD running, scp them over from your primary box and then extract both files in the same directory
# mkdir build
# cd build
# scp matt@matt-box.example.com:/home/matt/download/tidy* ./
Now we have all the necessary source to compile the program. Regrettably there isn't the usual stuff for a "./configure && make && make install" but no problem. Its still doable as they provide the necessary stuff to make the project with gmake:
# cd build/tidy/build/gmake
# SUPPORT_UTF16_ENCODINGS=1 gmake
That worked like a charm for me and now I've got the binaries and libtidy library created. Since there isn't an install script, it actually makes our lives a bit easier. We can go directly to a SLAX module. First we'll need to create a few directories:
# cd /root
# mkdir -p fakeroot/usr/bin
# mkdir -p fakeroot/usr/local/lib
Then move the necessary binaries and library file over to the fakeroot directory tree:
# cp build/tidy/bin/tidy fakeroot/usr/bin/
# cp build/tidy/bin/tab2space fakeroot/usr/bin/
# cp build/tidy/lib/libtidy.a fakeroot/usr/local/lib/<pre>
=== Create a module from the fakeroot directory tree ===
This is the easy part.
<pre> # dir2lzm fakeroot tidy-144.lzm
Test the new modules
SLAX will allow you to add modules to a running system. Before going on, you should install the module and make sure it works like expected. Check out the page Add modules to a running system [PAGE NOT MADE] to see how to do this. To fully test this use a freshly booted Live CD to test the module. Verify that subversion works as expected:
# tidy --version
If everything goes as expected, you'll need to add this module to the ISO image. Since we've created the module in the Live CD, you'll need to move it off to a "real" computer. The module will be in the same directory if you've followed the above instructions. You can use a USB drive, scp or whatever to get the files off the Live CD.
Add the modules to the ISO build directory
Also cake
$ cp -i tidy-144.lzm ../contents/slax/base/
$ chmod 775 ../contents/slax/base/tidy-144.lzm
This assumes your tidy module was moved into your working directory. See Creating the base Live CD from SLAX (Create a Working Directory section)
Clean up and archive
Once you've got a working module, lets clean up a bit.
$ $ mkdir ./completed_modules/tidy
$ mv tidy-144.lzm ./completed_modules/tidy/
$ cd temp
$ tar -cjvf ../completed_modules/tidy/tidy-from-cvs-2008-10-20.tar.bz tidy
$ cd ..
$ rm -rf ./temp/*
