paps - Creating postscript output for printing


This description is not yet finished!

Table of contents


paps is a nice tool for creating Postscript files.

I'm using it within rcmpd to print the MPD playlists on a printer.

Unfortunately paps seemed to be no longer developed when I started this here in springtime 2014.
(In September 2015 I got an info from Dov Grobgeld that he has moved paps development

So I had to implement a missing feature myself:

I wanted to have an individual title on the printing, not the filename or the string "stdin" (when using a pipe).

The fix in the C program itself was easy - although C isn't a language I often use.

But I never created/modified a Debian package before.

So it was a little adventure I'll try to document here...

paps at Debian:;

todo: list the other websites used as source

Installing the required software

First there are some tools to install for compiling. Probably there are more than those...

todo: get more details (gcc, make etc)

As root (or via sudo):

apt-get update
apt-get upgrade

apt-get install fakeroot
apt-get install devscripts

Then the dependencies for the package in question:

apt-get build-dep paps

Finally (now as normal user) the package sources:

apt-cache show paps

mkdir my_build
cd my_build

apt-get source paps

First compiler and build run with the unmodified package

Now we try to compile the original source to be sure to be prepared:

cd ~/my_build
cd paps-0.6.8
less debian/changelog
dpkg-buildpackage -rfakeroot -us -uc

Editing the source and compiling it

To have a working copy:

cd ~/my_build
cp -r paps-0.6.8 paps-0.6.8-work

Edit the source file(s):

cd ~/my_build/paps-0.6.8-work
vi src/paps.c

Compile and edit until finished:


Cleaning up for easier diffing

Clean up the binaries:

make clean

In the original directory too, if needed:

cd ~/my_build/paps-0.6.8/src
make clean

Creating a patch

Create a patch/diff between original and your work:

cd ~/my_build
diff -Naur -x '*.*[ao]' -x Makefile paps-0.6.8/src paps-0.6.8-work/src  > paps-0.6.8/debian/patches/title-option

Add the created patch to the series file for activation:

cd paps-0.6.8
echo "title-option" >> debian/patches/series

Add an appropriate entry (with new version number) to the changelog:

vi debian/changelog

Add some documentation to the patchfile:

vi debian/patches/title-option

Here is the patch file.

Building and installing the new package

Build the package:

dpkg-buildpackage  -us -uc

Install new package (with root rights by sudo):

sudo dpkg -i paps_0.6.8-6a_armhf.deb libpaps0_0.6.8-6a_armhf.deb libpaps-dev_0.6.8-6a_armhf.deb