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