pax_global_header00006660000000000000000000000064144036045140014513gustar00rootroot0000000000000052 comment=09488c50c6bdc40aec8e3a9b23a539c5054a634c makeself-release-2.5.0/000077500000000000000000000000001440360451400147245ustar00rootroot00000000000000makeself-release-2.5.0/.github/000077500000000000000000000000001440360451400162645ustar00rootroot00000000000000makeself-release-2.5.0/.github/FUNDING.yml000066400000000000000000000000241440360451400200750ustar00rootroot00000000000000github: [megastep] makeself-release-2.5.0/.github/workflows/000077500000000000000000000000001440360451400203215ustar00rootroot00000000000000makeself-release-2.5.0/.github/workflows/build.yml000066400000000000000000000102011440360451400221350ustar00rootroot00000000000000name: CI on: [push, pull_request] jobs: test: runs-on: ${{ matrix.os }} strategy: matrix: include: - os: ubuntu-latest container: 'ubuntu:latest' artifact: 'ubuntu' - os: ubuntu-latest container: 'alpine:latest' artifact: 'alpine' - os: windows-latest artifact: 'windows' - os: macos-latest artifact: 'macos' container: ${{ matrix.container }} steps: - name: Install Ubuntu packages if: matrix.container == 'ubuntu:latest' run: | apt update apt -y install git make pbzip2 binutils bzip2 zstd gnupg - name: Install Alpine packages if: matrix.container == 'alpine:latest' run: apk add --no-cache bash git make libarchive-tools gnupg coreutils binutils bzip2 zstd - name: Install macOS packages if: runner.os == 'macOS' run: brew install pbzip2 coreutils zstd - name: Checkout Makeself uses: actions/checkout@v3 with: submodules: 'true' - name: Build release run: make - uses: actions/upload-artifact@v3 with: name: build-${{ matrix.artifact }} path: release - name: Run tests run: make test test-freebsd: needs: test runs-on: macos-12 name: Test Makeself on FreeBSD steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 - name: Test on FreeBSD uses: vmactions/freebsd-vm@v0 with: usesh: true prepare: pkg install -y pbzip2 run: | pwd; freebsd-version sh ./test/run-makeself.sh test-openbsd: needs: test runs-on: macos-12 name: Test Makeself on OpenBSD steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 - name: Test on OpenBSD uses: vmactions/openbsd-vm@v0 with: usesh: true prepare: pkg_add pbzip2 run: | pwd sh ./test/run-makeself.sh test-netbsd: needs: test runs-on: macos-12 name: Test Makeself on NetBSD steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 - name: Test on NetBSD uses: vmactions/netbsd-vm@v0 with: usesh: true prepare: pkg_add pbzip2 run: | pwd sh ./test/run-makeself.sh test-solaris: needs: test runs-on: macos-12 name: Test Makeself on Solaris steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 - name: Test on Solaris uses: vmactions/solaris-vm@v0 with: mem: 2048 prepare: pkgutil -y -i pbzip2 run: | pwd sh ./test/run-makeself.sh test-alpine: needs: test name: Test Makeself on Alpine runs-on: ubuntu-latest container: alpine:latest steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 - name: Test on Alpine run: sh ./test/run-makeself.sh test-nanoserver: needs: test name: Test Makeself on Nanoserver runs-on: windows-2022 env: IMAGE_NAME: mcr.microsoft.com/windows/nanoserver:ltsc2022-amd64 steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 - name: pull windows container ${{ env.IMAGE_NAME }} shell: cmd run: | docker pull ${{ env.IMAGE_NAME }} docker images ${{ env.IMAGE_NAME }} - name: download tools shell: cmd run: curl --fail --silent --show-error --remote-name --location "https://frippery.org/files/busybox/busybox64.exe" - name: Test on Nanoserver shell: cmd run: docker container run --rm --env CI=true -v ${{ github.workspace }}:C:\app -w C:\app ${{ env.IMAGE_NAME }} C:\app\busybox64.exe sh ./test/run-makeself.sh lint: runs-on: ubuntu-latest steps: - name: Checkout Makeself uses: actions/checkout@v3 - name: Run ShellCheck uses: megastep/shell-linter@develop with: path: "makeself.sh" severity: "error" makeself-release-2.5.0/.github/workflows/release.yml000066400000000000000000000010741440360451400224660ustar00rootroot00000000000000name: Release on: release: types: [created, published, prereleased] jobs: build: runs-on: ubuntu-latest steps: - name: Install Linux packages run: sudo env DEBIAN_FRONTEND=noninteractive apt-get -qq -y install pbzip2 - name: Checkout Makeself uses: actions/checkout@v2 - name: Build release run: | git submodule update --init --recursive make - name: Upload to release uses: fnkr/github-action-ghr@v1 env: GHR_PATH: release/ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} makeself-release-2.5.0/.gitignore000066400000000000000000000000371440360451400167140ustar00rootroot00000000000000_site *.run .*-cache/ release/ makeself-release-2.5.0/.gitmodules000066400000000000000000000001301440360451400170730ustar00rootroot00000000000000[submodule "test/shunit2"] path = test/shunit2 url = https://github.com/kward/shunit2 makeself-release-2.5.0/COPYING000066400000000000000000000432541440360451400157670ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 of the License, or (at your option) any later version. This program 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. makeself-release-2.5.0/Makefile000066400000000000000000000004471440360451400163710ustar00rootroot00000000000000.PHONY: all clean test help VERSION := $(shell cat VERSION) OUTPUT := makeself-$(VERSION).run all: $(OUTPUT) $(OUTPUT): makeself.sh makeself-header.sh VERSION ./make-release.sh clean: $(RM) makeself-*.run test: ./test/run-tests.sh help: $(info Targets: all $(OUTPUT) clean test help) makeself-release-2.5.0/README.md000066400000000000000000000533541440360451400162150ustar00rootroot00000000000000[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) ![Build Status](https://github.com/megastep/makeself/workflows/CI/badge.svg) # 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/SHA256 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. 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 * macOS (Darwin) * SGI IRIX 6.5 * FreeBSD * OpenBSD * NetBSD * UnicOS / Cray * Windows (Cygwin, WSL) 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 Wolfenstein ; * 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: ```sh 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 extension be set to something like '.bz2.run', so that potential users know that they'll need bzip2 to extract it. * **`--bzip3`** : Use bzip3 instead of gzip for better compression. * **`--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 extension 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 extension be set to something like '.xz.run' for the archive, so that potential users know that they'll need xz to extract it. * **`--lzo`** : Use lzop instead of gzip for better compression. The lzop command must be available in the command path. It is recommended that the archive extension be set to something like `.lzo.run` for the archive, so that potential users know that they'll need lzop to extract it. * **`--lz4`** : Use lz4 instead of gzip for better compression. The lz4 command must be available in the command path. It is recommended that the archive extension be set to something like '.lz4.run' for the archive, so that potential users know that they'll need lz4 to extract it. * **`--zstd`** : Use zstd instead of gzip for better compression. The zstd command must be available in the command path. It is recommended that the archive extension be set to something like '.zstd.run' for the archive, so that potential users know that they'll need zstd to extract it. * **`--pigz`** : Use pigz for compression. * **`--base64`** : Encode the archive to ASCII in Base64 format instead of compressing (base64 command required). * **`--gpg-encrypt`** : Encrypt the archive using `gpg -ac -z $COMPRESS_LEVEL`. This will prompt for a password to encrypt with. Assumes that potential users have `gpg` installed. * **`--ssl-encrypt`** : Encrypt the archive using `openssl aes-256-cbc -a -salt`. This will prompt for a password to encrypt with. Assumes that the potential users have the OpenSSL tools installed. * **`--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, zstd, xz, lzo or lz4. (defaults to 9) * **`--threads`** : Specify the number of threads to be used by compressors that support parallelization. Omit to use compressor's default. Most useful (and required) for opting into xz's threading, usually with `--threads=0` for all available cores. pbzip2 and pigz are parallel by default, and setting this value allows limiting the number of threads they use. * **`--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 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. * **`--cleanup`** : Specify a script that is run when execution is interrupted or finishes successfully. The script is executed with the same environment and initial `script_args` as `startup_script`. * **`--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. * **`--sha256`** : Adds a SHA256 checksum for the archive. This is in addition to the MD5 / CRC checksums unless `--nomd5` is also used. * **`--lsm` _file_** : Provide a Linux Software Map (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 example of a LSM file is provided with Makeself. * **`--tar-format opt`** : Specify the tar archive format (default is ustar); you may use any value accepted by your tar command (such as posix, v7, etc). * **`--tar-extra opt`** : Append more options to the tar command line. For instance, in order to exclude the `.git` directory from the packaged archive directory using the GNU `tar`, one can use `makeself.sh --tar-extra "--exclude=.git" ...` * **`--keep-umask`** : Keep the umask set to shell default, rather than overriding when executing the self-extracting archive. * **`--packaging-date date`** : Use provided string as the packaging date instead of the current date. * **`--license` _file_** : Append a license file. * **`--nooverwrite`** : Do not extract the archive if the specified target directory already exists. * **`--help-header` _file_** : Add a header to the archive's `--help` output. * `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 contained in this directory, you must prefix your command with `./`. For example, `./program` will be fine. The `script_args` are additional arguments for this command. Note that `startup_script` and its arguments are not strictly required for archives that don't extract in a temporary directory (i.e. when using `--notemp`). 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 : ```sh makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package" ./setup ``` Here is also how I created the [makeself.run][9] 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 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. * **`--noexec-cleanup`** : Do not run the embedded cleanup script. * **`--nodiskspace`** : Do not check for available disk space before attempting to extract. * **`--cleanup-args`** : Specify arguments to be passed to the cleanup script. Wrap value in quotes to specify multiple arguments. Any subsequent arguments to the archive will be passed as additional arguments to the embedded command. You must explicitly use the `--` special command-line construct before any such options to make sure that Makeself will not try to interpret them. ## Startup Script The startup script must be a regular Shell script. Within the startup script, you can use the `$USER_PWD` variable to get the path of the folder from which the self-extracting script is executed. This is especially useful to access files that are located in the same folder as the script, as shown in the example below. ```sh my-self-extracting-script.sh --fooBarFileParameter foo.bar ``` ## Building and Testing Clone the git repo and execute `git submodule update --init --recursive` to obtain all submodules. * To make a release: `make` * To run all tests: `make test` ## Maven Usage Makeself is now supported by the following maven plugin [makeself-maven-plugin](https://github.com/hazendaz/makeself-maven-plugin). Please refer to project for usage and report any bugs in regards to maven plugin on that project. ## License Makeself itself 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. ## Contributing I will gladly consider merging your pull requests on the [GitHub][10] repository. However, please keep the following in mind: * One of the main purposes of Makeself is portability. Do not submit patches that will break supported platforms. The more platform-agnostic, the better. * Please explain clearly what the purpose of the patch is, and how you achieved it. ## Download Get the latest official distribution [here][9] (version 2.5.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 spinning 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. * **v2.3.0:** Support for archive encryption via GPG or OpenSSL. Added LZO and LZ4 compression support. Options to set the packaging date and stop the umask from being overriden. Optionally ignore check for available disk space when extracting. New option to check for root permissions before extracting. * **v2.3.1:** Various compatibility updates. Added unit tests for Travis CI in the GitHub repo. New `--tar-extra`, `--untar-extra`, `--gpg-extra`, `--gpg-asymmetric-encrypt-sign` options. * **v2.4.0:** Added optional support for SHA256 archive integrity checksums. * **v2.4.2:** New --cleanup and --cleanup-args arguments for cleanup scripts. Added threading support for supported compressors. Now supports zstd compression. * **v2.4.3:** Make explicit POSIX tar archives for increased compatibility. * **v2.4.4:** Fixed various compatibility issues (no longer use POSIX tar archives), Github Actions to check on Solaris and FreeBSD. * **v2.4.5:** Added `--tar-format` option to set the tar archive format (default is ustar) * **v2.5.0:** Expended support to NetBSD, OpenBSD, Busybox and other minimal distributions such as Alpine Linux. Added bzip3 compression support and expanded GPG arguments. ## 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 here on GitHub. * 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][15] (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]: http://makeself.io/ [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]: https://github.com/megastep/makeself/releases/download/release-2.5.0/makeself-2.5.0.run [10]: https://github.com/megastep/makeself [11]: https://github.com/megastep/loki_setup/ [12]: http://www.unrealtournament2003.com/ [13]: http://www.icculus.org/ [14]: http://bre.klaki.net/programs/setup.sh/ [15]: https://stephanepeter.com/ makeself-release-2.5.0/VERSION000066400000000000000000000000061440360451400157700ustar00rootroot000000000000002.5.0 makeself-release-2.5.0/make-release.sh000077500000000000000000000005031440360451400176140ustar00rootroot00000000000000#!/bin/sh # # Create a distributable archive of the current version of Makeself VER=`cat VERSION` mkdir -p /tmp/makeself-$VER release cp -pPR makeself* README.md COPYING VERSION /tmp/makeself-$VER/ ./makeself.sh --notemp /tmp/makeself-$VER release/makeself-$VER.run "Makeself v$VER" echo "Makeself has extracted itself" makeself-release-2.5.0/makeself-header.sh000077500000000000000000000454071440360451400203120ustar00rootroot00000000000000cat << EOF > "$archname" #!/bin/sh # This script was generated using Makeself $MS_VERSION # The license covering this archive and its contents, if any, is wholly independent of the Makeself license (GPL) ORIG_UMASK=\`umask\` if test "$KEEP_UMASK" = n; then umask 077 fi CRCsum="$CRCsum" MD5="$MD5sum" SHA="$SHAsum" SIGNATURE="$Signature" TMPROOT=\${TMPDIR:=/tmp} USER_PWD="\$PWD" export USER_PWD ARCHIVE_DIR=\`dirname "\$0"\` export ARCHIVE_DIR label="$LABEL" script="$SCRIPT" scriptargs="$SCRIPTARGS" cleanup_script="${CLEANUP_SCRIPT}" licensetxt="$LICENSE" helpheader="${HELPHEADER}" targetdir="$archdirname" filesizes="$filesizes" totalsize="$totalsize" keep="$KEEP" nooverwrite="$NOOVERWRITE" quiet="n" accept="n" nodiskspace="n" export_conf="$EXPORT_CONF" decrypt_cmd="$DECRYPT_CMD" skip="$SKIP" print_cmd_arg="" if type printf > /dev/null; then print_cmd="printf" elif test -x /usr/ucb/echo; then print_cmd="/usr/ucb/echo" else print_cmd="echo" fi if test -d /usr/xpg4/bin; then PATH=/usr/xpg4/bin:\$PATH export PATH fi if test -d /usr/sfw/bin; then PATH=\$PATH:/usr/sfw/bin export PATH fi unset CDPATH MS_Printf() { \$print_cmd \$print_cmd_arg "\$1" } MS_PrintLicense() { PAGER=\${PAGER:=more} if test x"\$licensetxt" != x; then PAGER_PATH=\`exec <&- 2>&-; which \$PAGER || command -v \$PAGER || type \$PAGER\` if test -x "\$PAGER_PATH"; then echo "\$licensetxt" | \$PAGER else echo "\$licensetxt" fi if test x"\$accept" != xy; then 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 fi } MS_diskspace() { ( df -k "\$1" | tail -1 | awk '{ if (\$4 ~ /%/) {print \$3} else {print \$4} }' ) } MS_dd() { blocks=\`expr \$3 / 1024\` bytes=\`expr \$3 % 1024\` # Test for ibs, obs and conv feature if dd if=/dev/zero of=/dev/null count=1 ibs=512 obs=512 conv=sync 2> /dev/null; then dd if="\$1" ibs=\$2 skip=1 obs=1024 conv=sync 2> /dev/null | \\ { test \$blocks -gt 0 && dd ibs=1024 obs=1024 count=\$blocks ; \\ test \$bytes -gt 0 && dd ibs=1 obs=1024 count=\$bytes ; } 2> /dev/null else dd if="\$1" bs=\$2 skip=1 2> /dev/null fi } MS_dd_Progress() { if test x"\$noprogress" = xy; 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 ibs=\$offset skip=1 count=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 Makeself version $MS_VERSION 1) Getting help or info about \$0 : \$0 --help Print this message \$0 --info Print embedded info : title, default target directory, embedded script ... \$0 --lsm Print embedded lsm entry (or no LSM) \$0 --list Print the list of files in the archive \$0 --check Checks integrity of the archive \$0 --verify-sig key Verify signature agains a provided key id 2) Running \$0 : \$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 --accept Accept the license --noexec Do not run embedded script (implies --noexec-cleanup) --noexec-cleanup Do not run embedded cleanup 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 target folder to the current user --chown Give the target folder to the current user recursively --nodiskspace Do not check for available disk space --target dir Extract directly to a target directory (absolute or relative) This directory may undergo recursive chown (see --nochown). --tar arg1 [arg2 ...] Access the contents of the archive through the tar command --ssl-pass-src src Use the given src as the source of password to decrypt the data using OpenSSL. See "PASS PHRASE ARGUMENTS" in man openssl. Default is to prompt the user to enter decryption password on the current terminal. --cleanup-args args Arguments to the cleanup script. Wrap in quotes to provide multiple arguments. -- Following arguments will be passed to the embedded script\${helpheader} EOH } MS_Verify_Sig() { GPG_PATH=\`exec <&- 2>&-; which gpg || command -v gpg || type gpg\` MKTEMP_PATH=\`exec <&- 2>&-; which mktemp || command -v mktemp || type mktemp\` test -x "\$GPG_PATH" || GPG_PATH=\`exec <&- 2>&-; which gpg || command -v gpg || type gpg\` test -x "\$MKTEMP_PATH" || MKTEMP_PATH=\`exec <&- 2>&-; which mktemp || command -v mktemp || type mktemp\` offset=\`head -n "\$skip" "\$1" | wc -c | sed "s/ //g"\` temp_sig=\`mktemp -t XXXXX\` echo \$SIGNATURE | base64 --decode > "\$temp_sig" gpg_output=\`MS_dd "\$1" \$offset \$totalsize | LC_ALL=C "\$GPG_PATH" --verify "\$temp_sig" - 2>&1\` gpg_res=\$? rm -f "\$temp_sig" if test \$gpg_res -eq 0 && test \`echo \$gpg_output | grep -c Good\` -eq 1; then if test \`echo \$gpg_output | grep -c \$sig_key\` -eq 1; then test x"\$quiet" = xn && echo "GPG signature is good" >&2 else echo "GPG Signature key does not match" >&2 exit 2 fi else test x"\$quiet" = xn && echo "GPG signature failed to verify" >&2 exit 2 fi } MS_Check() { 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 || command -v md5sum || type md5sum\` test -x "\$MD5_PATH" || MD5_PATH=\`exec <&- 2>&-; which md5 || command -v md5 || type md5\` test -x "\$MD5_PATH" || MD5_PATH=\`exec <&- 2>&-; which digest || command -v digest || type digest\` PATH="\$OLD_PATH" SHA_PATH=\`exec <&- 2>&-; which shasum || command -v shasum || type shasum\` test -x "\$SHA_PATH" || SHA_PATH=\`exec <&- 2>&-; which sha256sum || command -v sha256sum || type sha256sum\` if test x"\$quiet" = xn; then MS_Printf "Verifying archive integrity..." fi offset=\`head -n "\$skip" "\$1" | wc -c | sed "s/ //g"\` fsize=\`cat "\$1" | wc -c | sed "s/ //g"\` if test \$totalsize -ne \`expr \$fsize - \$offset\`; then echo " Unexpected archive size." >&2 exit 2 fi verb=\$2 i=1 for s in \$filesizes do crc=\`echo \$CRCsum | cut -d" " -f\$i\` if test -x "\$SHA_PATH"; then if test x"\`basename \$SHA_PATH\`" = xshasum; then SHA_ARG="-a 256" fi sha=\`echo \$SHA | cut -d" " -f\$i\` if test x"\$sha" = x0000000000000000000000000000000000000000000000000000000000000000; then test x"\$verb" = xy && echo " \$1 does not contain an embedded SHA256 checksum." >&2 else shasum=\`MS_dd_Progress "\$1" \$offset \$s | eval "\$SHA_PATH \$SHA_ARG" | cut -b-64\`; if test x"\$shasum" != x"\$sha"; then echo "Error in SHA256 checksums: \$shasum is different from \$sha" >&2 exit 2 elif test x"\$quiet" = xn; then MS_Printf " SHA256 checksums are OK." >&2 fi crc="0000000000"; fi fi if test -x "\$MD5_PATH"; then if test x"\`basename \$MD5_PATH\`" = xdigest; then MD5_ARG="-a md5" fi md5=\`echo \$MD5 | cut -d" " -f\$i\` if test x"\$md5" = x00000000000000000000000000000000; then test x"\$verb" = xy && echo " \$1 does not contain an embedded MD5 checksum." >&2 else md5sum=\`MS_dd_Progress "\$1" \$offset \$s | eval "\$MD5_PATH \$MD5_ARG" | cut -b-32\`; if test x"\$md5sum" != x"\$md5"; then echo "Error in MD5 checksums: \$md5sum is different from \$md5" >&2 exit 2 elif test x"\$quiet" = xn; then MS_Printf " MD5 checksums are OK." >&2 fi crc="0000000000"; verb=n fi fi if test x"\$crc" = x0000000000; then test x"\$verb" = xy && echo " \$1 does not contain a CRC checksum." >&2 else sum1=\`MS_dd_Progress "\$1" \$offset \$s | CMD_ENV=xpg4 cksum | awk '{print \$1}'\` if test x"\$sum1" != x"\$crc"; then echo "Error in checksums: \$sum1 is different from \$crc" >&2 exit 2 elif test x"\$quiet" = xn; then MS_Printf " CRC checksums are OK." >&2 fi fi i=\`expr \$i + 1\` offset=\`expr \$offset + \$s\` done if test x"\$quiet" = xn; then echo " All good." fi } MS_Decompress() { if test x"\$decrypt_cmd" != x""; then { eval "\$decrypt_cmd" || echo " ... Decryption failed." >&2; } | eval "$GUNZIP_CMD" else eval "$GUNZIP_CMD" fi if test \$? -ne 0; then echo " ... Decompression failed." >&2 fi } UnTAR() { if test x"\$quiet" = xn; then tar \$1vf - $UNTAR_EXTRA 2>&1 || { echo " ... Extraction failed." >&2; kill -15 \$$; } else tar \$1f - $UNTAR_EXTRA 2>&1 || { echo Extraction failed. >&2; kill -15 \$$; } fi } MS_exec_cleanup() { if test x"\$cleanup" = xy && test x"\$cleanup_script" != x""; then cleanup=n cd "\$tmpdir" eval "\"\$cleanup_script\" \$scriptargs \$cleanupargs" fi } MS_cleanup() { echo 'Signal caught, cleaning up' >&2 MS_exec_cleanup cd "\$TMPROOT" rm -rf "\$tmpdir" eval \$finish; exit 15 } finish=true xterm_loop= noprogress=$NOPROGRESS nox11=$NOX11 copy=$COPY ownership=$OWNERSHIP verbose=n cleanup=y cleanupargs= sig_key= initargs="\$@" while true do case "\$1" in -h | --help) MS_Help exit 0 ;; -q | --quiet) quiet=y noprogress=y shift ;; --accept) accept=y shift ;; --info) echo Identification: "\$label" echo Target directory: "\$targetdir" echo Uncompressed size: $USIZE KB echo Compression: $COMPRESS if test x"$ENCRYPT" != x""; then echo Encryption: $ENCRYPT fi echo Date of packaging: $DATE echo Built with Makeself version $MS_VERSION echo Build command was: "$MS_COMMAND" if test x"\$script" != x; then echo Script run after extraction: echo " " \$script \$scriptargs fi if test x"$copy" = xcopy; then echo "Archive will copy itself to a temporary location" fi if test x"$NEED_ROOT" = xy; then echo "Root permissions required for extraction" fi if test x"$KEEP" = xy; then echo "directory \$targetdir is permanent" else echo "\$targetdir will be removed after extraction" fi exit 0 ;; --dumpconf) echo LABEL=\"\$label\" echo SCRIPT=\"\$script\" echo SCRIPTARGS=\"\$scriptargs\" echo CLEANUPSCRIPT=\"\$cleanup_script\" echo archdirname=\"$archdirname\" echo KEEP=$KEEP echo NOOVERWRITE=$NOOVERWRITE echo COMPRESS=$COMPRESS echo filesizes=\"\$filesizes\" echo totalsize=\"\$totalsize\" echo CRCsum=\"\$CRCsum\" echo MD5sum=\"\$MD5sum\" echo SHAsum=\"\$SHAsum\" echo SKIP=\"\$skip\" exit 0 ;; --lsm) cat << EOLSM EOF eval "$LSM_CMD" cat << EOF >> "$archname" EOLSM exit 0 ;; --list) echo Target directory: \$targetdir offset=\`head -n "\$skip" "\$0" | wc -c | sed "s/ //g"\` for s in \$filesizes do MS_dd "\$0" \$offset \$s | MS_Decompress | UnTAR t offset=\`expr \$offset + \$s\` done exit 0 ;; --tar) offset=\`head -n "\$skip" "\$0" | wc -c | sed "s/ //g"\` arg1="\$2" shift 2 || { MS_Help; exit 1; } for s in \$filesizes do MS_dd "\$0" \$offset \$s | MS_Decompress | tar "\$arg1" - "\$@" offset=\`expr \$offset + \$s\` done exit 0 ;; --check) MS_Check "\$0" y exit 0 ;; --verify-sig) sig_key="\$2" shift 2 || { MS_Help; exit 1; } MS_Verify_Sig "\$0" ;; --confirm) verbose=y shift ;; --noexec) script="" cleanup_script="" shift ;; --noexec-cleanup) cleanup_script="" shift ;; --keep) keep=y shift ;; --target) keep=y targetdir="\${2:-.}" shift 2 || { MS_Help; exit 1; } ;; --noprogress) noprogress=y shift ;; --nox11) nox11=y shift ;; --nochown) ownership=n shift ;; --chown) ownership=y shift ;; --nodiskspace) nodiskspace=y shift ;; --xwin) if test "$NOWAIT" = n; then finish="echo Press Return to close this window...; read junk" fi xterm_loop=1 shift ;; --phase2) copy=phase2 shift ;; --ssl-pass-src) if test x"$ENCRYPT" != x"openssl"; then echo "Invalid option --ssl-pass-src: \$0 was not encrypted with OpenSSL!" >&2 exit 1 fi decrypt_cmd="\$decrypt_cmd -pass \$2" shift 2 || { MS_Help; exit 1; } ;; --cleanup-args) cleanupargs="\$2" shift 2 || { MS_Help; exit 1; } ;; --) shift break ;; -*) echo Unrecognized flag : "\$1" >&2 MS_Help exit 1 ;; *) break ;; esac done if test x"\$quiet" = xy -a x"\$verbose" = xy; then echo Cannot be verbose and quiet at the same time. >&2 exit 1 fi if test x"$NEED_ROOT" = xy -a \`id -u\` -ne 0; then echo "Administrative privileges required for this archive (use su or sudo)" >&2 exit 1 fi if test x"\$copy" \!= xphase2; then MS_PrintLicense fi case "\$copy" in copy) tmpdir="\$TMPROOT"/makeself.\$RANDOM.\`date +"%y%m%d%H%M%S"\`.\$\$ mkdir "\$tmpdir" || { echo "Could not create temporary directory \$tmpdir" >&2 exit 1 } SCRIPT_COPY="\$tmpdir/makeself" echo "Copying to a temporary location..." >&2 cp "\$0" "\$SCRIPT_COPY" chmod +x "\$SCRIPT_COPY" cd "\$TMPROOT" export USER_PWD="\$tmpdir" exec "\$SCRIPT_COPY" --phase2 -- \$initargs ;; phase2) finish="\$finish ; rm -rf \`dirname \$0\`" ;; esac if test x"\$nox11" = xn; then if test -t 1; then # Do we have a terminal on stdout? : else if test x"\$DISPLAY" != x -a x"\$xterm_loop" = x; then # No, but do we have X? if xset q > /dev/null 2>&1; then # Check for valid DISPLAY variable GUESS_XTERMS="xterm gnome-terminal rxvt dtterm eterm Eterm xfce4-terminal lxterminal kvt konsole aterm terminology" for a in \$GUESS_XTERMS; do if type \$a >/dev/null 2>&1; then XTERM=\$a break fi done chmod a+x \$0 || echo Please add execution rights on \$0 >&2 if test \`echo "\$0" | cut -c1\` = "/"; then # Spawn a terminal! exec \$XTERM -e "\$0 --xwin \$initargs" else exec \$XTERM -e "./\$0 --xwin \$initargs" fi fi fi fi fi if test x"\$targetdir" = x.; then tmpdir="." else if test x"\$keep" = xy; then if test x"\$nooverwrite" = xy && test -d "\$targetdir"; then echo "Target directory \$targetdir already exists, aborting." >&2 exit 1 fi if test x"\$quiet" = xn; then echo "Creating directory \$targetdir" >&2 fi tmpdir="\$targetdir" dashp="-p" else tmpdir="\$TMPROOT/selfgz\$\$\$RANDOM" dashp="" fi mkdir \$dashp "\$tmpdir" || { echo 'Cannot create target directory' \$tmpdir >&2 echo 'You should try option --target dir' >&2 eval \$finish exit 1 } fi location="\`pwd\`" if test x"\$SETUP_NOCHECK" != x1; then MS_Check "\$0" fi offset=\`head -n "\$skip" "\$0" | wc -c | sed "s/ //g"\` if test x"\$verbose" = xy; then MS_Printf "About to extract $USIZE KB in \$tmpdir ... Proceed ? [Y/n] " read yn if test x"\$yn" = xn; then eval \$finish; exit 1 fi fi if test x"\$quiet" = xn; then # Decrypting with openssl will ask for password, # the prompt needs to start on new line if test x"$ENCRYPT" = x"openssl"; then echo "Decrypting and uncompressing \$label..." else MS_Printf "Uncompressing \$label" fi fi res=3 if test x"\$keep" = xn; then trap MS_cleanup 1 2 3 15 fi if test x"\$nodiskspace" = xn; then leftspace=\`MS_diskspace "\$tmpdir"\` 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 echo "Use --nodiskspace option to skip this check and proceed anyway" >&2 if test x"\$keep" = xn; then echo "Consider setting TMPDIR to a directory with more free space." fi eval \$finish; exit 1 fi fi fi for s in \$filesizes do if MS_dd_Progress "\$0" \$offset \$s | MS_Decompress | ( cd "\$tmpdir"; umask \$ORIG_UMASK ; UnTAR xp ) 1>/dev/null; then if test x"\$ownership" = xy; then (cd "\$tmpdir"; chown -R \`id -u\` .; chgrp -R \`id -g\` .) fi else echo >&2 echo "Unable to decompress \$0" >&2 eval \$finish; exit 1 fi offset=\`expr \$offset + \$s\` done if test x"\$quiet" = xn; then echo fi cd "\$tmpdir" res=0 if test x"\$script" != x; then if test x"\$export_conf" = x"y"; then MS_BUNDLE="\$0" MS_LABEL="\$label" MS_SCRIPT="\$script" MS_SCRIPTARGS="\$scriptargs" MS_ARCHDIRNAME="\$archdirname" MS_KEEP="\$KEEP" MS_NOOVERWRITE="\$NOOVERWRITE" MS_COMPRESS="\$COMPRESS" MS_CLEANUP="\$cleanup" export MS_BUNDLE MS_LABEL MS_SCRIPT MS_SCRIPTARGS export MS_ARCHDIRNAME MS_KEEP MS_NOOVERWRITE MS_COMPRESS fi if test x"\$verbose" = x"y"; then MS_Printf "OK to execute: \$script \$scriptargs \$* ? [Y/n] " read yn if test x"\$yn" = x -o x"\$yn" = xy -o x"\$yn" = xY; then eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$?; fi else eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$? fi if test "\$res" -ne 0; then test x"\$verbose" = xy && echo "The program '\$script' returned an error code (\$res)" >&2 fi fi MS_exec_cleanup if test x"\$keep" = xn; then cd "\$TMPROOT" rm -rf "\$tmpdir" fi eval \$finish; exit \$res EOF makeself-release-2.5.0/makeself.1000066400000000000000000000107711440360451400166030ustar00rootroot00000000000000.TH "MAKESELF" "1" "2.5.0" .SH "NAME" makeself \- An utility to generate self-extractable archives. .SH "SYNTAX" .B makeself [\fIoptions\fP] archive_dir file_name label .B [\fIstartup_script\fP] [\fIargs\fP] .SH "DESCRIPTION" This program is a free (GPL) shell utility designed to create self-extractable compressed archives from a directory. The resulting file appears as a shell script, 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). .TP Makeself archives also include checksums for integrity self-validation (CRC and/or MD5/SHA256 checksums). .SH "OPTIONS" The following options are supported: .TP 15 .B -v, --version Prints out the makeself version number and exits. .TP .B -h, --help Print out help information. .TP .B --tar-quietly Suppress verbose output from the tar command .TP .B --quiet Do not print any messages other than errors .TP .B --gzip Compress using gzip (default if detected). .TP .B --bzip2 Compress using bzip2. .TP .B --bzip3 Compress using bzip3. .TP .B --pbzip2 Compress using pbzip2. .TP .B --xz Compress using xz. .TP .B --lzo Compress using lzop. .TP .B --lz4 Compress using lz4. .TP .B --pigz Compress using pigz. .TP .B --zstd Compress using zstd. .TP .B --base64 Encode the archive to ASCII in Base64 format instead of compressing (base64 command required). .TP .B --gpg-encrypt Encrypt the archive using GPG. This will prompt for a password to encrypt with. .TP .B --ssl-encrypt Encrypt the archive using OpenSSL. This will prompt for a password to encrypt with. .TP .B --keep-umask Keep the umask set to shell default, rather than overriding when executing the self-extracting archive. .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, pbzip2, xz, zstd, lzo or lz4. Defaults to 9. .TP .B --threads num Specify the number of threads to be used by compressors that support parallelization. .TP .B --tar-format opt Specify the tar archive format (default is ustar); you may use any value accepted by your tar command (such as posix, v7, etc). .TP .B --tar-extra opt Append more options to the tar command line. .TP .B --notemp The archive will create archive_dir in the current directory and uncompress in ./archive_dir. .TP .B --copy 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. .TP .B --current 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. .TP .B --help-header file Add a header to the archive's help output. .TP .B --cleanup file Specify a cleanup script that executes on interrupt and when finished successfully. .TP .B --follow Follow the symlinks in the archive. .TP .B --noprogress Do not show the progress during the decompression. .TP .B --nooverwrite Do not extract the archive if the target directory already exists. .TP .B --nox11 Disable automatic spawn of an xterm if running in X11. .TP .B --nowait Do not wait for user input after executing embedded program from an xterm. .TP .B --nomd5 Do not create a MD5 checksum for the archive. .TP .B --sha256 Adds a SHA256 checksum for the archive. .TP .B --nocrc Do not create a CRC32 checksum for the archive. .TP .B --lsm file LSM file describing the package. .TP .B --license file Append a license file. .TP .B --packaging-date date Use provided string as the packaging date instead of the current date. .TP .SH "EXAMPLES" 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: .TP makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package" ./setup .TP Here is also how I created the makeself.run archive which contains the Makeself distribution: .TP makeself.sh --notemp makeself makeself.run "Makeself by Stephane Peter" echo "Makeself has extracted itself" .SH "AUTHORS" Makeself has been written by Stephane Peter . .BR This man page was originally written by Bartosz Fenski for the Debian GNU/Linux distribution (but it may be used by others). makeself-release-2.5.0/makeself.sh000077500000000000000000000513541440360451400170620ustar00rootroot00000000000000#!/bin/sh # # Makeself version 2.5.x # by Stephane Peter # # 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 # directory and then executes a given script from withing that directory. # # Makeself home page: https://makeself.io/ - Version history available on GitHub # # (C) 1998-2023 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 # Self-extracting archives created with this script are explictly NOT released under the term of the GPL # MS_VERSION=2.5.0 MS_COMMAND="$0" unset CDPATH for f in ${1+"$@"}; do MS_COMMAND="$MS_COMMAND \\\\ \\\"$f\\\"" done # For Solaris systems if test -d /usr/xpg4/bin; then PATH=/usr/xpg4/bin:$PATH export PATH fi # Procedures MS_Usage() { echo "Usage: $0 [args] archive_dir file_name label startup_script [script_args]" echo "args 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 " --tar-quietly : Suppress verbose output from the tar command" echo " --quiet | -q : Do not print any messages other than errors." echo " --gzip : Compress using gzip (default if detected)" echo " --pigz : Compress with pigz" echo " --zstd : Compress with zstd" echo " --bzip2 : Compress using bzip2 instead of gzip" echo " --pbzip2 : Compress using pbzip2 instead of gzip" echo " --bzip3 : Compress using bzip3 instead of gzip" echo " --xz : Compress using xz instead of gzip" echo " --lzo : Compress using lzop instead of gzip" echo " --lz4 : Compress using lz4 instead of gzip" echo " --compress : Compress using the UNIX 'compress' command" echo " --complevel lvl : Compression level for gzip pigz zstd xz lzo lz4 bzip2 pbzip2 and bzip3 (default 9)" echo " --threads thds : Number of threads to be used by compressors that support parallelization." echo " Omit to use compressor's default. Most useful (and required) for opting" echo " into xz's threading, usually with '--threads=0' for all available cores." echo " pbzip2 and pigz are parallel by default, and setting this value allows" echo " limiting the number of threads they use." echo " --base64 : Instead of compressing, encode the data using base64" echo " --gpg-encrypt : Instead of compressing, encrypt the data using GPG" echo " --gpg-asymmetric-encrypt-sign" echo " : Instead of compressing, asymmetrically encrypt and sign the data using GPG" echo " --gpg-extra opt : Append more options to the gpg command line" echo " --ssl-encrypt : Instead of compressing, encrypt the data using OpenSSL" echo " --ssl-passwd pass : Use the given password to encrypt the data using OpenSSL" echo " --ssl-pass-src src : Use the given src as the source of password to encrypt the data" echo " using OpenSSL. See \"PASS PHRASE ARGUMENTS\" in man openssl." echo " If this option is not supplied, the user will be asked to enter" echo " encryption password on the current terminal." echo " --ssl-no-md : Do not use \"-md\" option not supported by older OpenSSL." echo " --nochown : Do not give the target folder to the current user (default)" echo " --chown : Give the target folder to the current user recursively" echo " --nocomp : Do not compress the data" echo " --notemp : The archive will create archive_dir in the current directory" echo " and uncompress in ./archive_dir" echo " Note: persistent archives do not strictly require a startup_script" echo " --needroot : Check that the root user is extracting the archive before proceeding" echo " --copy : Upon extraction, the archive will first copy itself to" 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 " --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, and do not require a startup_script" echo " --nooverwrite : Do not extract the archive if the specified target directory exists" echo " --tar-format opt : Specify a tar archive format (default is ustar)" echo " --tar-extra opt : Append more options to the tar command line" echo " --untar-extra opt : Append more options to the during the extraction of the tar archive" echo " --nomd5 : Don't calculate an MD5 for archive" echo " --nocrc : Don't calculate a CRC for archive" echo " --sha256 : Compute a SHA256 checksum for the archive" echo " --header file : Specify location of the header script" echo " --cleanup file : Specify a cleanup script that executes on interrupt and when finished successfully." 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 " --sign passphrase : Signature private key to sign the package with" echo " --lsm file : LSM file describing the package" echo " --license file : Append a license file" echo " --help-header file : Add a header to the archive's --help output" echo " --packaging-date date" echo " : Use provided string as the packaging date" echo " instead of the current date." echo echo " --keep-umask : Keep the umask set to shell default, rather than overriding when executing self-extracting archive." echo " --export-conf : Export configuration variables to startup_script" echo echo "Do not forget to give a fully qualified startup script name" echo "(i.e. with a ./ prefix if inside the archive)." exit 1 } # Default settings if type gzip >/dev/null 2>&1; then COMPRESS=gzip elif type compress >/dev/null 2>&1; then COMPRESS=compress else echo "ERROR: missing commands: gzip, compress" >&2 MS_Usage fi ENCRYPT=n PASSWD="" PASSWD_SRC="" OPENSSL_NO_MD=n COMPRESS_LEVEL=9 DEFAULT_THREADS=123456 # Sentinel value THREADS=$DEFAULT_THREADS KEEP=n CURRENT=n NOX11=n NOWAIT=n APPEND=n TAR_QUIETLY=n KEEP_UMASK=n QUIET=n NOPROGRESS=n COPY=none NEED_ROOT=n TAR_ARGS=rvf TAR_FORMAT=ustar TAR_EXTRA="" GPG_EXTRA="" DU_ARGS=-ks HEADER=`dirname "$0"`/makeself-header.sh SIGNATURE="" TARGETDIR="" NOOVERWRITE=n DATE=`LC_ALL=C date` EXPORT_CONF=n SHA256=n OWNERSHIP=n SIGN=n GPG_PASSPHRASE="" # LSM file stuff LSM_CMD="echo No LSM. >> \"\$archname\"" while true do case "$1" in --version | -v) echo Makeself version $MS_VERSION exit 0 ;; --pbzip2) COMPRESS=pbzip2 shift ;; --bzip3) COMPRESS=bzip3 shift ;; --bzip2) COMPRESS=bzip2 shift ;; --gzip) COMPRESS=gzip shift ;; --pigz) COMPRESS=pigz shift ;; --zstd) COMPRESS=zstd shift ;; --xz) COMPRESS=xz shift ;; --lzo) COMPRESS=lzo shift ;; --lz4) COMPRESS=lz4 shift ;; --compress) COMPRESS=compress shift ;; --base64) COMPRESS=base64 shift ;; --gpg-encrypt) COMPRESS=gpg shift ;; --gpg-asymmetric-encrypt-sign) COMPRESS=gpg-asymmetric shift ;; --gpg-extra) GPG_EXTRA="$2" shift 2 || { MS_Usage; exit 1; } ;; --ssl-encrypt) ENCRYPT=openssl shift ;; --ssl-passwd) PASSWD=$2 shift 2 || { MS_Usage; exit 1; } ;; --ssl-pass-src) PASSWD_SRC=$2 shift 2 || { MS_Usage; exit 1; } ;; --ssl-no-md) OPENSSL_NO_MD=y shift ;; --nocomp) COMPRESS=none shift ;; --complevel) COMPRESS_LEVEL="$2" shift 2 || { MS_Usage; exit 1; } ;; --threads) THREADS="$2" shift 2 || { MS_Usage; exit 1; } ;; --nochown) OWNERSHIP=n shift ;; --chown) OWNERSHIP=y shift ;; --notemp) KEEP=y shift ;; --copy) COPY=copy shift ;; --current) CURRENT=y KEEP=y shift ;; --tar-format) TAR_FORMAT="$2" shift 2 || { MS_Usage; exit 1; } ;; --tar-extra) TAR_EXTRA="$2" shift 2 || { MS_Usage; exit 1; } ;; --untar-extra) UNTAR_EXTRA="$2" shift 2 || { MS_Usage; exit 1; } ;; --target) TARGETDIR="$2" KEEP=y shift 2 || { MS_Usage; exit 1; } ;; --sign) SIGN=y GPG_PASSPHRASE="$2" shift 2 || { MS_Usage; exit 1; } ;; --nooverwrite) NOOVERWRITE=y shift ;; --needroot) NEED_ROOT=y shift ;; --header) HEADER="$2" shift 2 || { MS_Usage; exit 1; } ;; --cleanup) CLEANUP_SCRIPT="$2" shift 2 || { MS_Usage; exit 1; } ;; --license) # We need to escape all characters having a special meaning in double quotes LICENSE=$(sed 's/\\/\\\\/g; s/"/\\\"/g; s/`/\\\`/g; s/\$/\\\$/g' "$2") shift 2 || { MS_Usage; exit 1; } ;; --follow) TAR_ARGS=rvhf DU_ARGS=-ksL shift ;; --noprogress) NOPROGRESS=y shift ;; --nox11) NOX11=y shift ;; --nowait) NOWAIT=y shift ;; --nomd5) NOMD5=y shift ;; --sha256) SHA256=y shift ;; --nocrc) NOCRC=y shift ;; --append) APPEND=y shift ;; --lsm) LSM_CMD="awk 1 \"$2\" >> \"\$archname\"" shift 2 || { MS_Usage; exit 1; } ;; --packaging-date) DATE="$2" shift 2 || { MS_Usage; exit 1; } ;; --help-header) HELPHEADER=`sed -e "s/'/'\\\\\''/g" $2` shift 2 || { MS_Usage; exit 1; } [ -n "$HELPHEADER" ] && HELPHEADER="$HELPHEADER " ;; --tar-quietly) TAR_QUIETLY=y shift ;; --keep-umask) KEEP_UMASK=y shift ;; --export-conf) EXPORT_CONF=y shift ;; -q | --quiet) QUIET=y shift ;; -h | --help) MS_Usage ;; -*) echo Unrecognized flag : "$1" MS_Usage ;; *) break ;; esac done if test $# -lt 1; then MS_Usage else if test -d "$1"; then archdir="$1" else echo "Directory $1 does not exist." >&2 exit 1 fi fi archname="$2" if test "$QUIET" = "y" || test "$TAR_QUIETLY" = "y"; then if test "$TAR_ARGS" = "rvf"; then TAR_ARGS="rf" elif test "$TAR_ARGS" = "rvhf"; then TAR_ARGS="rhf" fi fi if test "$APPEND" = y; then if test $# -lt 2; then MS_Usage fi # Gather the info from the original archive OLDENV=`sh "$archname" --dumpconf` if test $? -ne 0; then echo "Unable to update archive: $archname" >&2 exit 1 else eval "$OLDENV" OLDSKIP=`expr $SKIP + 1` fi else if test "$KEEP" = n -a $# = 3; then echo "ERROR: Making a temporary archive with no embedded command does not make sense!" >&2 echo >&2 MS_Usage fi # 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 if test $# -lt 3; then MS_Usage fi LABEL="$3" SCRIPT="$4" test "x$SCRIPT" = x || shift 1 shift 3 SCRIPTARGS="$*" fi if test "$KEEP" = n -a "$CURRENT" = y; then echo "ERROR: It is A VERY DANGEROUS IDEA to try to combine --notemp and --current." >&2 exit 1 fi case $COMPRESS in gzip) GZIP_CMD="gzip -c$COMPRESS_LEVEL" GUNZIP_CMD="gzip -cd" ;; pigz) GZIP_CMD="pigz -$COMPRESS_LEVEL" if test $THREADS -ne $DEFAULT_THREADS; then # Leave as the default if threads not indicated GZIP_CMD="$GZIP_CMD --processes $THREADS" fi GUNZIP_CMD="gzip -cd" ;; zstd) GZIP_CMD="zstd -$COMPRESS_LEVEL" if test $THREADS -ne $DEFAULT_THREADS; then # Leave as the default if threads not indicated GZIP_CMD="$GZIP_CMD --threads=$THREADS" fi GUNZIP_CMD="zstd -cd" ;; pbzip2) GZIP_CMD="pbzip2 -c$COMPRESS_LEVEL" if test $THREADS -ne $DEFAULT_THREADS; then # Leave as the default if threads not indicated GZIP_CMD="$GZIP_CMD -p$THREADS" fi GUNZIP_CMD="bzip2 -d" ;; bzip3) # Map the compression level to a block size in MiB as 2^(level-1). BZ3_COMPRESS_LEVEL=`echo "2^($COMPRESS_LEVEL-1)" | bc` GZIP_CMD="bzip3 -b$BZ3_COMPRESS_LEVEL" if test $THREADS -ne $DEFAULT_THREADS; then # Leave as the default if threads not indicated GZIP_CMD="$GZIP_CMD -j$THREADS" fi JOBS=`echo "10-$COMPRESS_LEVEL" | bc` GUNZIP_CMD="bzip3 -dj$JOBS" ;; bzip2) GZIP_CMD="bzip2 -$COMPRESS_LEVEL" GUNZIP_CMD="bzip2 -d" ;; xz) GZIP_CMD="xz -c$COMPRESS_LEVEL" # Must opt-in by specifying a value since not all versions of xz support threads if test $THREADS -ne $DEFAULT_THREADS; then GZIP_CMD="$GZIP_CMD --threads=$THREADS" fi GUNZIP_CMD="xz -d" ;; lzo) GZIP_CMD="lzop -c$COMPRESS_LEVEL" GUNZIP_CMD="lzop -d" ;; lz4) GZIP_CMD="lz4 -c$COMPRESS_LEVEL" GUNZIP_CMD="lz4 -d" ;; base64) GZIP_CMD="base64" GUNZIP_CMD="base64 --decode -i -" ;; gpg) GZIP_CMD="gpg $GPG_EXTRA -ac -z$COMPRESS_LEVEL" GUNZIP_CMD="gpg -d" ENCRYPT="gpg" ;; gpg-asymmetric) GZIP_CMD="gpg $GPG_EXTRA -z$COMPRESS_LEVEL -es" GUNZIP_CMD="gpg --yes -d" ENCRYPT="gpg" ;; compress) GZIP_CMD="compress -fc" GUNZIP_CMD="(type compress >/dev/null 2>&1 && compress -fcd || gzip -cd)" ;; none) GZIP_CMD="cat" GUNZIP_CMD="cat" ;; esac if test x"$ENCRYPT" = x"openssl"; then if test x"$APPEND" = x"y"; then echo "Appending to existing archive is not compatible with OpenSSL encryption." >&2 fi ENCRYPT_CMD="openssl enc -aes-256-cbc -salt" DECRYPT_CMD="openssl enc -aes-256-cbc -d" if test x"$OPENSSL_NO_MD" != x"y"; then ENCRYPT_CMD="$ENCRYPT_CMD -md sha256" DECRYPT_CMD="$DECRYPT_CMD -md sha256" fi if test -n "$PASSWD_SRC"; then ENCRYPT_CMD="$ENCRYPT_CMD -pass $PASSWD_SRC" elif test -n "$PASSWD"; then ENCRYPT_CMD="$ENCRYPT_CMD -pass pass:$PASSWD" fi fi tmpfile="${TMPDIR:-/tmp}/mkself$$" if test -f "$HEADER"; then oldarchname="$archname" archname="$tmpfile" # Generate a fake header to count its lines SKIP=0 . "$HEADER" SKIP=`cat "$tmpfile" |wc -l` # Get rid of any spaces SKIP=`expr $SKIP` rm -f "$tmpfile" if test "$QUIET" = "n"; then echo "Header is $SKIP lines long" >&2 fi archname="$oldarchname" else echo "Unable to open header file: $HEADER" >&2 exit 1 fi if test "$QUIET" = "n"; then echo fi if test "$APPEND" = n; then if test -f "$archname"; then echo "WARNING: Overwriting existing file: $archname" >&2 fi fi USIZE=`du $DU_ARGS "$archdir" | awk '{print $1}'` if test "." = "$archdirname"; then if test "$KEEP" = n; then archdirname="makeself-$$-`date +%Y%m%d%H%M%S`" fi fi test -d "$archdir" || { echo "Error: $archdir does not exist."; rm -f "$tmpfile"; exit 1; } if test "$QUIET" = "n"; then echo "About to compress $USIZE KB of data..." echo "Adding files to archive named \"$archname\"..." fi # See if we have GNU tar TAR=`exec <&- 2>&-; which gtar || command -v gtar || type gtar` test -x "$TAR" || TAR=`exec <&- 2>&-; which bsdtar || command -v bsdtar || type bsdtar` test -x "$TAR" || TAR=tar tmparch="${TMPDIR:-/tmp}/mkself$$.tar" ( if test "$APPEND" = "y"; then tail -n "+$OLDSKIP" "$archname" | eval "$GUNZIP_CMD" > "$tmparch" fi cd "$archdir" # "Determining if a directory is empty" # https://www.etalabs.net/sh_tricks.html find . \ \( \ ! -type d \ -o \ \( -links 2 -exec sh -c ' is_empty () ( cd "$1" set -- .[!.]* ; test -f "$1" && return 1 set -- ..?* ; test -f "$1" && return 1 set -- * ; test -f "$1" && return 1 return 0 ) is_empty "$0"' {} \; \ \) \ \) -print \ | LC_ALL=C sort \ | sed 's/./\\&/g' \ | xargs $TAR $TAR_EXTRA --format $TAR_FORMAT -$TAR_ARGS "$tmparch" ) || { echo "ERROR: failed to create temporary archive: $tmparch" rm -f "$tmparch" "$tmpfile" exit 1 } USIZE=`du $DU_ARGS "$tmparch" | awk '{print $1}'` eval "$GZIP_CMD" <"$tmparch" >"$tmpfile" || { echo "ERROR: failed to create temporary file: $tmpfile" rm -f "$tmparch" "$tmpfile" exit 1 } rm -f "$tmparch" if test x"$ENCRYPT" = x"openssl"; then echo "About to encrypt archive \"$archname\"..." { eval "$ENCRYPT_CMD -in $tmpfile -out ${tmpfile}.enc" && mv -f ${tmpfile}.enc $tmpfile; } || \ { echo Aborting: could not encrypt temporary file: "$tmpfile".; rm -f "$tmpfile"; exit 1; } fi fsize=`cat "$tmpfile" | wc -c | tr -d " "` # Compute the checksums shasum=0000000000000000000000000000000000000000000000000000000000000000 md5sum=00000000000000000000000000000000 crcsum=0000000000 if test "$NOCRC" = y; then if test "$QUIET" = "n"; then echo "skipping crc at user request" fi else crcsum=`CMD_ENV=xpg4 cksum < "$tmpfile" | sed -e 's/ /Z/' -e 's/ /Z/' | cut -dZ -f1` if test "$QUIET" = "n"; then echo "CRC: $crcsum" fi fi if test "$SHA256" = y; then SHA_PATH=`exec <&- 2>&-; which shasum || command -v shasum || type shasum` if test -x "$SHA_PATH"; then shasum=`eval "$SHA_PATH -a 256" < "$tmpfile" | cut -b-64` else SHA_PATH=`exec <&- 2>&-; which sha256sum || command -v sha256sum || type sha256sum` shasum=`eval "$SHA_PATH" < "$tmpfile" | cut -b-64` fi if test "$QUIET" = "n"; then if test -x "$SHA_PATH"; then echo "SHA256: $shasum" else echo "SHA256: none, SHA command not found" fi fi fi if test "$NOMD5" = y; then 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 || command -v md5sum || type md5sum` test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which md5 || command -v md5 || type md5` test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which digest || command -v digest || type digest` PATH=$OLD_PATH if test -x "$MD5_PATH"; then if test `basename ${MD5_PATH}`x = digestx; then MD5_ARG="-a md5" fi md5sum=`eval "$MD5_PATH $MD5_ARG" < "$tmpfile" | cut -b-32` if test "$QUIET" = "n"; then echo "MD5: $md5sum" fi else if test "$QUIET" = "n"; then echo "MD5: none, MD5 command not found" fi fi fi if test "$SIGN" = y; then GPG_PATH=`exec <&- 2>&-; which gpg || command -v gpg || type gpg` if test -x "$GPG_PATH"; then SIGNATURE=`$GPG_PATH --pinentry-mode=loopback --batch --yes $GPG_EXTRA --passphrase "$GPG_PASSPHRASE" --output - --detach-sig $tmpfile | base64 | tr -d \\\\n` if test "$QUIET" = "n"; then echo "Signature: $SIGNATURE" fi else echo "Missing gpg command" >&2 fi fi totalsize=0 for size in $fsize; do totalsize=`expr $totalsize + $size` done if test "$APPEND" = y; then mv "$archname" "$archname".bak || exit # Prepare entry for new archive filesizes="$fsize" CRCsum="$crcsum" MD5sum="$md5sum" SHAsum="$shasum" Signature="$SIGNATURE" # Generate the header . "$HEADER" # Append the new data cat "$tmpfile" >> "$archname" chmod +x "$archname" rm -f "$archname".bak if test "$QUIET" = "n"; then echo "Self-extractable archive \"$archname\" successfully updated." fi else filesizes="$fsize" CRCsum="$crcsum" MD5sum="$md5sum" SHAsum="$shasum" Signature="$SIGNATURE" # Generate the header . "$HEADER" # Append the compressed tar data after the stub if test "$QUIET" = "n"; then echo fi cat "$tmpfile" >> "$archname" chmod +x "$archname" if test "$QUIET" = "n"; then echo Self-extractable archive \"$archname\" successfully created. fi fi rm -f "$tmpfile" makeself-release-2.5.0/test/000077500000000000000000000000001440360451400157035ustar00rootroot00000000000000makeself-release-2.5.0/test/appendtest000066400000000000000000000047771440360451400200140ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SRCDIR="$(dirname "${THISDIR}")" SUT="${SRCDIR}/makeself.sh" WHAT="$(basename "${THIS}")" # FIXME: These tests need to check that the concatenation of archives works readonly archive_dir_create="$(mktemp -dt archive_dir_create.XXXXXX)" readonly archive_dir_append="$(mktemp -dt archive_dir_append.XXXXXX)" touch "${archive_dir_create}/fee" touch "${archive_dir_create}/fie" touch "${archive_dir_append}/foe" touch "${archive_dir_append}/fum" evalAssert() { eval "$@" assertEquals "$?" "0" } # $1 : file_name doInfoListCheckExec() { evalAssert "$1" --info evalAssert "$1" --list evalAssert "$1" --check evalAssert "$1" } # $1 : file_name # rest : content basenames assertFileContains() { local file_name="" file_name="$(readlink -f "$1")" shift local target="${file_name}.d" rm -rf "${target}" mkdir -p "${target}" evalAssert "${file_name}" --target "${target}" assertEquals "$(find "${target}" -type f -exec basename -a {} + | sort)" "$(echo -e "$@" | sort)" rm -rf "${target}" } # $@ : makeself options doTestOpts() { local stem="" stem="$(printf '%s' "${WHAT}" "$@" | tr -sc '[:alnum:]_.-' '_')" local file_name="" file_name="${stem}.run" evalAssert "${SUT}" "$@" --sha256 \ "${archive_dir_create}" \ "${file_name}" \ "${stem}" \ "echo ${stem}" file_name="$(readlink -f ${file_name})" doInfoListCheckExec "${file_name}" assertFileContains "${file_name}" "fee\nfie" evalAssert "${SUT}" "$@" --sha256 \ --append "${archive_dir_append}" \ "${file_name}" doInfoListCheckExec "${file_name}" assertFileContains "${file_name}" "fee\nfie\nfoe\nfum" rm -f "${file_name}" } # $1 : compression option doTestComp() { if ! command -v "${1#--*}" >/dev/null 2>&1; then echo "WARNING: missing command: ${1#--*}" >&2 return 0 fi doTestOpts "$1" } ################################################################################ testDefault() { doTestOpts; } testNocomp() { doTestOpts --nocomp; } testBase64() { doTestComp --base64; } testBzip2() { doTestComp --bzip2; } testCompress() { doTestComp --compress; } testGzip() { doTestComp --gzip; } testLz4() { doTestComp --lz4; } testLzo() { doTestComp --lzo; } testPbzip2() { doTestComp --pbzip2; } testPigz() { doTestComp --pigz; } testXz() { doTestComp --xz; } testZstd() { doTestComp --zstd; } # Load and run shUnit2. source "./shunit2/shunit2"makeself-release-2.5.0/test/corrupttest000066400000000000000000000016601440360451400202270ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SRCDIR="$(dirname "${THISDIR}")" SUT="${SRCDIR}/makeself.sh" # Test that corrupted archives actually fail validation cd "$THISDIR" setupTests() { temp_path="$(mktemp -dt appendtest.XXXXXX)" cd "$temp_path" mkdir -p archive cp -a "$SRCDIR" archive/ "$SUT" "$*" archive makeself-test.run "Test $*" echo Testing --tar-extra="--exclude .git" } testExtraBytes() { setupTests --sha256 ./makeself-test.run --check assertEquals $? 0 echo "Adding a bunch of random characters at the end!!" >> makeself-test.run ./makeself-test.run --check assertNotEquals $? 0 } testTruncated() { setupTests --sha256 ./makeself-test.run --check assertEquals $? 0 dd if=makeself-test.run of=truncated.run bs=1 count=34303 bash truncated.run --check assertNotEquals $? 0 } # Load and run shUnit2. source "./shunit2/shunit2" makeself-release-2.5.0/test/datetest000066400000000000000000000042521440360451400174460ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SRCDIR="$(dirname "${THISDIR}")" SUT="${SRCDIR}/makeself.sh" setUp() { temp="$(mktemp -dt datetest.XXXXX)" cd "${temp}" mkdir src echo "echo This is a test" > src/startup.sh } tearDown() { # Cleanup cd - rm -rf "${temp}" } # Default behaviour is to insert the current date in the # generated file. testCurrentDate() { ${SUT} src src.sh alabel startup.sh # Validate actual=`strings src.sh | grep packaging` expected=`LC_ALL=C date +"%b"` if [[ ${actual} == *${expected}* ]] then found=0 else echo "Substring not found: ${expected} in ${actual}" found=1 fi assertEquals 0 ${found} } # A fixed packaging date can be inserted # into the generated package. This way # the package may be recreated from # source and remain byte-for-bye # identical. testDateSet() { expected='Sat Mar 5 19:35:21 EST 2016' # Exercise ${SUT} --packaging-date "${expected}" \ src src.sh alabel startup.sh # Validate actual=`strings src.sh | grep "Date of packaging"` echo "actual="${actual} if [[ ${actual} == *${expected}* ]] then echo date set found found=0 else echo "Substring not found: ${expected} in ${actual}" found=1 fi assertEquals 0 ${found} } # Error if --packaging-date is passed as # an argument but the date is missing testPackagingDateNeedsParameter() { # Exercise ${SUT} --packaging-date \ src src.sh alabel startup.sh || true actual=`test -f src.sh` # Validate echo "actual="${actual} assertNotEquals 0 "${actual}" } # With the dates set we can get a byte for # byte identical package. testByteforbyte() { date='Sat Mar 3 19:35:21 EST 2016' # bsdtar does not have option --mtime # TODO: unstable test: first second differ: char 242, line 10 startSkipping # Exercise ${SUT} --packaging-date "${date}" --tar-extra "--mtime 20160303" \ src src.sh alabel startup.sh mv src.sh first ${SUT} --packaging-date "${date}" --tar-extra "--mtime 20160303" \ src src.sh alabel startup.sh mv src.sh second # Validate cmp first second assertEquals $? 0 } # Load and run shUnit2. source "./shunit2/shunit2" makeself-release-2.5.0/test/extracttest000066400000000000000000000016721440360451400202060ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SRCDIR="$(dirname "${THISDIR}")" SUT="${SRCDIR}/makeself.sh" setupTests() { temp=`mktemp -d -t XXXXX` cd "$temp" mkdir archive cp -a "$SRCDIR" archive/ $SUT $* archive makeself-test.run "Test $*" echo Testing --tar-extra="--exclude .git" } testQuiet() { setupTests ./makeself-test.run --quiet assertEquals $? 0 } testGzip() { setupTests --gzip ./makeself-test.run --check assertEquals $? 0 } testBzip2() { setupTests --bzip2 ./makeself-test.run --check assertEquals $? 0 } testPBzip2() { # Skip if pbzip2 is not available which pbzip2 || startSkipping setupTests --pbzip2 ./makeself-test.run --check assertEquals $? 0 } testZstd() { # Skip if zstd is not available which zstd || startSkipping setupTests --zstd ./makeself-test.run --check assertEquals $? 0 } # Load and run shUnit2. source "./shunit2/shunit2" makeself-release-2.5.0/test/infotest000066400000000000000000000056741440360451400174750ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SRCDIR="$(dirname "${THISDIR}")" VERSION="$(cat "${SRCDIR}/VERSION")" is_alpine_distro=false && [[ -f "/etc/alpine-release" ]] && is_alpine_distro=true uncompressed_size="12 KB" && [[ $is_alpine_distro == true ]] && uncompressed_size="4 KB" ################################################################################ # Take makeself options, generate a predefined archive, print --info to stdout. # # $@ : makeself options haveInfo() ( cd "${SRCDIR}" || return 1 mkdir -p infotest ./makeself.sh "$@" ./infotest ./infotest.run infotest ls -lah >/dev/null 2>&1 assertEquals "$?" 0 >&2 ./infotest.run --info assertEquals "$?" 0 >&2 rm -rf infotest infotest.run ) # Read want.info from stdin. Generate have.info using given options. Invoke # diff want.info have.info and return its exit status # # $@ : makeself options diffInfo() { local rc="" cd "$(mktemp -d)" || return 1 cat >want.info haveInfo "$@" >have.info if diff want.info have.info >&2; then rc="$?" else rc="$?" fi rm -f have.info want.info return "${rc}" } testDefault() ( cd "$(mktemp -d)" || return 1 diffInfo --packaging-date "@0" </dev/null 2>&1 assertEquals "$?" 0 >&2 ./lsmtest.run --lsm assertEquals "$?" 0 >&2 rm -rf lsmtest lsmtest.run ) test_lsm_empty() { printf '' >lsm_empty.txt wc lsm_empty.txt withlsm --lsm lsm_empty.txt rm -f lsm_empty.txt } test_lsm_one_line() { printf 'one line\n' >lsm_one_line.txt withlsm --lsm lsm_one_line.txt rm -f lsm_one_line.txt } test_lsm_one_line_without_nl() { printf 'one line without nl' >lsm_one_line_without_nl.txt withlsm --lsm lsm_one_line_without_nl.txt rm -f lsm_one_line_without_nl.txt } ################################################################################ # Load and run shUnit2. source "./shunit2/shunit2" makeself-release-2.5.0/test/run-makeself.sh000077500000000000000000000011571440360451400206370ustar00rootroot00000000000000#!/bin/sh set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SRCDIR="$(dirname "${THISDIR}")" VERSION="$(cat "${SRCDIR}/VERSION")" # Test run on artifacts echo ">> env:" uname -a cd "$THISDIR" # Try a quiet run sh "../build-ubuntu/makeself-$VERSION.run" --quiet --target ./tmp/makeself-ubuntu # Regular runs sh "../build-ubuntu/makeself-$VERSION.run" --target ./tmp/makeself-ubuntu sh "../build-alpine/makeself-$VERSION.run" --target ./tmp/makeself-alpine sh "../build-windows/makeself-$VERSION.run" --target ./tmp/makeself-windows sh "../build-macos/makeself-$VERSION.run" --target ./tmp/makeself-macosmakeself-release-2.5.0/test/run-testlinter.sh000066400000000000000000000012571440360451400212430ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" cd "$THISDIR" is_windows_os=false [[ $(uname) == Windows_NT* ]] && is_windows_os=true [[ $(uname) == MINGW64_NT* ]] && is_windows_os=true testShStartsWith() { if [[ $is_windows_os == true ]]; then return fi for test_sh in ./*test; do file_name="$(basename -- "$test_sh")" if [[ -f "${test_sh}" ]]; then echo ">> Test $file_name" local etalon_head="$(printf '#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" ')" assertEquals "$etalon_head" "$(cat "${test_sh}" | head -4)" fi done } # Load and run shUnit2. source "./shunit2/shunit2" makeself-release-2.5.0/test/run-tests.sh000077500000000000000000000004751440360451400202140ustar00rootroot00000000000000#!/bin/sh set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" # Run every available test echo ">> env:" uname -a cd "$THISDIR" bash "./run-testlinter.sh" for test in ./*test; do echo "::group::$test" bash "./$test" || { echo "*** ERROR: Test '$test' failed!"; exit 1; } echo "::endgroup::" done makeself-release-2.5.0/test/secret_key.gpg000066400000000000000000000072431440360451400205450ustar00rootroot00000000000000`] {CjAi=}loEtk@%}£' /cJAznpr ūp[ov0)A&L3,7qepujyvሟfq4w7]Y⸵:W~\*7MX'8KuAra~ߡ`>Ģ:$Æ+Iԏf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WA leMC4o05aTkVZQ/VISivbm+zX7Z55h4gWtQRpOnUjZvkRR4qzxFQuBji4RwV8fjn Tmc85E2T+5ElBuvM0E7yKbeZUqar38LvB2PVxHvS54uoz/wNBM0EzQTWkzsj3rL6 G9RctR9sPd8ExKrepm3Wi9FH6oUcfBQDVcGQnkT/mWtuxJu6cRgflejlowXJQNpi xNUovCfEPJoembw2w2Zd2jt+j6LumEyKDH6NY0isaFM14zv3xi4DnXd5nDiICUT0 M6g9A6knE6DopURSAUqj5Jh2YtiiqBFLuywSGDZ1Yr0/iK0YUKOwqkWK6l6WAKUZ xbHYjmdB2W/mb5KsZQtPA8f64MLnYFUyM/dzKJTNydwdsDfISpo2LQo3x1UlW/iG o4oajMXFpMzKuE4OSLUjgwHZbmcO6row39ygR9mutiJK4ATLEgz63szELkQqvYiO F/K8LdM3iHJ5iWSRmORhAM4oXxZbV6v73Qm+Aw0= =ePfs -----END PGP PRIVATE KEY BLOCK----- EOF ;; 3F717988DF7D8D55A1660FC1A5ECF255B5AE77E1) # sec rsa3072 2021-09-24 [SC] # 3F717988DF7D8D55A1660FC1A5ECF255B5AE77E1 # uid [ultimate] Makeself Tester (time to test the makeself) cat <<'EOF' -----BEGIN PGP PRIVATE KEY BLOCK----- lQWGBGFOL4MBDAC30nl0ptKgL9KxHSWSW4GpAPmCVPiqDuRpRf5J6GArtu4dnkO+ I/Jc1H0cGw3uvuVlb8LjCafyFLMIg/3IG0CixruV5Nvg+c6vPZtYFV33+Zjg8UKx 7BJEt/dd31V9okWFEh05ItI0JPn+3IH/oqHGH0dUzLFFjVWwjM+7DU+700/HLc6X CihBbNrFHXzQrAucRLEc3cphKuJf4Gds/hc8ECQWnM/TE/o7/jgUs6yFM3x5kV0Z uSpcrxjTsj6NZDWiNFGOgwoZl0y/ePvW+Yd+0tWkToj812hNTa/qL82stEH/C2nI OxavZATLSQP6vpCBrVYf00FPkHrUuvutb2LOKM8Cn9geYIjCj+pISD4tJuEzD+M4 /fNdrB+uoetQJO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bCFE8/EuqrJvvf9pBuQiwXFvu4mS PQl0YDACFfPjOrJmtqQctIB61Bzgem8OVT90j9s= =Lm2k -----END PGP PRIVATE KEY BLOCK----- EOF ;; *) cat /dev/null 2>&1 assertEquals "$?" 0 } # $1 : keyid # rest : makeself options create_sign_verify() { local keyid="$1" shift # prepare archive directory local archive_dir="" archive_dir="$(mktemp -dt archive_dir.XXXXXX)" touch "${archive_dir}"/foo.txt touch "${archive_dir}"/bar.txt touch "${archive_dir}"/qux.txt # create archive local archive_run="" archive_run="${archive_dir}.run" local output="" output="${archive_run}.out" "${SUT}" --sign password123 "$@" \ "${archive_dir}" "${archive_run}" "signtest" ls \ >"${output}" assertEquals "$?" 0 # check output for signature grep -Exq 'Signature: [[:alnum:]+/]+' "${output}" assertEquals "$?" 0 # verify signature local res="" if eval "${archive_run}" --verify-sig "${keyid}"; then res="$?" else res="$?" fi # clean up rm -rf "${archive_dir}" "${archive_run}" "${output}" return "${res}" } testSingleKey() ( GNUPGHOME="$(mktemp -dt GNUPGHOME.XXXXXX)" export GNUPGHOME checked_import_key 3DD6797A5EDE9A253311C13AED3E040B19F6996E assertEquals "$?" 0 create_sign_verify 3DD6797A5EDE9A253311C13AED3E040B19F6996E assertEquals "$?" 0 rm -rf "${GNUPGHOME}" ) testMultipleKeys() ( GNUPGHOME="$(mktemp -dt GNUPGHOME.XXXXXX)" export GNUPGHOME checked_import_key 3DD6797A5EDE9A253311C13AED3E040B19F6996E assertEquals "$?" 0 checked_import_key 3F717988DF7D8D55A1660FC1A5ECF255B5AE77E1 assertEquals "$?" 0 create_sign_verify \ 3DD6797A5EDE9A253311C13AED3E040B19F6996E \ --gpg-extra "--local-user=3DD6797A5EDE9A253311C13AED3E040B19F6996E" assertEquals "$?" 0 create_sign_verify \ 3F717988DF7D8D55A1660FC1A5ECF255B5AE77E1 \ --gpg-extra "--local-user=3F717988DF7D8D55A1660FC1A5ECF255B5AE77E1" assertEquals "$?" 0 rm -rf "${GNUPGHOME}" ) testWrongKey() ( GNUPGHOME="$(mktemp -dt GNUPGHOME.XXXXXX)" export GNUPGHOME checked_import_key 3DD6797A5EDE9A253311C13AED3E040B19F6996E assertEquals "$?" 0 checked_import_key 3F717988DF7D8D55A1660FC1A5ECF255B5AE77E1 assertEquals "$?" 0 create_sign_verify \ 3DD6797A5EDE9A253311C13AED3E040B19F6996E \ --gpg-extra "--local-user=3F717988DF7D8D55A1660FC1A5ECF255B5AE77E1" \ || assertEquals "$?" 2 create_sign_verify \ 3F717988DF7D8D55A1660FC1A5ECF255B5AE77E1 \ --gpg-extra "--local-user=3DD6797A5EDE9A253311C13AED3E040B19F6996E" \ || assertEquals "$?" 2 rm -rf "${GNUPGHOME}" ) testWrongPassword() ( GNUPGHOME="$(mktemp -dt GNUPGHOME.XXXXXX)" export GNUPGHOME checked_import_key 3DD6797A5EDE9A253311C13AED3E040B19F6996E assertEquals "$?" 0 checked_import_key 3F717988DF7D8D55A1660FC1A5ECF255B5AE77E1 assertEquals "$?" 0 # prepare archive directory local archive_dir="" archive_dir="$(mktemp -dt archive_dir.XXXXXX)" touch "${archive_dir}"/foo.txt touch "${archive_dir}"/bar.txt touch "${archive_dir}"/qux.txt # create archive local archive_run="" archive_run="${archive_dir}.run" local output="" output="${archive_run}.out" "${SUT}" --sign TheWrongPassword1357 "$@" \ "${archive_dir}" "${archive_run}" "signtest" ls \ >"${output}" assertEquals "$?" 0 grep -Fxq 'Signature: ' "${output}" assertEquals "$?" 0 rm -rf "${GNUPGHOME}" "${archive_dir}" "${archive_run}" "${output}" ) ################################################################################ # Load and run shUnit2. source "./shunit2/shunit2" makeself-release-2.5.0/test/suidtest000066400000000000000000000023041440360451400174710ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SUT="$(dirname "${THISDIR}")/makeself.sh" testSuidDoesntGetBroken() { # Create a directory with a file on it local archive_dir="$(mktemp -dt archive_dir.XXXXXX)" ( cd "${archive_dir}" touch deployedfile ) # Create the self extracting that should extract deployedfile local file_name="$(mktemp -t file_name.XXXXXX)" "${SUT}" --target "${archive_dir}" "${archive_dir}" "${file_name}" "suid test" assertEquals $? 0 # Target directory now has another file with sudo permissions # This will get broken because of chown -R ( cd "${archive_dir}" touch suidfile.bin chmod +xs suidfile.bin ) permissionsBefore=$(stat -c %A "${archive_dir}"/suidfile.bin) # We extract deployedfile, in hopes that it will not reset suid bit # from suidfile.bin "${file_name}" assertEquals $? 0 permissionsAfter=$(stat -c %A "${archive_dir}"/suidfile.bin) # And we check that permissions match assertEquals "${permissionsBefore}" "${permissionsAfter}" rm -rf "${archive_dir}" "${file_name}" } # Load and run shUnit2. source "./shunit2/shunit2" makeself-release-2.5.0/test/tarextratest000066400000000000000000000010071440360451400203560ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SUT="$(dirname "${THISDIR}")/makeself.sh" setupTests() { temp=$(mktemp -d -t XXXXX) pushd "${temp}" mkdir -p src/.git echo "echo This is a test" > src/startup.sh } tearDown() { popd rm -rf "${temp}" } testTarExtraOpts() { setupTests tar_extra="--verbose --exclude .git" ${SUT} --tar-extra "$tar_extra" src src.sh alabel startup.sh assertEquals $? 0 tearDown } # Load and run shUnit2. source "./shunit2/shunit2" makeself-release-2.5.0/test/variabletest000066400000000000000000000021461440360451400203160ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SUT="$(dirname "${THISDIR}")/makeself.sh" setupTests() { temp=`mktemp -d -t XXXXX` cd "$temp" mkdir archive touch archive/file # $SUT archive makeself-test.run "Test $1" declare -p "${1}" $SUT archive makeself-test.run "Test $1" echo \\\"\${${1}}\\\" } testArchiveDir() { setupTests ARCHIVE_DIR local ans=$'./complicated\n dir\twith spaces' mkdir "${ans}" mv ./makeself-test.run "${ans}/" actual_archive_dir="$("${ans}/makeself-test.run" --quiet)" assertEquals "${actual_archive_dir}" "${ans}" } testTmpRoot() { setupTests TMPROOT local ans="${temp}"$'/complicated\n dir\twith spaces' mkdir -p "${ans}" actual_tmp_root="$(TMPDIR="${ans}" "./makeself-test.run" --quiet)" assertEquals "${actual_tmp_root}" "${ans}" } testUserPWD() { setupTests USER_PWD local ans="${temp}"$'/complicated\n dir\twith spaces' mkdir -p "${ans}" cd "${ans}" actual_user_pwd="$("${temp}/makeself-test.run" --quiet)" assertEquals "${actual_user_pwd}" "${ans}" } # Load and run shUnit2. source "./shunit2/shunit2" makeself-release-2.5.0/test/whitespacelicensetest000066400000000000000000000036311440360451400222300ustar00rootroot00000000000000#!/bin/bash set -eu THIS="$(readlink -f "$0")" THISDIR="$(dirname "${THIS}")" SUT="$(dirname "${THISDIR}")/makeself.sh" testWhiteSpaceLicense() { # for each license file: its canonical path is identical to its content local license_dir="$(mktemp -dt license_dir.XXXXXX)" ( cd "${license_dir}" cat >"$(printf "_\x09_character_tabulation.txt")" <"$(printf "_\x0b_line_tabulation.txt")" <"$(printf "_\x0c_form_feed.txt")"<"$(printf "_\x0d_carriage_return.txt")"<"$(printf "_\x20_space.txt")"<