On 2010/04/10 18:41, Aaron Lewis wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 04/10/2010 06:25 PM, Stuart Henderson wrote: > > On 2010-04-10, Aaron Lewis <aaron.lewis1...@gmail.com> wrote: > >> > >> Hi, > >> I'm trying to make a small binary package , which aims to install some > >> X11 fonts to /usr/share/fonts/truetype. > > > > /usr/share/fonts/truetype -> not portable > > > >> 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 > > > > /bin/bash -> not portable > > Oops , my linux background .. you're right Stuart. > > > > >> tail +5 $0 | tar xvf - -C /tmp > >> exit 0 > >> #======================== > >> //Append Tar.Bz2 file > > > > bz2 -> not as portable as it could be > > > > relying on tar to autodetect compressed archives -> not portable > > > > running some random downloaded shell archive with sufficient > > permissions to install to /usr/share without a good way to inspect > > what it's going to overwrite -> not safe > > > >> Doesn't looks like a good way , anyone could help ? > > > > the simple portable safe way is a tar.gz with a README and ideally > > a Makefile. people know how to use these. use a variable for the install > > target so people can override it on the make(1) command line. > > Makefile + ReadMe is yet another good way. Put different entries based > on different OS , and people just override Makefile command line. > > I've similar things before > > e.g > make openbsd > make solaris > make linux ..
the only thing you probably want to change is the directory, so something like make INSTALLDIR=/usr/share/foo/bar and you can put a default definition for INSTALLDIR in the Makefile