Monday, July 24, 2017

Using makeself to create an auto-extracting shell archive with Mageia6

Mageia6 does not provide makeself, so you must download it from it's homepage (which re-direct to its Github page. Download it from: Unpack it to a sub-directory of your /home directory and change to that directory. Then run $ sh  ./ and makeself will unpack itself to ~/makeself

Read the file contents. This provides a good overview of what the application does and how it goes about building itself and eventually extracting itself.

For my example, I will create a makeself shell archive that will install certain files in my  /home directory that I use in every /home directory on every machine where I have an account.

To quote the file, the syntax of makeself is the following:

` [args] archive_dir file_name label startup_script [script_args]`
The args are listed in the file; they tell makeself how to proceed.

The archive directory is where it will find the files you select.

The file name is the name you choose for the archive.

The label is a text string you choose to that will identify the process when it extracts the files from the archive.

The startup script is the command that will be executed from inside the directory where you unpack your files.

By convention, the archive ends with .run to identify it as a makeself file to a user.

The args are:
--version | -v     : Print out Makeself version number and exit
    --help | -h        : Print out this help message
    --tar-quietly      : Suppress verbose output from the tar command
    --quiet | -q       : Do not print any messages other than errors.
    --gzip             : Compress using gzip (default if detected)
    --pigz               : Compress with pigz
    --bzip2            : Compress using bzip2 instead of gzip
    --pbzip2           : Compress using pbzip2 instead of gzip
    --xz               : Compress using xz instead of gzip
    --lzo              : Compress using lzop instead of gzip
    --lz4              : Compress using lz4 instead of gzip
    --compress         : Compress using the UNIX 'compress' command
    --complevel lvl    : Compression level for gzip pigz xz lzo lz4 bzip2 and pbzip2 (default 9)
    --base64           : Instead of compressing, encode the data using base64
    --gpg-encrypt      : Instead of compressing, encrypt the data using GPG
    --ssl-encrypt      : Instead of compressing, encrypt the data using OpenSSL
    --nocomp           : Do not compress the data
    --notemp           : The archive will create archive_dir in the
                         current directory and uncompress in ./archive_dir
    --copy             : Upon extraction, the archive will first copy itself to
                         a temporary directory
    --append           : Append more files to an existing Makeself archive
                         The label and startup scripts will then be ignored
    --target dir       : Extract directly to a target directory
                         directory path can be either absolute or relative
    --current          : Files will be extracted to the current directory
                         Both --current and --target imply --notemp
    --tar-extra opt    : Append more options to the tar command line
    --nomd5            : Don't calculate an MD5 for archive
    --nocrc            : Don't calculate a CRC for archive
    --header file      : Specify location of the header script
    --follow           : Follow the symlinks in the archive
    --noprogress       : Do not show the progress during the decompression
    --nox11            : Disable automatic spawn of a xterm
    --nowait           : Do not wait for user input after executing embedded
                         program from an xterm
    --lsm file         : LSM file describing the package
    --license file     : Append a license file
    --help-header file : Add a header to the archive's --help output

I will add more HOWTO-type information to  this when I have the time to actually create a makeself archive.








No comments: