diff -Nru makeself-2.1.5/README makeself-2.2.0/README --- makeself-2.1.5/README 2008-01-04 23:57:23.000000000 +0000 +++ makeself-2.2.0/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,307 +0,0 @@ -The following was generated from http://www.megastep.org/makeself/ ------------------------ - - - #[1]Mobile/PDA - - makeself - Make self-extractable archives on Unix - - [2]makeself.sh is a small shell script that generates a self-extractable - tar.gz archive from a directory. The resulting file appears as a shell - script (many of those have a .run suffix), and can be launched as is. The - archive will then uncompress itself to a temporary directory and an optional - arbitrary command will be executed (for example an installation script). - This is pretty similar to archives generated with WinZip Self-Extractor in - the Windows world. Makeself archives also include checksums for integrity - self-validation (CRC and/or MD5 checksums). - - The makeself.sh script itself is used only to create the archives from a - directory of files. The resultant archive is actually a compressed (using - gzip, bzip2, or compress) TAR archive, with a small shell script stub at the - beginning. This small stub performs all the steps of extracting the files, - running the embedded command, and removing the temporary files when it's all - over. All what the user has to do to install the software contained in such - an archive is to "run" the archive, i.e sh nice-software.run. I recommend - using the "run" (which was introduced by some Makeself archives released by - Loki Software) or "sh" suffix for such archives not to confuse the users, - since they know it's actually shell scripts (with quite a lot of binary data - attached to it though!). - - I am trying to keep the code of this script as portable as possible, i.e - it's not relying on any bash-specific features and only calls commands that - are installed on any functioning UNIX-compatible system. This script as well - as the archives it generates should run on any Unix flavor, with any - compatible Bourne shell, provided of course that the compression programs - are available. - - As of version 2.1, Makeself has been rewritten and tested on the following - platforms : - * Linux (all distributions) - * Sun Solaris (8 tested) - * HP-UX (tested on 11.0 and 11i on HPPA RISC) - * SCO OpenUnix and OpenServer - * IBM AIX 5.1L - * MacOS X (Darwin) - * SGI IRIX 6.5 - * FreeBSD - * UnicOS / Cray - - If you successfully run Makeself and/or archives created with it on another - system, then [3]let me know! - - Examples of publicly available archives made using makeself are : - * Game patches and installers for [4]Id Software games like Quake 3 for - Linux or Return To Castle Wolfenstien ; - * All game patches released by [5]Loki Software for the Linux version of - popular games ; - * The [6]nVidia drivers for Linux - * The installer for the Linux version of [7]Google Earth - * The [8]Makeself distribution itself ;-) - * and countless others... - - Important note for Apache users: By default, most Web servers will think - that Makeself archives are regular text files and thus they may show up as - text in a Web browser. The correct way to prevent this is to add a MIME type - for this file format, like so (in httpd.conf) : - AddType application/x-makeself .run - - Important note for recent GNU/Linux distributions: Archives created with - Makeself prior to v2.1.2 were using an old syntax for the head and tail Unix - commands that is being progressively obsoleted in their GNU forms. Therefore - you may have problems uncompressing some of these archives. A workaround for - this is to set the environment variable $_POSIX2_VERSION to enable the old - syntax, i.e. : - export _POSIX2_VERSION=199209 - -Usage - - The syntax of makeself is the following: - - makeself.sh [args] archive_dir file_name label startup_script [script_args] - * args are optional options for Makeself. The available ones are : - + --version : Prints the version number on stdout, then exits - immediately - + --gzip : Use gzip for compression (is the default on platforms on - which gzip is commonly available, like Linux) - + --bzip2 : Use bzip2 instead of gzip for better compression. The - bzip2 command must be available in the command path. I recommend - that you set the prefix to something like '.bz2.run' for the - archive, so that potential users know that they'll need bzip2 to - extract it. - + --compress : Use the UNIX "compress" command to compress the data. - This should be the default on all platforms that don't have gzip - available. - + --nocomp : Do not use any compression for the archive, which will - then be an uncompressed TAR. - + --notemp : The generated archive will not extract the files to a - temporary directory, but in a new directory created in the current - directory. This is better to distribute software packages that may - extract and compile by themselves (i.e. launch the compilation - through the embedded script). - + --current : Files will be extracted to the current directory, - instead of in a subdirectory. This option implies --notemp above. - + --follow : Follow the symbolic links inside of the archive - directory, i.e. store the files that are being pointed to instead - of the links themselves. - + --append (new in 2.1.x): Append data to an existing archive, - instead of creating a new one. In this mode, the settings from the - original archive are reused (compression type, label, embedded - script), and thus don't need to be specified again on the command - line. - + --header : Makeself 2.0 uses a separate file to store the header - stub, called "makeself-header.sh". By default, it is assumed that - it is stored in the same location as makeself.sh. This option can - be used to specify its actual location if it is stored someplace - else. - + --copy : Upon extraction, the archive will first extract itself to - a temporary directory. The main application of this is to allow - self-contained installers stored in a Makeself archive on a CD, - when the installer program will later need to unmount the CD and - allow a new one to be inserted. This prevents "Filesystem busy" - errors for installers that span multiple CDs. - + --nox11 : Disable the automatic spawning of a new terminal in X11. - + --nowait : When executed from a new X11 terminal, disable the user - prompt at the end of the script execution. - + --nomd5 and --nocrc : Disable the creation of a MD5 / CRC checksum - for the archive. This speeds up the extraction process if integrity - checking is not necessary. - + --lsm file : Provide and LSM file to makeself, that will be - embedded in the generated archive. LSM files are describing a - software package in a way that is easily parseable. The LSM entry - can then be later retrieved using the '-lsm' argument to the - archive. An exemple of a LSM file is provided with Makeself. - * archive_dir is the name of the directory that contains the files to be - archived - * file_name is the name of the archive to be created - * label is an arbitrary text string describing the package. It will be - displayed while extracting the files. - * startup_script is the command to be executed from within the directory - of extracted files. Thus, if you wish to execute a program contain in - this directory, you must prefix your command with "./". For example, - ./program will be fine. The script_args are additionnal arguments for - this command. - - Here is an example, assuming the user has a package image stored in a - /home/joe/mysoft, and he wants to generate a self-extracting package named - mysoft.sh, which will launch the "setup" script initially stored in - /home/joe/mysoft : - - makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package" ./setup - Here is also how I created the [9]makeself.run archive which contains the - Makeself distribution : - - makeself.sh --notemp makeself makeself.run "Makeself by Stephane Peter" echo - "Makeself has extracted itself" - - Archives generated with Makeself 2.1 can be passed the following arguments: - - * --keep : Prevent the files to be extracted in a temporary directory that - will be removed after the embedded script's execution. The files will - then be extracted in the current working directory and will stay here - until you remove them. - * --verbose : Will prompt the user before executing the embedded command - * --target dir : Allows to extract the archive in an arbitrary place. - * --nox11 : Do not spawn a X11 terminal. - * --confirm : Prompt the user for confirmation before running the embedded - command. - * --info : Print out general information about the archive (does not - extract). - * --lsm : Print out the LSM entry, if it is present. - * --list : List the files in the archive. - * --check : Check the archive for integrity using the embedded checksums. - Does not extract the archive. - * --nochown : By default, a "chown -R" command is run on the target - directory after extraction, so that all files belong to the current - user. This is mostly needed if you are running as root, as tar will then - try to recreate the initial user ownerships. You may disable this - behavior with this flag. - * --tar : Run the tar command on the contents of the archive, using the - following arguments as parameter for the command. - * --noexec : Do not run the embedded script after extraction. - - Any subsequent arguments to the archive will be passed as additional - arguments to the embedded command. You should explicitly use the -- special - command-line construct before any such options to make sure that Makeself - will not try to interpret them. - -License - - Makeself is covered by the [10]GNU General Public License (GPL) version 2 - and above. Archives generated by Makeself don't have to be placed under this - license (although I encourage it ;-)), since the archive itself is merely - data for Makeself. - -Download - - Get the latest official distribution [11]here (version 2.1.5). - - The latest development version can be grabbed from the Loki Setup CVS - module, at [12]cvs.icculus.org. - -Version history - - * v1.0: Initial public release - * v1.1: The archive can be passed parameters that will be passed on to the - embedded script, thanks to John C. Quillan - * v1.2: Cosmetic updates, support for bzip2 compression and non-temporary - archives. Many ideas thanks to Francois Petitjean. - * v1.3: More patches from Bjarni R. Einarsson and Francois Petitjean: - Support for no compression (--nocomp), script is no longer mandatory, - automatic launch in an xterm, optional verbose output, and -target - archive option to indicate where to extract the files. - * v1.4: Many patches from Francois Petitjean: improved UNIX compatibility, - automatic integrity checking, support of LSM files to get info on the - package at run time.. - * v1.5.x: A lot of bugfixes, and many other patches, including automatic - verification through the usage of checksums. Version 1.5.5 was the - stable release for a long time, even though the Web page didn't get - updated ;-). Makeself was also officially made a part of the [13]Loki - Setup installer, and its source is being maintained as part of this - package. - * v2.0: Complete internal rewrite of Makeself. The command-line parsing - was vastly improved, the overall maintenance of the package was greatly - improved by separating the stub from makeself.sh. Also Makeself was - ported and tested to a variety of Unix platforms. - * v2.0.1: First public release of the new 2.0 branch. Prior versions are - officially obsoleted. This release introduced the '--copy' argument that - was introduced in response to a need for the [14]UT2K3 Linux installer. - * v2.1.0: Big change : Makeself can now support multiple embedded - tarballs, each stored separately with their own checksums. An existing - archive can be updated with the --append flag. Checksums are also better - managed, and the --nochown option for archives appeared. - * v2.1.1: Fixes related to the Unix compression (compress command). Some - Linux distributions made the insane choice to make it unavailable, even - though gzip is capable of uncompressing these files, plus some more - bugfixes in the extraction and checksum code. - * v2.1.2: Some bug fixes. Use head -n to avoid problems with POSIX - conformance. - * v2.1.3: Bug fixes with the command line when spawning terminals. Added - --tar, --noexec for archives. Added --nomd5 and --nocrc to avoid - creating checksums in archives. The embedded script is now run through - "eval". The --info output now includes the command used to create the - archive. A man page was contributed by Bartosz Fenski. - * v2.1.4: Fixed --info output. Generate random directory name when - extracting files to . to avoid problems. Better handling of errors with - wrong permissions for the directory containing the files. Avoid some - race conditions, Unset the $CDPATH variable to avoid problems if it is - set. Better handling of dot files in the archive directory. - * v2.1.5: Made the md5sum detection consistent with the header code. Check - for the presence of the archive directory. Added --encrypt for symmetric - encryption through gpg (Eric Windisch). Added support for the digest - command on Solaris 10 for MD5 checksums. Check for available disk space - before extracting to the target directory (Andreas Schweitzer). Allow - extraction to run asynchronously (patch by Peter Hatch). Use file - descriptors internally to avoid error messages (patch by Kay Tiong - Khoo). - -Links - - * Check out the [15]"Loki setup" installer, used to install many Linux - games and other applications, and of which I am the co-author. Since the - demise of Loki, I am now the official maintainer of the project, and it - is now being hosted on [16]icculus.org, as well as a bunch of other - ex-Loki projects (and a lot of other good stuff!). - * Bjarni R. Einarsson also wrote the setup.sh installer script, inspired - by Makeself. [17]Check it out ! - -Contact - - This script was written by [18]Stéphane Peter (megastep at megastep.org) I - welcome any enhancements and suggestions. - - Contributions were included from John C. Quillan, Bjarni R. Einarsson, - Francois Petitjean, and Ryan C. Gordon, thanks to them! If you think I - forgot your name, don't hesitate to contact me. - - icculus.org also has a [19]Bugzilla server available that allows bug reports - to be submitted for Loki setup, and since Makeself is a part of Loki setup, - you can submit bug reports from there! - _________________________________________________________________ - - - [20]Stéphane Peter - - Last modified: Fri Jan 4 15:51:05 PST 2008 - -References - - 1. http://mowser.com/web/megastep.org/makeself/ - 2. http://www.megastep.org/makeself/makeself.run - 3. mailto:megastep@REMOVEME.megastep.org - 4. http://www.idsoftware.com/ - 5. http://www.lokigames.com/products/myth2/updates.php3 - 6. http://www.nvidia.com/ - 7. http://earth.google.com/ - 8. http://www.megastep.org/makeself/makeself.run - 9. http://www.megastep.org/makeself/makeself.run - 10. http://www.gnu.org/copyleft/gpl.html - 11. http://www.megastep.org/makeself/makeself-2.1.5.run - 12. http://cvs.icculus.org/ - 13. http://www.icculus.org/loki_setup/ - 14. http://www.unrealtournament2003.com/ - 15. http://www.icculus.org/loki_setup/ - 16. http://www.icculus.org/ - 17. http://www.mmedia.is/~bre/programs/setup.sh/ - 18. mailto:megastep@@megastep.org - 19. https://bugzilla.icculus.org/ - 20. mailto:megastep@@megastep.org diff -Nru makeself-2.1.5/README.md makeself-2.2.0/README.md --- makeself-2.1.5/README.md 1970-01-01 00:00:00.000000000 +0000 +++ makeself-2.2.0/README.md 2013-04-13 00:11:05.000000000 +0000 @@ -0,0 +1,198 @@ +# makeself - Make self-extractable archives on Unix + +[makeself.sh][1] is a small shell script that generates a self-extractable +compressed tar archive from a directory. The resulting file appears as a shell script +(many of those have a **.run** suffix), and can be launched as is. The archive +will then uncompress itself to a temporary directory and an optional arbitrary +command will be executed (for example an installation script). This is pretty +similar to archives generated with WinZip Self-Extractor in the Windows world. +Makeself archives also include checksums for integrity self-validation (CRC +and/or MD5 checksums). + +The makeself.sh script itself is used only to create the archives from a +directory of files. The resultant archive is actually a compressed (using +gzip, bzip2, or compress) TAR archive, with a small shell script stub at the +beginning. This small stub performs all the steps of extracting the files, +running the embedded command, and removing the temporary files when done. +All the user has to do to install the software contained in such an +archive is to "run" the archive, i.e **sh nice-software.run**. I recommend +using the ".run" (which was introduced by some Makeself archives released by +Loki Software) or ".sh" suffix for such archives not to confuse the users, +so that they will know they are actually shell scripts (with quite a lot of binary data +attached to them though!). + +I am trying to keep the code of this script as portable as possible, i.e it is +not relying on any bash-specific features and only calls commands that are +installed on any functioning UNIX-compatible system. This script as well as +the archives it generates should run on any Unix flavor, with any compatible +Bourne shell, provided of course that the compression programs are available. + +As of version 2.1, Makeself has been rewritten and tested on the following +platforms : + + * Linux (all distributions) + * Sun Solaris (8 and above) + * HP-UX (tested on 11.0 and 11i on HPPA RISC) + * SCO OpenUnix and OpenServer + * IBM AIX 5.1L + * MacOS X (Darwin) + * SGI IRIX 6.5 + * FreeBSD + * UnicOS / Cray + * Cygwin (Windows) + +If you successfully run Makeself and/or archives created with it on another +system, then please [let me know][2]! + +Examples of publicly available archives made using makeself are : + + * Game patches and installers for [Id Software][3] games like Quake 3 for Linux or Return To Castle Wolfenstien ; + * All game patches released by [Loki Software][4] for the Linux version of popular games ; + * The [nVidia drivers][5] for Linux + * The installer for the Linux version of [Google Earth][6] + * The [VirtualBox][7] installers for Linux + * The [Makeself][1] distribution itself ;-) + * and countless others... + +**Important note for Apache users:** By default, most Web servers will think that Makeself archives are regular text files and thus they may show up as text in a Web browser. The correct way to prevent this is to add a MIME type for this file format, like so (in httpd.conf) : + +`AddType application/x-makeself .run` + +**Important note for certain GNU/Linux distributions:** Archives created with Makeself prior to v2.1.2 were using an old syntax for the _head_ and _tail_ Unix commands that is being progressively obsoleted in their GNU forms. Therefore you may have problems uncompressing some of these archives. A workaround for this is to set the environment variable $_POSIX2_VERSION to enable the old syntax, i.e. : + +`export _POSIX2_VERSION=199209` + +## Usage + +The syntax of makeself is the following: + +`makeself.sh [args] archive_dir file_name label startup_script [script_args]` + + * _args_ are optional options for Makeself. The available ones are : + + * **--version** : Prints the version number on stdout, then exits immediately + * **--gzip** : Use gzip for compression (the default on platforms on which gzip is commonly available, like Linux) + * **--bzip2** : Use bzip2 instead of gzip for better compression. The bzip2 command must be available in the command path. It is recommended that the archive prefix be set to something like '.bz2.run', so that potential users know that they'll need bzip2 to extract it. + * **--pbzip2** : Use pbzip2 instead of gzip for better and faster compression on machines having multiple CPUs. The pbzip2 command must be available in the command path. It is recommended that the archive prefix be set to something like '.bz2.run', so that potential users know that they'll need bzip2 to extract it. + * **--xz** : Use xz instead of gzip for better compression. The xz command must be available in the command path. It is recommended that the archive prefix be set to something like '.xz.run' for the archive, so that potential users know that they'll need xz to extract it. + * **--base64** : Encode the archive to ASCII in Base64 format (base64 command required). + * **--compress** : Use the UNIX "compress" command to compress the data. This should be the default on all platforms that don't have gzip available. + * **--nocomp** : Do not use any compression for the archive, which will then be an uncompressed TAR. + * **--complevel** : Specify the compression level for gzip,bzip2,pbzip2 and xz. (default to 9) + * **--notemp** : The generated archive will not extract the files to a temporary directory, but in a new directory created in the current directory. This is better to distribute software packages that may extract and compile by themselves (i.e. launch the compilation through the embedded script). + * **--current** : Files will be extracted to the current directory, instead of in a subdirectory. This option implies **--notemp** above. + * **--follow** : Follow the symbolic links inside of the archive directory, i.e. store the files that are being pointed to instead of the links themselves. + * **--append** _(new in 2.1.x)_: Append data to an existing archive, instead of creating a new one. In this mode, the settings from the original archive are reused (compression type, label, embedded script), and thus don't need to be specified again on the command line. + * **--header** : Makeself 2.0 uses a separate file to store the header stub, called "makeself-header.sh". By default, it is assumed that it is stored in the same location as makeself.sh. This option can be used to specify its actual location if it is stored someplace else. + * **--copy** : Upon extraction, the archive will first extract itself to a temporary directory. The main application of this is to allow self-contained installers stored in a Makeself archive on a CD, when the installer program will later need to unmount the CD and allow a new one to be inserted. This prevents "Filesystem busy" errors for installers that span multiple CDs. + * **--nox11** : Disable the automatic spawning of a new terminal in X11. + * **--nowait** : When executed from a new X11 terminal, disable the user prompt at the end of the script execution. + * **--nomd5** and **--nocrc** : Disable the creation of a MD5 / CRC checksum for the archive. This speeds up the extraction process if integrity checking is not necessary. + * **--lsm _file_** : Provide and LSM file to makeself, that will be embedded in the generated archive. LSM files are describing a software package in a way that is easily parseable. The LSM entry can then be later retrieved using the '-lsm' argument to the archive. An exemple of a LSM file is provided with Makeself. + * **--tar-extra opt** : Append more options to the tar command line. + + * _archive_dir_ is the name of the directory that contains the files to be archived + * _file_name_ is the name of the archive to be created + * _label_ is an arbitrary text string describing the package. It will be displayed while extracting the files. + * _startup_script_ is the command to be executed _from within_ the directory of extracted files. Thus, if you wish to execute a program contain in this directory, you must prefix your command with "./". For example, ./program will be fine. The _script_args_ are additionnal arguments for this command. + +Here is an example, assuming the user has a package image stored in a +**/home/joe/mysoft**, and he wants to generate a self-extracting package named +**mysoft.sh**, which will launch the "setup" script initially stored in +/home/joe/mysoft : + +`makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package" ./setup +` + +Here is also how I created the [makeself.run][1] archive which contains the +Makeself distribution : + +`makeself.sh --notemp makeself makeself.run "Makeself by Stephane Peter" echo +"Makeself has extracted itself" ` + +Archives generated with Makeself 2.1 can be passed the following arguments: + + * _--keep_ : Prevent the files to be extracted in a temporary directory that will be removed after the embedded script's execution. The files will then be extracted in the current working directory and will stay here until you remove them. + * _--verbose_ : Will prompt the user before executing the embedded command + * _--target dir_ : Allows to extract the archive in an arbitrary place. + * _--nox11_ : Do not spawn a X11 terminal. + * _--confirm_ : Prompt the user for confirmation before running the embedded command. + * _--info_ : Print out general information about the archive (does not extract). + * _--lsm_ : Print out the LSM entry, if it is present. + * _--list_ : List the files in the archive. + * _--check_ : Check the archive for integrity using the embedded checksums. Does not extract the archive. + * _--nochown_ : By default, a "chown -R" command is run on the target directory after extraction, so that all files belong to the current user. This is mostly needed if you are running as root, as tar will then try to recreate the initial user ownerships. You may disable this behavior with this flag. + * _--tar_ : Run the tar command on the contents of the archive, using the following arguments as parameter for the command. + * _--noexec_ : Do not run the embedded script after extraction. + +Any subsequent arguments to the archive will be passed as additional arguments +to the embedded command. You should explicitly use the _--_ special command- +line construct before any such options to make sure that Makeself will not try +to interpret them. + +## License + +Makeself is covered by the [GNU General Public License][8] (GPL) version 2 and +above. Archives generated by Makeself don't have to be placed under this +license (although I encourage it ;-)), since the archive itself is merely data +for Makeself. + +## Download + +Get the latest official distribution [here][9] (version 2.2.0). + +The latest development version can be grabbed from [GitHub][10]. Feel free to +submit any patches there through the fork and pull request process. + +## Version history + + * **v1.0:** Initial public release + * **v1.1:** The archive can be passed parameters that will be passed on to the embedded script, thanks to John C. Quillan + * **v1.2:** Cosmetic updates, support for bzip2 compression and non-temporary archives. Many ideas thanks to Francois Petitjean. + * **v1.3:** More patches from Bjarni R. Einarsson and Francois Petitjean: Support for no compression (--nocomp), script is no longer mandatory, automatic launch in an xterm, optional verbose output, and -target archive option to indicate where to extract the files. + * **v1.4:** Many patches from Francois Petitjean: improved UNIX compatibility, automatic integrity checking, support of LSM files to get info on the package at run time.. + * **v1.5.x:** A lot of bugfixes, and many other patches, including automatic verification through the usage of checksums. Version 1.5.5 was the stable release for a long time, even though the Web page didn't get updated ;-). Makeself was also officially made a part of the [Loki Setup installer][11], and its source is being maintained as part of this package. + * **v2.0:** Complete internal rewrite of Makeself. The command-line parsing was vastly improved, the overall maintenance of the package was greatly improved by separating the stub from makeself.sh. Also Makeself was ported and tested to a variety of Unix platforms. + * **v2.0.1:** First public release of the new 2.0 branch. Prior versions are officially obsoleted. This release introduced the '--copy' argument that was introduced in response to a need for the [UT2K3][12] Linux installer. + * **v2.1.0:** Big change : Makeself can now support multiple embedded tarballs, each stored separately with their own checksums. An existing archive can be updated with the --append flag. Checksums are also better managed, and the --nochown option for archives appeared. + * **v2.1.1:** Fixes related to the Unix compression (compress command). Some Linux distributions made the insane choice to make it unavailable, even though gzip is capable of uncompressing these files, plus some more bugfixes in the extraction and checksum code. + * **v2.1.2:** Some bug fixes. Use head -n to avoid problems with POSIX conformance. + * **v2.1.3:** Bug fixes with the command line when spawning terminals. Added --tar, --noexec for archives. Added --nomd5 and --nocrc to avoid creating checksums in archives. The embedded script is now run through "eval". The --info output now includes the command used to create the archive. A man page was contributed by Bartosz Fenski. + * **v2.1.4:** Fixed --info output. Generate random directory name when extracting files to . to avoid problems. Better handling of errors with wrong permissions for the directory containing the files. Avoid some race conditions, Unset the $CDPATH variable to avoid problems if it is set. Better handling of dot files in the archive directory. + * **v2.1.5:** Made the md5sum detection consistent with the header code. Check for the presence of the archive directory. Added --encrypt for symmetric encryption through gpg (Eric Windisch). Added support for the digest command on Solaris 10 for MD5 checksums. Check for available disk space before extracting to the target directory (Andreas Schweitzer). Allow extraction to run asynchronously (patch by Peter Hatch). Use file descriptors internally to avoid error messages (patch by Kay Tiong Khoo). + * **v2.1.6:** Replaced one dot per file progress with a realtime progress percentage and a spining cursor. Added --noprogress to prevent showing the progress during the decompression. Added --target dir to allow extracting directly to a target directory. (Guy Baconniere) + * **v2.2.0:** First major new release in years! Includes many bugfixes and user contributions. Please look at the [project page on Github][10] for all the details. + +## Links + + * Check out the ["Loki Setup"][11] installer, used to install many Linux games and other applications, and of which I am the co-author. Since the demise of Loki, I am now the official maintainer of the project, and it is now being hosted on [icculus.org][13], as well as a bunch of other ex-Loki projects (and a lot of other good stuff!). + * Bjarni R. Einarsson also wrote the **setup.sh** installer script, inspired by Makeself. [Check it out !][14] + +## Contact + +This script was written by [Stéphane Peter][2] (megastep at megastep.org). Any enhancements and suggestions are welcome. + +Contributions were included from John C. Quillan, Bjarni R. Einarsson, +Francois Petitjean, Ryan C. Gordon, and many contributors on GitHub. If you think I forgot +your name, don't hesitate to contact me. + +This project is now hosted on GitHub. Feel free to submit patches and bug reports on the [project page][10]. + +* * * + +[Stephane Peter][2] + + [1]: makeself.run + [2]: mailto:megastep@megastep.org + [3]: http://www.idsoftware.com/ + [4]: http://www.lokigames.com/products/myth2/updates.php3 + [5]: http://www.nvidia.com/ + [6]: http://earth.google.com/ + [7]: http://www.virtualbox.org/ + [8]: http://www.gnu.org/copyleft/gpl.html + [9]: http://cdn.megastep.org/makeself/makeself-2.2.0.run + [10]: http://github.com/megastep/makeself + [11]: http://www.icculus.org/loki_setup/ + [12]: http://www.unrealtournament2003.com/ + [13]: http://www.icculus.org/ + [14]: http://bre.klaki.net/programs/setup.sh/ diff -Nru makeself-2.1.5/TODO makeself-2.2.0/TODO --- makeself-2.1.5/TODO 2008-01-04 23:53:49.000000000 +0000 +++ makeself-2.2.0/TODO 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -What needs to be done next : - -- Generic compression code (thru a user-defined command) -- Collect names of directories potentially containing md5 program. GUESS_MD5_PATH - -Stéphane Peter diff -Nru makeself-2.1.5/debian/changelog makeself-2.2.0/debian/changelog --- makeself-2.1.5/debian/changelog 2013-12-11 18:13:22.000000000 +0000 +++ makeself-2.2.0/debian/changelog 2013-12-10 08:26:26.000000000 +0000 @@ -1,3 +1,16 @@ +makeself (2.2.0-1) unstable; urgency=low + + * New upstream release. (Closes: #690105) + - handles df output in more portable way (Closes: #641804) + * Repackaged from scratch. + - uses new packaging format 3.0 (Closes: #670738) + - uses new copyright format + - uses debhelper compatibility level 9 + - uses the newest Standards-Version + - fixes 2 lintian errors and 6 warnings + + -- Bartosz Fenski Mon, 09 Dec 2013 17:32:45 +0100 + makeself (2.1.5-1) unstable; urgency=low * New upstream release. diff -Nru makeself-2.1.5/debian/compat makeself-2.2.0/debian/compat --- makeself-2.1.5/debian/compat 2013-12-11 18:13:22.000000000 +0000 +++ makeself-2.2.0/debian/compat 2013-12-09 14:53:21.000000000 +0000 @@ -1 +1 @@ -4 +9 diff -Nru makeself-2.1.5/debian/control makeself-2.2.0/debian/control --- makeself-2.1.5/debian/control 2013-12-11 18:13:22.000000000 +0000 +++ makeself-2.2.0/debian/control 2013-12-10 08:15:52.000000000 +0000 @@ -2,11 +2,12 @@ Section: utils Priority: optional Maintainer: Bartosz Fenski -Build-Depends: debhelper (>= 4.0.0), dpatch -Standards-Version: 3.7.3 +Build-Depends: debhelper (>= 9.0.0) +Standards-Version: 3.9.4 Homepage: http://www.megastep.org/makeself/ Package: makeself +Depends: ${misc:Depends} Architecture: all Suggests: bzip2 Description: utility to generate self-extractable archives @@ -26,7 +27,7 @@ extracting the files, running the embedded command, and removing the temporary files when it's all over. All what the user has to do to install the software contained in such an archive is to "run" the - archive, i.e. sh nice-software.run. I recommend using the "run" (which + archive, i.e. sh nice-software.run. It is recommended to use the "run" (which was introduced by some Makeself archives released by Loki Software) or "sh" suffix for such archives not to confuse the users, since they actually are shell scripts (with quite a lot of binary data attached diff -Nru makeself-2.1.5/debian/copyright makeself-2.2.0/debian/copyright --- makeself-2.1.5/debian/copyright 2013-12-11 18:13:22.000000000 +0000 +++ makeself-2.2.0/debian/copyright 2013-12-10 07:54:10.000000000 +0000 @@ -1,20 +1,41 @@ -This package was debianized by Bartosz Fenski on -Sat, 6 Mar 2004 11:49:57 +0100. - -It was downloaded from http://www.megastep.org/makeself/ - -Upstream Author: Stéphane Peter - -Copyright: - -Copyright 1998-2004 Stéphane Peter - -License: - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -On Debian systems, the complete text of the GNU General Public License -can be found in the file `/usr/share/common-licenses/GPL'. +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: makeself +Source: http://www.megastep.org/makeself/ + +Files: * +Copyright: 1998-2013 Stéphane Peter +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +Files: debian/* +Copyright: 2004-2013 Bartosz Fenski +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff -Nru makeself-2.1.5/debian/dirs makeself-2.2.0/debian/dirs --- makeself-2.1.5/debian/dirs 2013-12-11 18:13:22.000000000 +0000 +++ makeself-2.2.0/debian/dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/bin -usr/share/makeself diff -Nru makeself-2.1.5/debian/docs makeself-2.2.0/debian/docs --- makeself-2.1.5/debian/docs 2013-12-11 18:13:22.000000000 +0000 +++ makeself-2.2.0/debian/docs 2013-12-09 14:48:56.000000000 +0000 @@ -1,2 +1 @@ -README -TODO +README.md diff -Nru makeself-2.1.5/debian/install makeself-2.2.0/debian/install --- makeself-2.1.5/debian/install 1970-01-01 00:00:00.000000000 +0000 +++ makeself-2.2.0/debian/install 2013-12-10 08:04:57.000000000 +0000 @@ -0,0 +1,2 @@ +makeself.sh /usr/bin +makeself-header.sh /usr/share/makeself diff -Nru makeself-2.1.5/debian/manpages makeself-2.2.0/debian/manpages --- makeself-2.1.5/debian/manpages 1970-01-01 00:00:00.000000000 +0000 +++ makeself-2.2.0/debian/manpages 2013-12-10 08:05:39.000000000 +0000 @@ -0,0 +1 @@ +makeself.1 diff -Nru makeself-2.1.5/debian/patches/00list makeself-2.2.0/debian/patches/00list --- makeself-2.1.5/debian/patches/00list 2013-12-11 18:13:22.000000000 +0000 +++ makeself-2.2.0/debian/patches/00list 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -01_makeself - diff -Nru makeself-2.1.5/debian/patches/01_makeself.dpatch makeself-2.2.0/debian/patches/01_makeself.dpatch --- makeself-2.1.5/debian/patches/01_makeself.dpatch 2013-12-11 18:13:22.000000000 +0000 +++ makeself-2.2.0/debian/patches/01_makeself.dpatch 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -#! /bin/sh -e -## makeself.dpatch -## Bartosz Fenski - -patch_opts="${patch_opts:--f --no-backup-if-mismatch ${2:+-d $2}}" - -if [ $# -ne 1 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) patch $patch_opts -p1 < $0;; - -unpatch) patch $patch_opts -R -p1 < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1;; -esac - -exit 0 - -@DPATCH@ ---- makeself-2.1.2.orig/makeself.sh 2003-07-05 03:38:05.000000000 +0200 -+++ makeself-2.1.2/makeself.sh 2004-03-24 23:50:04.000000000 +0100 -@@ -98,7 +98,7 @@ - APPEND=n - COPY=none - TAR_ARGS=cvf --HEADER=`dirname $0`/makeself-header.sh -+HEADER=/usr/share/makeself/makeself-header - - # LSM file stuff - LSM_CMD="echo No LSM. >> \"\$archname\"" - diff -Nru makeself-2.1.5/debian/patches/header makeself-2.2.0/debian/patches/header --- makeself-2.1.5/debian/patches/header 1970-01-01 00:00:00.000000000 +0000 +++ makeself-2.2.0/debian/patches/header 2013-12-10 07:56:46.000000000 +0000 @@ -0,0 +1,15 @@ +Description: change path to header +Origin: other +Forwarded: not-needed + +--- makeself-2.2.0.orig/makeself.sh ++++ makeself-2.2.0/makeself.sh +@@ -143,7 +143,7 @@ COPY=none + TAR_ARGS=cvf + TAR_EXTRA="" + DU_ARGS=-ks +-HEADER=`dirname "$0"`/makeself-header.sh ++HEADER=/usr/share/makeself/makeself-header.sh + TARGETDIR="" + + # LSM file stuff diff -Nru makeself-2.1.5/debian/patches/series makeself-2.2.0/debian/patches/series --- makeself-2.1.5/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ makeself-2.2.0/debian/patches/series 2013-12-10 07:55:49.000000000 +0000 @@ -0,0 +1 @@ +header diff -Nru makeself-2.1.5/debian/rules makeself-2.2.0/debian/rules --- makeself-2.1.5/debian/rules 2013-12-11 18:13:22.000000000 +0000 +++ makeself-2.2.0/debian/rules 2013-12-10 08:10:08.000000000 +0000 @@ -1,54 +1,12 @@ #!/usr/bin/make -f -# rules file for makeself (March 2004) # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -include /usr/share/dpatch/dpatch.make - -CFLAGS = -Wall -g - -configure: configure-stamp -configure-stamp: - dh_testdir - touch configure-stamp - - -build: build-stamp - -build-stamp: configure-stamp patch-stamp - dh_testdir - touch build-stamp - -clean: unpatch - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - install makeself.sh debian/makeself/usr/bin/makeself - install -m 644 makeself-header.sh debian/makeself/usr/share/makeself/makeself-header - -binary-indep: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installman makeself.1 - dh_compress - dh_fixperms - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep -.PHONY: build clean binary-indep binary install configure \ -patch unpatch +%: + dh $@ +override_dh_install: + dh_install + mv debian/makeself/usr/bin/makeself.sh debian/makeself/usr/bin/makeself + chmod 644 debian/makeself/usr/share/makeself/makeself-header.sh diff -Nru makeself-2.1.5/debian/source/format makeself-2.2.0/debian/source/format --- makeself-2.1.5/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ makeself-2.2.0/debian/source/format 2013-12-11 18:13:22.580402236 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru makeself-2.1.5/makeself-header.sh makeself-2.2.0/makeself-header.sh --- makeself-2.1.5/makeself-header.sh 2008-01-04 23:53:49.000000000 +0000 +++ makeself-2.2.0/makeself-header.sh 2013-04-13 00:11:05.000000000 +0000 @@ -2,6 +2,8 @@ #!/bin/sh # This script was generated using Makeself $MS_VERSION +umask 077 + CRCsum="$CRCsum" MD5="$MD5sum" TMPROOT=\${TMPDIR:=/tmp} @@ -9,9 +11,11 @@ label="$LABEL" script="$SCRIPT" scriptargs="$SCRIPTARGS" +licensetxt="$LICENSE" targetdir="$archdirname" filesizes="$filesizes" -keep=$KEEP +keep="$KEEP" +quiet="n" print_cmd_arg="" if type printf > /dev/null; then @@ -29,11 +33,23 @@ \$print_cmd \$print_cmd_arg "\$1" } -MS_Progress() +MS_PrintLicense() { - while read a; do - MS_Printf . + if test x"\$licensetxt" != x; then + echo \$licensetxt + while true + do + MS_Printf "Please type y to accept, n otherwise: " + read yn + if test x"\$yn" = xn; then + keep=n + eval \$finish; exit 1 + break; + elif test x"\$yn" = xy; then + break; + fi done + fi } MS_diskspace() @@ -42,7 +58,7 @@ if test -d /usr/xpg4/bin; then PATH=/usr/xpg4/bin:\$PATH fi - df -kP "\$1" | tail -1 | awk '{print \$4}' + df -kP "\$1" | tail -1 | awk '{ if (\$4 ~ /%/) {print \$3} else {print \$4} }' ) } @@ -55,6 +71,50 @@ test \$bytes -gt 0 && dd ibs=1 obs=1024 count=\$bytes ; } 2> /dev/null } +MS_dd_Progress() +{ + if test "\$noprogress" = "y"; then + MS_dd \$@ + return \$? + fi + file="\$1" + offset=\$2 + length=\$3 + pos=0 + bsize=4194304 + while test \$bsize -gt \$length; do + bsize=\`expr \$bsize / 4\` + done + blocks=\`expr \$length / \$bsize\` + bytes=\`expr \$length % \$bsize\` + ( + dd bs=\$offset count=0 skip=1 2>/dev/null + pos=\`expr \$pos \+ \$bsize\` + MS_Printf " 0%% " 1>&2 + if test \$blocks -gt 0; then + while test \$pos -le \$length; do + dd bs=\$bsize count=1 2>/dev/null + pcent=\`expr \$length / 100\` + pcent=\`expr \$pos / \$pcent\` + if test \$pcent -lt 100; then + MS_Printf "\b\b\b\b\b\b\b" 1>&2 + if test \$pcent -lt 10; then + MS_Printf " \$pcent%% " 1>&2 + else + MS_Printf " \$pcent%% " 1>&2 + fi + fi + pos=\`expr \$pos \+ \$bsize\` + done + fi + if test \$bytes -gt 0; then + dd bs=\$bytes count=1 2>/dev/null + fi + MS_Printf "\b\b\b\b\b\b\b" 1>&2 + MS_Printf " 100%% " 1>&2 + ) < "\$file" +} + MS_Help() { cat << EOH >&2 @@ -70,12 +130,15 @@ \$0 [options] [--] [additional arguments to embedded script] with following options (in that order) --confirm Ask before running embedded script + --quiet Do not print anything except error messages --noexec Do not run embedded script --keep Do not erase target directory after running the embedded script + --noprogress Do not show the progress during the decompression --nox11 Do not spawn an xterm --nochown Do not give the extracted files to the current user - --target NewDirectory Extract in NewDirectory + --target dir Extract directly to a target directory + directory path can be either absolute or relative --tar arg1 [arg2 ...] Access the contents of the archive through the tar command -- Following arguments will be passed to the embedded script EOH @@ -91,7 +154,9 @@ test -x "\$MD5_PATH" || MD5_PATH=\`exec <&- 2>&-; which digest || type digest\` PATH="\$OLD_PATH" - MS_Printf "Verifying archive integrity..." + if test "\$quiet" = "n";then + MS_Printf "Verifying archive integrity..." + fi offset=\`head -n $SKIP "\$1" | wc -c | tr -d " "\` verb=\$2 i=1 @@ -123,23 +188,31 @@ if test "\$sum1" = "\$crc"; then test x\$verb = xy && MS_Printf " CRC checksums are OK." >&2 else - echo "Error in checksums: \$sum1 is different from \$crc" + echo "Error in checksums: \$sum1 is different from \$crc" >&2 exit 2; fi fi i=\`expr \$i + 1\` offset=\`expr \$offset + \$s\` done - echo " All good." + if test "\$quiet" = "n";then + echo " All good." + fi } UnTAR() { - tar \$1vf - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; } + if test "\$quiet" = "n"; then + tar \$1vf - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; } + else + + tar \$1f - 2>&1 || { echo Extraction failed. > /dev/tty; kill -15 \$$; } + fi } finish=true xterm_loop= +noprogress=$NOPROGRESS nox11=$NOX11 copy=$COPY ownership=y @@ -154,6 +227,11 @@ MS_Help exit 0 ;; + -q | --quiet) + quiet=y + noprogress=y + shift + ;; --info) echo Identification: "\$label" echo Target directory: "\$targetdir" @@ -211,7 +289,7 @@ --tar) offset=\`head -n $SKIP "\$0" | wc -c | tr -d " "\` arg1="\$2" - shift 2 + if ! shift 2; then MS_Help; exit 1; fi for s in \$filesizes do MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | tar "\$arg1" - \$* @@ -238,7 +316,11 @@ --target) keep=y targetdir=\${2:-.} - shift 2 + if ! shift 2; then MS_Help; exit 1; fi + ;; + --noprogress) + noprogress=y + shift ;; --nox11) nox11=y @@ -270,6 +352,13 @@ esac done +if test "\$quiet" = "y" -a "\$verbose" = "y";then + echo Cannot be verbose and quiet at the same time. >&2 + exit 1 +fi + +MS_PrintLicense + case "\$copy" in copy) tmpdir=\$TMPROOT/makeself.\$RANDOM.\`date +"%y%m%d%H%M%S"\`.\$\$ @@ -317,7 +406,9 @@ tmpdir="." else if test "\$keep" = y; then - echo "Creating directory \$targetdir" >&2 + if test "\$quiet" = "n";then + echo "Creating directory \$targetdir" >&2 + fi tmpdir="\$targetdir" dashp="-p" else @@ -326,7 +417,7 @@ fi mkdir \$dashp \$tmpdir || { echo 'Cannot create target directory' \$tmpdir >&2 - echo 'You should try option --target OtherDirectory' >&2 + echo 'You should try option --target dir' >&2 eval \$finish exit 1 } @@ -346,36 +437,42 @@ fi fi -MS_Printf "Uncompressing \$label" +if test "\$quiet" = "n";then + MS_Printf "Uncompressing \$label" +fi res=3 if test "\$keep" = n; then trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; /bin/rm -rf \$tmpdir; eval \$finish; exit 15' 1 2 3 15 fi leftspace=\`MS_diskspace \$tmpdir\` -if test \$leftspace -lt $USIZE; then - echo - echo "Not enough space left in "\`dirname \$tmpdir\`" (\$leftspace KB) to decompress \$0 ($USIZE KB)" >&2 - if test "\$keep" = n; then - echo "Consider setting TMPDIR to a directory with more free space." - fi - eval \$finish; exit 1 +if test -n "\$leftspace"; then + if test "\$leftspace" -lt $USIZE; then + echo + echo "Not enough space left in "\`dirname \$tmpdir\`" (\$leftspace KB) to decompress \$0 ($USIZE KB)" >&2 + if test "\$keep" = n; then + echo "Consider setting TMPDIR to a directory with more free space." + fi + eval \$finish; exit 1 + fi fi for s in \$filesizes do - if MS_dd "\$0" \$offset \$s | eval "$GUNZIP_CMD" | ( cd "\$tmpdir"; UnTAR x ) | MS_Progress; then + if MS_dd_Progress "\$0" \$offset \$s | eval "$GUNZIP_CMD" | ( cd "\$tmpdir"; UnTAR x ) 1>/dev/null; then if test x"\$ownership" = xy; then (PATH=/usr/xpg4/bin:\$PATH; cd "\$tmpdir"; chown -R \`id -u\` .; chgrp -R \`id -g\` .) fi else - echo + echo >&2 echo "Unable to decompress \$0" >&2 eval \$finish; exit 1 fi offset=\`expr \$offset + \$s\` done -echo +if test "\$quiet" = "n";then + echo +fi cd "\$tmpdir" res=0 diff -Nru makeself-2.1.5/makeself.1 makeself-2.2.0/makeself.1 --- makeself-2.1.5/makeself.1 2008-01-04 23:53:49.000000000 +0000 +++ makeself-2.2.0/makeself.1 2013-04-13 00:11:05.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "makeself" "1" "2.1.4" +.TH "makeself" "1" "2.1.6" .SH "NAME" makeself \- An utility to generate self-extractable archives. .SH "SYNTAX" @@ -27,12 +27,21 @@ .B --bzip2 Compress using bzip2. .TP +.B --pbzip2 +Compress using pbzip2. +.TP +.B --xz +Compress using xz. +.TP .B --compress Compress using the UNIX 'compress' command. .TP .B --nocomp Do not compress the data. .TP +.B --complevel lvl +Specify the compression level for gzip,bzip2,pbzui2 or xz +.TP .B --notemp The archive will create archive_dir in the current directory and uncompress in ./archive_dir. @@ -41,11 +50,13 @@ Upon extraction, the archive will first copy itself to a temporary directory. .TP .B --append -Append more files to an existing makeself archive. -The label and startup scripts will then be ignored. +Append more files to an existing makeself archive. The label and startup scripts will then be ignored. .TP .B --current -Files will be extracted to the current directory. Implies --notemp. +Files will be extracted to the current directory. Both --current and --target dir imply --notemp. +.TP +.B --target dir +Extract directly to a target directory. Directory path can be either absolute or relative. .TP .B --header file Specify location of the header script. @@ -53,6 +64,9 @@ .B --follow Follow the symlinks in the archive. .TP +.B --noprogress +Do not show the progress during the decompression. +.TP .B --nox11 Disable automatic spawn of an xterm if running in X11. .TP diff -Nru makeself-2.1.5/makeself.lsm makeself-2.2.0/makeself.lsm --- makeself-2.1.5/makeself.lsm 2008-01-04 23:53:49.000000000 +0000 +++ makeself-2.2.0/makeself.lsm 2013-04-13 00:11:05.000000000 +0000 @@ -1,6 +1,6 @@ Begin3 Title: makeself.sh -Version: 2.1 +Version: 2.2.0 Description: makeself.sh is a shell script that generates a self-extractable tar.gz archive from a directory. The resulting file appears as a shell script, and can be launched as is. The archive will then uncompress @@ -8,9 +8,9 @@ executed (for example an installation script). This is pretty similar to archives generated with WinZip Self-Extractor in the Windows world. Keywords: Installation archive tar winzip -Author: Stéphane Peter (megastep@megastep.org) -Maintained-by: Stéphane Peter (megastep@megastep.org) -Original-site: http://www.megastep.org/makeself/ +Author: Stephane Peter (megastep@megastep.org) +Maintained-by: Stephane Peter (megastep@megastep.org) +Original-site: http://github.com/megastep/makeself Platform: Unix Copying-policy: GPL End diff -Nru makeself-2.1.5/makeself.sh makeself-2.2.0/makeself.sh --- makeself-2.1.5/makeself.sh 2008-01-04 23:53:49.000000000 +0000 +++ makeself-2.2.0/makeself.sh 2013-04-13 00:11:05.000000000 +0000 @@ -1,10 +1,8 @@ #!/bin/sh # -# Makeself version 2.1.x +# Makeself version 2.2.x # by Stephane Peter # -# $Id: makeself.sh,v 1.64 2008/01/04 23:52:14 megastep Exp $ -# # Utility to create self-extracting tar.gz archives. # The resulting archive is a file holding the tar.gz archive with # a small Shell script stub that uncompresses the archive to a temporary @@ -64,14 +62,18 @@ # Check for available disk space before extracting to the target directory (Andreas Schweitzer) # Allow extraction to run asynchronously (patch by Peter Hatch) # Use file descriptors internally to avoid error messages (patch by Kay Tiong Khoo) +# - 2.1.6 : Replaced one dot per file progress with a realtime progress percentage and a spining cursor (Guy Baconniere) +# Added --noprogress to prevent showing the progress during the decompression (Guy Baconniere) +# Added --target dir to allow extracting directly to a target directory (Guy Baconniere) +# - 2.2.0 : Many bugfixes, updates and contributions from users. Check out the project page on Github for the details. # -# (C) 1998-2008 by Stéphane Peter +# (C) 1998-2013 by Stephane Peter # # This software is released under the terms of the GNU GPL version 2 and above # Please read the license at http://www.gnu.org/copyleft/gpl.html # -MS_VERSION=2.1.5 +MS_VERSION=2.2.0 MS_COMMAND="$0" unset CDPATH @@ -88,9 +90,14 @@ echo "params can be one or more of the following :" echo " --version | -v : Print out Makeself version number and exit" echo " --help | -h : Print out this help message" + echo " --quiet | -q : Do not print any messages other than errors." echo " --gzip : Compress using gzip (default if detected)" echo " --bzip2 : Compress using bzip2 instead of gzip" + echo " --pbzip2 : Compress using pbzip2 instead of gzip" + echo " --xz : Compress using xz instead of gzip" echo " --compress : Compress using the UNIX 'compress' command" + echo " --complevel lvl : Compression level for gzip xz bzip2 and pbzip2 (default 9)" + echo " --base64 : Instead of compressing, encode the data using base64" echo " --nocomp : Do not compress the data" echo " --notemp : The archive will create archive_dir in the" echo " current directory and uncompress in ./archive_dir" @@ -98,16 +105,21 @@ echo " a temporary directory" echo " --append : Append more files to an existing Makeself archive" echo " The label and startup scripts will then be ignored" - echo " --current : Files will be extracted to the current directory." - echo " Implies --notemp." + echo " --target dir : Extract directly to a target directory" + echo " directory path can be either absolute or relative" + echo " --current : Files will be extracted to the current directory" + echo " Both --current and --target imply --notemp" + echo " --tar-extra opt : Append more options to the tar command line" echo " --nomd5 : Don't calculate an MD5 for archive" echo " --nocrc : Don't calculate a CRC for archive" echo " --header file : Specify location of the header script" echo " --follow : Follow the symlinks in the archive" + echo " --noprogress : Do not show the progress during the decompression" echo " --nox11 : Disable automatic spawn of a xterm" echo " --nowait : Do not wait for user input after executing embedded" echo " program from an xterm" echo " --lsm file : LSM file describing the package" + echo " --license file : Append a license file" echo echo "Do not forget to give a fully qualified startup script name" echo "(i.e. with a ./ prefix if inside the archive)." @@ -120,13 +132,19 @@ else COMPRESS=Unix fi +COMPRESS_LEVEL=9 KEEP=n CURRENT=n NOX11=n APPEND=n +QUIET=n +NOPROGRESS=n COPY=none TAR_ARGS=cvf -HEADER=`dirname $0`/makeself-header.sh +TAR_EXTRA="" +DU_ARGS=-ks +HEADER=`dirname "$0"`/makeself-header.sh +TARGETDIR="" # LSM file stuff LSM_CMD="echo No LSM. >> \"\$archname\"" @@ -138,6 +156,10 @@ echo Makeself version $MS_VERSION exit 0 ;; + --pbzip2) + COMPRESS=pbzip2 + shift + ;; --bzip2) COMPRESS=bzip2 shift @@ -146,10 +168,18 @@ COMPRESS=gzip shift ;; + --xz) + COMPRESS=xz + shift + ;; --compress) COMPRESS=Unix shift ;; + --base64) + COMPRESS=base64 + shift + ;; --encrypt) COMPRESS=gpg shift @@ -158,6 +188,10 @@ COMPRESS=none shift ;; + --complevel) + COMPRESS_LEVEL="$2" + if ! shift 2; then MS_Help; exit 1; fi + ;; --notemp) KEEP=y shift @@ -171,12 +205,30 @@ KEEP=y shift ;; + --tar-extra) + TAR_EXTRA="$2" + if ! shift 2; then MS_Help; exit 1; fi + ;; + --target) + TARGETDIR="$2" + KEEP=y + if ! shift 2; then MS_Help; exit 1; fi + ;; --header) HEADER="$2" - shift 2 + if ! shift 2; then MS_Help; exit 1; fi ;; + --license) + LICENSE=`cat $2` + if ! shift 2; then MS_Help; exit 1; fi + ;; --follow) TAR_ARGS=cvfh + DU_ARGS=-ksL + shift + ;; + --noprogress) + NOPROGRESS=y shift ;; --nox11) @@ -200,7 +252,11 @@ ;; --lsm) LSM_CMD="cat \"$2\" >> \"\$archname\"" - shift 2 + if ! shift 2; then MS_Help; exit 1; fi + ;; + -q | --quiet) + QUIET=y + shift ;; -h | --help) MS_Usage @@ -221,12 +277,20 @@ if test -d "$1"; then archdir="$1" else - echo "Directory $1 does not exist." + echo "Directory $1 does not exist." >&2 exit 1 fi fi archname="$2" +if test "$QUIET" = "y"; then + if test "$TAR_ARGS" = "cvf"; then + TAR_ARGS="cf" + elif test "$TAR_ARGS" = "cvfh";then + TAR_ARGS="cfh" + fi +fi + if test "$APPEND" = y; then if test $# -lt 2; then MS_Usage @@ -243,12 +307,14 @@ else if test "$KEEP" = n -a $# = 3; then echo "ERROR: Making a temporary archive with no embedded command does not make sense!" >&2 - echo + echo >&2 MS_Usage fi - # We don't really want to create an absolute directory... + # We don't want to create an absolute directory unless a target directory is defined if test "$CURRENT" = y; then archdirname="." + elif test x$TARGETDIR != x; then + archdirname="$TARGETDIR" else archdirname=`basename "$1"` fi @@ -271,15 +337,27 @@ case $COMPRESS in gzip) - GZIP_CMD="gzip -c9" + GZIP_CMD="gzip -c$COMPRESS_LEVEL" GUNZIP_CMD="gzip -cd" ;; +pbzip2) + GZIP_CMD="pbzip2 -c$COMPRESS_LEVEL" + GUNZIP_CMD="bzip2 -d" + ;; bzip2) - GZIP_CMD="bzip2 -9" + GZIP_CMD="bzip2 -$COMPRESS_LEVEL" GUNZIP_CMD="bzip2 -d" ;; +xz) + GZIP_CMD="xz -c$COMPRESS_LEVEL" + GUNZIP_CMD="xz -d" + ;; +base64) + GZIP_CMD="base64" + GUNZIP_CMD="base64 -d -i" + ;; gpg) - GZIP_CMD="gpg -ac -z9" + GZIP_CMD="gpg -ac -z$COMPRESS_LEVEL" GUNZIP_CMD="gpg -d" ;; Unix) @@ -294,17 +372,19 @@ tmpfile="${TMPDIR:=/tmp}/mkself$$" -if test -f $HEADER; then +if test -f "$HEADER"; then oldarchname="$archname" archname="$tmpfile" # Generate a fake header to count its lines SKIP=0 - . $HEADER + . "$HEADER" SKIP=`cat "$tmpfile" |wc -l` # Get rid of any spaces SKIP=`expr $SKIP` rm -f "$tmpfile" - echo Header is $SKIP lines long >&2 + if test "$QUIET" = "n";then + echo Header is $SKIP lines long >&2 + fi archname="$oldarchname" else @@ -312,7 +392,9 @@ exit 1 fi -echo +if test "$QUIET" = "n";then + echo +fi if test "$APPEND" = n; then if test -f "$archname"; then @@ -320,7 +402,7 @@ fi fi -USIZE=`du -ks $archdir | cut -f1` +USIZE=`du $DU_ARGS "$archdir" | awk '{print $1}'` DATE=`LC_ALL=C date` if test "." = "$archdirname"; then @@ -330,10 +412,12 @@ fi test -d "$archdir" || { echo "Error: $archdir does not exist."; rm -f "$tmpfile"; exit 1; } -echo About to compress $USIZE KB of data... -echo Adding files to archive named \"$archname\"... +if test "$QUIET" = "n";then + echo About to compress $USIZE KB of data... + echo Adding files to archive named \"$archname\"... +fi exec 3<> "$tmpfile" -(cd "$archdir" && ( tar $TAR_ARGS - . | eval "$GZIP_CMD" >&3 ) ) || { echo Aborting: Archive directory not found or temporary file: "$tmpfile" could not be created.; exec 3>&-; rm -f "$tmpfile"; exit 1; } +(cd "$archdir" && ( tar $TAR_ARGS $TAR_EXTRA - . | eval "$GZIP_CMD" >&3 ) ) || { echo Aborting: Archive directory not found or temporary file: "$tmpfile" could not be created.; exec 3>&-; rm -f "$tmpfile"; exit 1; } exec 3>&- # try to close the archive fsize=`cat "$tmpfile" | wc -c | tr -d " "` @@ -344,31 +428,41 @@ crcsum=0000000000 if test "$NOCRC" = y; then - echo "skipping crc at user request" + if test "$QUIET" = "n";then + echo "skipping crc at user request" + fi else crcsum=`cat "$tmpfile" | CMD_ENV=xpg4 cksum | sed -e 's/ /Z/' -e 's/ /Z/' | cut -dZ -f1` - echo "CRC: $crcsum" + if test "$QUIET" = "n";then + echo "CRC: $crcsum" + fi fi if test "$NOMD5" = y; then - echo "skipping md5sum at user request" + if test "$QUIET" = "n";then + echo "skipping md5sum at user request" + fi else # Try to locate a MD5 binary OLD_PATH=$PATH PATH=${GUESS_MD5_PATH:-"$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"} MD5_ARG="" MD5_PATH=`exec <&- 2>&-; which md5sum || type md5sum` - test -x $MD5_PATH || MD5_PATH=`exec <&- 2>&-; which md5 || type md5` - test -x $MD5_PATH || MD5_PATH=`exec <&- 2>&-; which digest || type digest` + test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which md5 || type md5` + test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which digest || type digest` PATH=$OLD_PATH - if test `basename $MD5_PATH` = digest; then - MD5_ARG="-a md5" - fi if test -x "$MD5_PATH"; then + if test `basename ${MD5_PATH}`x = digestx; then + MD5_ARG="-a md5" + fi md5sum=`cat "$tmpfile" | eval "$MD5_PATH $MD5_ARG" | cut -b-32`; - echo "MD5: $md5sum" + if test "$QUIET" = "n";then + echo "MD5: $md5sum" + fi else - echo "MD5: none, MD5 command not found" + if test "$QUIET" = "n";then + echo "MD5: none, MD5 command not found" + fi fi fi @@ -381,7 +475,7 @@ MD5sum="$MD5sum $md5sum" USIZE=`expr $USIZE + $OLDUSIZE` # Generate the header - . $HEADER + . "$HEADER" # Append the original data tail -n +$OLDSKIP "$archname".bak >> "$archname" # Append the new data @@ -389,19 +483,25 @@ chmod +x "$archname" rm -f "$archname".bak - echo Self-extractible archive \"$archname\" successfully updated. + if test "$QUIET" = "n";then + echo Self-extractable archive \"$archname\" successfully updated. + fi else filesizes="$fsize" CRCsum="$crcsum" MD5sum="$md5sum" # Generate the header - . $HEADER + . "$HEADER" # Append the compressed tar data after the stub - echo + if test "$QUIET" = "n";then + echo + fi cat "$tmpfile" >> "$archname" chmod +x "$archname" - echo Self-extractible archive \"$archname\" successfully created. + if test "$QUIET" = "n";then + echo Self-extractable archive \"$archname\" successfully created. + fi fi rm -f "$tmpfile" diff -Nru makeself-2.1.5/update-readme makeself-2.2.0/update-readme --- makeself-2.1.5/update-readme 1970-01-01 00:00:00.000000000 +0000 +++ makeself-2.2.0/update-readme 2013-04-13 00:11:05.000000000 +0000 @@ -0,0 +1,7 @@ +#!/bin/sh +# Grab the Makeself web page + +echo The following was generated from http://www.megastep.org/makeself/ > README +echo ----------------------- >> README +echo >> README +lynx -dump http://www.megastep.org/makeself/ >> README