On 4/9/10 9:17 PM, Aaron Lewis wrote:
Hi,
        I'm trying to make a small binary package , which aims to install some
X11 fonts to /usr/share/fonts/truetype.
        Creating such a binary package will allow me to port it on any
UNIX/Linux system , very useful.

        Firstly i need to compress my fonts to a Font_Name.tar.bz2 , if i want
to put the extract script and Font_Name.tar.bz2 together  , a single
bundle , howto archive it ?

        Right now , i tried to append the Archive to the script file , Then try
to read through the `setup file' except for the first 5 lines.

        #!/bin/bash





tail +5 $0 | tar xvf - -C /tmp
exit 0
#========================
//Append Tar.Bz2 file

Doesn't looks like a good way
indeed.

In this case, your shell script relies on the destination machine already having the utilities needed to decompress the files.

From the man page of tar(1):
 -j    Compress archive using bzip2.  The bzip2 utility must be in-
    stalled separately.

In the case of OpenBSD, bzip2 is not installed by default. So if the interest here is portability, you are not going down the right path. I would suggest something else, like gzip.

Again from the man page of tar:
 -z    Compress archive using gzip(1).

Creating such a package will *not* allow you to port it to any UNIX/Linux system for 2 reasons (that I can think of). 1) bzip2 might not be present. 2) I could be wrong (having never needed to install fonts from their vendors), but I'd be willing to bet that fonts don't go in the same place on every system.

If you are really only trying to distribute a package of fonts, you're better off just distributing it as is, and telling people where to extract it on a given system. If you look at most bundles of files in unix, they are .tar.gz or .tgz. If everybody does it, there must be a reason for it. Simpler is always better.

Reply via email to