The Cube - Assimilating Technology

The Cube

Adding GhostScript to thinstation

For Humans only


Adding GhostScript to thinstation Print E-mail
Thursday, 03 January 2008 07:51

This article explains how I Installed ghostscript onto a thinstation 2.2 build, to be used in conjunction with my cups install.

It is really a continuation of my cups install how-to , but I don't see why it could not be used as a standalone guide, for when you need ghostscript for other reasons than using it with cups. If cups is not installed, you will have to adjust the setup.sh file and remove the '--with-cups' option.

So lets start.

 

The first step was to get the thinstation 2.2 compile environment setup.

I already have this done, as I had previously built and added 'saned' to my thinstation, but for completeness, I will include the instructions again.

I use my gentoo based laptop to do the build.

All the work is done under my home folder on the laptop :

cd /home/<username> 
mkdir thinstation-compile
cd thinstation-compile

I use thinstation 2.2, so I get the appropriate source tree:

wget http://optusnet.dl.sourceforge.net/sourceforge/thinstation/thinstation_src-2.2.tar.bz2

Unpack it and cd into the unpacked folder

tar xvf ./thinstation_src-2.2.tar.bz2 
cd thinstation_src-2.2

Inside the unpacked folder is a source folder (called source)
This is where Thinstation stores the source for packages
cd into this folder

cd source

You are now in the folder where all the real work to build ghostscript will be done.

Download the ghostscript sources.  At the time of writing this guide 8.61 was the latest download

wget   http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs861/ghostscript-8.61.tar.bz2 

unpack it, cd into the ghostcript folder

tar xvf ghostscript-8.61.tar.bz2
cd  ghostscript-8.61

You need a setup script. I used the one from my previous cups install.

cp ../cups-1.3.5/setup.sh ./

edit the file using your favourite editor ( i like joe )

joe ./setup.sh 

Make it look like this:

THINSTATION_PATH=`cat ../../THINSTATION_PATH`

. ../SET_ENV

./configure --prefix=/ --bindir=/bin --sbindir=/bin --libexecdir=/lib --sysconfdir=/etc \
--enable-debug --disable-gtk --without-ijs --without-jbig2dec --without-jasper \
--without-omni --without-x --with-cups
make clean
make

make the file executable

chmod +x ./setup.sh

Enter the thinstation build environment (DON'T FORGET TO DO THIS!)

cd ../../
./RUNME

cd back into the source/ghostscript-8.61 folder and run the setup.sh file

cd ./source/ghostscript-8.61
./setup.sh

Sit back, and pray the compile works.
After the compile install it.

make install

exit the compile environment

exit

Thats it for the compile/build bit, next you will create the thinstation package
cd into where you have the thinstation package build setup.
mine is located in my home folder under the a folder called Thinstation-2.2

cd /home/<username>/Thinstation-2.2/packages

Create a ghostscript packages folder by copying the template

cp -xav ./template ./ghostscript

cd into the new folder

cd ghostscript

Now you must copy all the required files (those that you have just built) into this folder, thus creating the thinstation package.

I have created a script that does all this for you. You can download it here.
For those who cannot download the file, here it is:
You must place this file into the ghostscript package folder, and pass it the path to where your thinstation compile folder is (don't include the /source/ folder in the path given)

#!/bin/bash

echo "have $1"

if [ -n "$1" ];
then
        COMPILEFOLDER=$1
else
        echo "please call with path to your Thinstation compile folder"
        exit 1;
fi

rm -rf ./bin/*
cp -xav ${COMPILEFOLDER}/bin/gs* ./bin/
cp -xav ${COMPILEFOLDER}/bin/{bdftops,dumphint,dvipdf,eps2eps,font2c} ./bin/
cp -xav ${COMPILEFOLDER}/bin/{pdf2dsc,pdf2ps,pdfopt,pf2afm,pfbtopfa} ./bin/
cp -xav ${COMPILEFOLDER}/bin/{printafm,ps2ascii,ps2epsi,ps2pdf,ps2pdf12} ./bin/
cp -xav ${COMPILEFOLDER}/bin/{ps2pdf13,ps2pdf14,ps2pdfwr,ps2ps,ps2ps2} ./bin/
cp -xav ${COMPILEFOLDER}/bin/{wftopfa,fixmswrd.pl,lprsetup.sh,pv.sh,unix-lpr.sh} ./bin/

mkdir -p ./share/ghostscript/8.61/
cp -xav ${COMPILEFOLDER}/share/ghostscript/8.61/* ./share/ghostscript/8.61/

mkdir -p ./lib/cups/filter
cp -xav ${COMPILEFOLDER}/source/ghostscript-8.61/cups/{pstoraster,pstopxl} ./lib/cups/filter/

mkdir -p ./etc/cups
cp -xav ${COMPILEFOLDER}/source/ghostscript-8.61/cups/pstoraster.convs ./etc/cups/

mkdir -p ./share/cups/model
cp -xav ${COMPILEFOLDER}/source/ghostscript-8.61/cups/{pxlcolor.ppd,pxlmono.ppd} ./share/cups/model/

rm ./etc/console/README
touch ./etc/console/ghostscript
echo 'CMD_GLOBAL=""' >./etc/cmd/ghostscript.global

echo "done"

After you ran the file above all the required package files will be copied to your package folder.

There are no init scripts required for this install, so remove the defaults

rm ./etc/init.d/your_start_up_script 
rm ./etc/rc5.d/S10this_is_a_symlink_to_start_up_script

fix the dependencies file (the commented line gives a warning when doing the build)

sed -i 's/^\#\(.*\)//' ./dependencies 

add ghostscript to the build config file

cd ../../
echo "package ghostscript # ghostscript binary " >> ./build.conf

ok, that should be it. Rebuild your boot image.

./build

 

After the rebuild, reboot from your new image (I use pxe network boot, so I copied the new boot image to my bootp server)
scp ./boot-images/pxe/initrd root@10.0.0.3:/tftpboot/ 

and reboot the thinstation to load the new image.
Once rebooted test the install via the command line.
Either telnet into the thinstation, or use the local thinstation console (CTRL+ALT+F2)

try and run the ghostscript binary (it is simply called 'gs')

ts_lounge:~# gs
GPL Ghostscript 8.61 (2007-11-21)
Copyright (C) 2007 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>

Great, ghostscript runs fine. Type quit to exit.

Thats it, you now have a working ghostscript binary installed.

(If you are following the cups install guide, return there now !)

Last Updated on Tuesday, 15 September 2009 07:01
 
Share on facebook