How to create a self-extracting archive in Linux (using makeself)

makeself is a small shell script that generates a self-extractable tar.gz archive from a directory and adds a small shell script stub at the beginning of the archive to initiate self-extraction, and guide installation of extracted files.

# install from srpm, for el/centos
$ rpmbuild --rebuild http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/source/SRPMS/m/makeself-2.2.0-3.fc21.src.rpm
$ rpm -Uv makeself-*.rpm

# install for debian/ubuntu
$ sudo apt-get install makeself

# create a self-extractng archive
$ makeself.sh --notemp ./backup ./backup.run "SFX archive for backup" echo "Extraction done"

# extract
$ ./backup.run

# create a self-extracting installer
$ touch /program/installer.sh ; chmod 755 ./program/install.sh
$ makeself.sh ./program ./program.run "SFX installer for program" ./install.sh

from How to create a self-extracting archive or installer in Linux

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s