Re: Howto Create a Auto-Extract Package with Shell Script tar ?
Hello, On Sat, 10.04.2010 at 09:17:53 +0800, Aaron Lewis aaron.lewis1...@gmail.com wrote: 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. maybe you can use or tweak 'shar' to do what you want. $ man shar Kind regards, --Toni++
Re: Howto Create a Auto-Extract Package with Shell Script tar ?
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): -jCompress 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: -zCompress 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.
Re: Howto Create a Auto-Extract Package with Shell Script tar ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/10/2010 05:22 PM, Jean-Philippe Ouellet wrote: 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. Thanks for your experience ! There should be a reason why people prefer gzip other than bzip2 , i'd try to put them all in tgz. - -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4r0n on freenode Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvAUecACgkQvf41sEptMqAB6ACgg6hDSKWJm/hLeDEOWTl+DfsY MQEAoK8dr/kDOVrtxYhGhRYrYSLX66+l =1V+g -END PGP SIGNATURE-
Re: Howto Create a Auto-Extract Package with Shell Script tar ?
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 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.
[SOLVED] Re: Howto Create a Auto-Extract Package with Shell Script tar ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/10/2010 04:56 PM, Toni Mueller wrote: Hello, On Sat, 10.04.2010 at 09:17:53 +0800, Aaron Lewis aaron.lewis1...@gmail.com wrote: 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. maybe you can use or tweak 'shar' to do what you want. $ man shar Yeah , that's what i'm looking for , thanks ! Encoding to readable characters , and easy to hack it ;-) Kind regards, --Toni++ - -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4r0n on freenode Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvAUlEACgkQvf41sEptMqAJ9QCgwCMRNz+T9RGarMnit4ybnW9C yUAAniDQAZQ5vpWBHJsGsR2TKR44GINc =Z8aB -END PGP SIGNATURE-
[SOLVED] Re: Howto Create a Auto-Extract Package with Shell Script tar ?
-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 .. Simpler is easier anyway ;-) Thanks to all of you. - -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4r0n on freenode Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvAVdYACgkQvf41sEptMqD36gCg2PYIlMjNBwhx6zS2rblyEyoJ LXgAoJDKuYwXKLoJ5Vj+D69DJ2aROJv5 =LWAY -END PGP SIGNATURE-
Re: [SOLVED] Re: Howto Create a Auto-Extract Package with Shell Script tar ?
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
Re: [SOLVED] Re: Howto Create a Auto-Extract Package with Shell Script tar ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 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 Yeah , right , modify such a macro is yet another good way ;-) I'd put them in , too. Thanks. - -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4r0n on freenode Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvAXnAACgkQvf41sEptMqAEiQCggEy8NMKnPyRNKXgoVyuIxG+a bmoAn3pCeZ0NJjZZYbts5TORTAEVwu8Q =gnUw -END PGP SIGNATURE-
Howto Create a Auto-Extract Package with Shell Script tar ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 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 , anyone could help ? Thanks in advance ! - -- Best Regards, Aaron Lewis - PGP: 0x4A6D32A0 FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0 irc: A4r0n on freenode Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAku/0cEACgkQvf41sEptMqCJgQCfQESwZdv2QvE9j1q9l1AM4fUZ EW0AoJbplPCW0bnCrzE4wI8IHC9g/Ugk =3kRR -END PGP SIGNATURE-