README 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. The following was generated from http://www.megastep.org/makeself/
  2. -----------------------
  3. makeself - Make self-extractable archives on Unix
  4. [1]makeself.sh is a small shell script that generates a
  5. self-extractable tar.gz archive from a directory. The resulting file
  6. appears as a shell script (many of those have a .run suffix), and can
  7. be launched as is. The archive will then uncompress itself to a
  8. temporary directory and an optional arbitrary command will be executed
  9. (for example an installation script). This is pretty similar to
  10. archives generated with WinZip Self-Extractor in the Windows world.
  11. Makeself archives also include checksums for integrity self-validation
  12. (CRC and/or MD5 checksums).
  13. The makeself.sh script itself is used only to create the archives from
  14. a directory of files. The resultant archive is actually a compressed
  15. (using gzip, bzip2, or compress) TAR archive, with a small shell
  16. script stub at the beginning. This small stub performs all the steps
  17. of extracting the files, running the embedded command, and removing
  18. the temporary files when it's all over. All what the user has to do to
  19. install the software contained in such an archive is to "run" the
  20. archive, i.e sh nice-software.run. I recommend using the "run" (which
  21. was introduced by some Makeself archives released by Loki Software) or
  22. "sh" suffix for such archives not to confuse the users, since they
  23. know it's actually shell scripts (with quite a lot of binary data
  24. attached to it though!).
  25. I am trying to keep the code of this script as portable as possible,
  26. i.e it's not relying on any bash-specific features and only calls
  27. commands that are installed on any functioning UNIX-compatible system.
  28. This script as well as the archives it generates should run on any
  29. Unix flavor, with any compatible Bourne shell, provided of course that
  30. the compression programs are available.
  31. As of version 2.1, Makeself has been rewritten and tested on the
  32. following platforms :
  33. * Linux (all distributions)
  34. * Sun Solaris (8 tested)
  35. * HP-UX (tested on 11.0 and 11i on HPPA RISC)
  36. * SCO OpenUnix and OpenServer
  37. * IBM AIX 5.1L
  38. * MacOS X (Darwin)
  39. * SGI IRIX 6.5
  40. * FreeBSD
  41. * UnicOS / Cray
  42. If you successfully run Makeself and/or archives created with it on
  43. another system, then [2]let me know!
  44. Examples of publicly available archives made using makeself are :
  45. * Game patches and installers for [3]Id Software games like Quake 3
  46. for Linux or Return To Castle Wolfenstien ;
  47. * All game patches released by [4]Loki Software for the Linux
  48. version of popular games ;
  49. * The [5]nVidia drivers for Linux
  50. * The [6]Makeself distribution itself ;-)
  51. * and countless others...
  52. Important note for Apache users: By default, most Web servers will
  53. think that Makeself archives are regular text files and thus they may
  54. show up as text in a Web browser. The correct way to prevent this is
  55. to add a MIME type for this file format, like so (in httpd.conf) :
  56. AddType application/x-makeself .run
  57. Important note for recent GNU/Linux distributions: Archives created
  58. with Makeself prior to v2.1.2 were using an old syntax for the head
  59. and tail Unix commands that is being progressively obsoleted in their
  60. GNU forms. Therefore you may have problems uncompressing some of these
  61. archives. A workaround for this is to set the environment variable
  62. $_POSIX2_VERSION to enable the old syntax, i.e. :
  63. export _POSIX2_VERSION=199209
  64. Usage
  65. The syntax of makeself is the following:
  66. makeself.sh [args] archive_dir file_name label startup_script
  67. [script_args]
  68. * args are optional options for Makeself. The available ones are :
  69. + --version : Prints the version number on stdout, then exits
  70. immediately
  71. + --gzip : Use gzip for compression (is the default on
  72. platforms on which gzip is commonly available, like Linux)
  73. + --bzip2 : Use bzip2 instead of gzip for better compression.
  74. The bzip2 command must be available in the command path. I
  75. recommend that you set the prefix to something like
  76. '.bz2.run' for the archive, so that potential users know that
  77. they'll need bzip2 to extract it.
  78. + --compress : Use the UNIX "compress" command to compress the
  79. data. This should be the default on all platforms that don't
  80. have gzip available.
  81. + --nocomp : Do not use any compression for the archive, which
  82. will then be an uncompressed TAR.
  83. + --notemp : The generated archive will not extract the files
  84. to a temporary directory, but in a new directory created in
  85. the current directory. This is better to distribute software
  86. packages that may extract and compile by themselves (i.e.
  87. launch the compilation through the embedded script).
  88. + --current : Files will be extracted to the current directory,
  89. instead of in a subdirectory. This option implies --notemp
  90. above.
  91. + --follow : Follow the symbolic links inside of the archive
  92. directory, i.e. store the files that are being pointed to
  93. instead of the links themselves.
  94. + --append (new in 2.1.x): Append data to an existing archive,
  95. instead of creating a new one. In this mode, the settings
  96. from the original archive are reused (compression type,
  97. label, embedded script), and thus don't need to be specified
  98. again on the command line.
  99. + --header : Makeself 2.0 uses a separate file to store the
  100. header stub, called "makeself-header.sh". By default, it is
  101. assumed that it is stored in the same location as
  102. makeself.sh. This option can be used to specify its actual
  103. location if it is stored someplace else.
  104. + --copy : Upon extraction, the archive will first extract
  105. itself to a temporary directory. The main application of this
  106. is to allow self-contained installers stored in a Makeself
  107. archive on a CD, when the installer program will later need
  108. to unmount the CD and allow a new one to be inserted. This
  109. prevents "Filesystem busy" errors for installers that span
  110. multiple CDs.
  111. + --nox11 : Disable the automatic spawning of a new terminal in
  112. X11.
  113. + --nowait : When executed from a new X11 terminal, disable the
  114. user prompt at the end of the script execution.
  115. + --nomd5 and --nocrc : Disable the creation of a MD5 / CRC
  116. checksum for the archive. This speeds up the extraction
  117. process if integrity checking is not necessary.
  118. + --lsm file : Provide and LSM file to makeself, that will be
  119. embedded in the generated archive. LSM files are describing a
  120. software package in a way that is easily parseable. The LSM
  121. entry can then be later retrieved using the '-lsm' argument
  122. to the archive. An exemple of a LSM file is provided with
  123. Makeself.
  124. * archive_dir is the name of the directory that contains the files
  125. to be archived
  126. * file_name is the name of the archive to be created
  127. * label is an arbitrary text string describing the package. It will
  128. be displayed while extracting the files.
  129. * startup_script is the command to be executed from within the
  130. directory of extracted files. Thus, if you wish to execute a
  131. program contain in this directory, you must prefix your command
  132. with "./". For example, ./program will be fine. The script_args
  133. are additionnal arguments for this command.
  134. Here is an example, assuming the user has a package image stored in a
  135. /home/joe/mysoft, and he wants to generate a self-extracting package
  136. named mysoft.sh, which will launch the "setup" script initially stored
  137. in /home/joe/mysoft :
  138. makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package"
  139. ./setup
  140. Here is also how I created the [7]makeself.run archive which contains
  141. the Makeself distribution :
  142. makeself.sh --notemp makeself makeself.run "Makeself by Stephane
  143. Peter" echo "Makeself has extracted itself"
  144. Archives generated with Makeself 2.1 can be passed the following
  145. arguments:
  146. * --keep : Prevent the files to be extracted in a temporary
  147. directory that will be removed after the embedded script's
  148. execution. The files will then be extracted in the current working
  149. directory and will stay here until you remove them.
  150. * --verbose : Will prompt the user before executing the embedded
  151. command
  152. * --target dir : Allows to extract the archive in an arbitrary
  153. place.
  154. * --nox11 : Do not spawn a X11 terminal.
  155. * --confirm : Prompt the user for confirmation before running the
  156. embedded command.
  157. * --info : Print out general information about the archive (does not
  158. extract).
  159. * --lsm : Print out the LSM entry, if it is present.
  160. * --list : List the files in the archive.
  161. * --check : Check the archive for integrity using the embedded
  162. checksums. Does not extract the archive.
  163. * --nochown : By default, a "chown -R" command is run on the target
  164. directory after extraction, so that all files belong to the
  165. current user. This is mostly needed if you are running as root, as
  166. tar will then try to recreate the initial user ownerships. You may
  167. disable this behavior with this flag.
  168. * --tar : Run the tar command on the contents of the archive, using
  169. the following arguments as parameter for the command.
  170. * --noexec : Do not run the embedded script after extraction.
  171. Any subsequent arguments to the archive will be passed as additional
  172. arguments to the embedded command. You should explicitly use the --
  173. special command-line construct before any such options to make sure
  174. that Makeself will not try to interpret them.
  175. License
  176. Makeself is covered by the [8]GNU General Public License (GPL) version
  177. 2 and above. Archives generated by Makeself don't have to be placed
  178. under this license (although I encourage it ;-)), since the archive
  179. itself is merely data for Makeself.
  180. Download
  181. Get the latest official distribution [9]here (version 2.1.3).
  182. The latest development version can be grabbed from the Loki Setup CVS
  183. module, at [10]cvs.icculus.org.
  184. Version history
  185. * v1.0: Initial public release
  186. * v1.1: The archive can be passed parameters that will be passed on
  187. to the embedded script, thanks to John C. Quillan
  188. * v1.2: Cosmetic updates, support for bzip2 compression and
  189. non-temporary archives. Many ideas thanks to Francois Petitjean.
  190. * v1.3: More patches from Bjarni R. Einarsson and Francois
  191. Petitjean: Support for no compression (--nocomp), script is no
  192. longer mandatory, automatic launch in an xterm, optional verbose
  193. output, and -target archive option to indicate where to extract
  194. the files.
  195. * v1.4: Many patches from Francois Petitjean: improved UNIX
  196. compatibility, automatic integrity checking, support of LSM files
  197. to get info on the package at run time..
  198. * v1.5.x: A lot of bugfixes, and many other patches, including
  199. automatic verification through the usage of checksums. Version
  200. 1.5.5 was the stable release for a long time, even though the Web
  201. page didn't get updated ;-). Makeself was also officially made a
  202. part of the [11]Loki Setup installer, and its source is being
  203. maintained as part of this package.
  204. * v2.0: Complete internal rewrite of Makeself. The command-line
  205. parsing was vastly improved, the overall maintenance of the
  206. package was greatly improved by separating the stub from
  207. makeself.sh. Also Makeself was ported and tested to a variety of
  208. Unix platforms.
  209. * v2.0.1: First public release of the new 2.0 branch. Prior versions
  210. are officially obsoleted. This release introduced the '--copy'
  211. argument that was introduced in response to a need for the
  212. [12]UT2K3 Linux installer.
  213. * v2.1.0: Big change : Makeself can now support multiple embedded
  214. tarballs, each stored separately with their own checksums. An
  215. existing archive can be updated with the --append flag. Checksums
  216. are also better managed, and the --nochown option for archives
  217. appeared.
  218. * v2.1.1: Fixes related to the Unix compression (compress command).
  219. Some Linux distributions made the insane choice to make it
  220. unavailable, even though gzip is capable of uncompressing these
  221. files, plus some more bugfixes in the extraction and checksum
  222. code.
  223. * v2.1.2: Some bug fixes. Use head -n to avoid problems with POSIX
  224. conformance.
  225. * v2.1.3: Bug fixes with the command line when spawning terminals.
  226. Added --tar, --noexec for archives. Added --nomd5 and --nomd5 to
  227. avoid creating checksums in archives. The embedded script is now
  228. run through "eval". The --info output now includes the command
  229. used to create the archive. A man page was contributed by Bartosz
  230. Fenski.
  231. Links
  232. * Check out the [13]"Loki setup" installer, used to install many
  233. Linux games and other applications, and of which I am the
  234. co-author. Since the demise of Loki, I am now the official
  235. maintainer of the project, and it is now being hosted on
  236. [14]icculus.org, as well as a bunch of other ex-Loki projects (and
  237. a lot of other good stuff!).
  238. * Bjarni R. Einarsson also wrote the setup.sh installer script,
  239. inspired by Makeself. [15]Check it out !
  240. Contact
  241. This script was written by [16]Stéphane Peter (megastep at
  242. megastep.org) I welcome any enhancements and suggestions.
  243. Contributions were included from John C. Quillan, Bjarni R. Einarsson,
  244. Francois Petitjean, and Ryan C. Gordon, thanks to them! If you think I
  245. forgot your name, don't hesitate to contact me.
  246. icculus.org also has a [17]Bugzilla server available that allows bug
  247. reports to be submitted for Loki setup, and since Makeself is a part
  248. of Loki setup, you can submit bug reports from there!
  249. _________________________________________________________________
  250. [18]Stéphane Peter
  251. Last modified: Sun May 2 00:08:49 PDT 2004
  252. References
  253. 1. http://www.megastep.org/makeself/makeself.run
  254. 2. mailto:megastep@REMOVEME.megastep.org
  255. 3. http://www.idsoftware.com/
  256. 4. http://www.lokigames.com/products/myth2/updates.php3
  257. 5. http://www.nvidia.com/
  258. 6. http://www.megastep.org/makeself/makeself.run
  259. 7. http://www.megastep.org/makeself/makeself.run
  260. 8. http://www.gnu.org/copyleft/gpl.html
  261. 9. http://www.megastep.org/makeself/makeself-2.1.3.run
  262. 10. http://cvs.icculus.org/
  263. 11. http://www.icculus.org/loki_setup/
  264. 12. http://www.unrealtournament2003.com/
  265. 13. http://www.icculus.org/loki_setup/
  266. 14. http://www.icculus.org/
  267. 15. http://www.mmedia.is/~bre/programs/setup.sh/
  268. 16. mailto:megastep@@megastep.org
  269. 17. https://bugzilla.icculus.org/
  270. 18. mailto:megastep@@megastep.org