How To Embedding Your Binary Files into Shell Script
Saturday, August 4th, 2012Pada tulisan kali ini, kita akan membahas bagaimana membuat sebuah shell script yang berisi sebuah binary file. Apa sih sebenarnya yang bisa kita lakukan dengan sebuah shell script yang berisi file binary ? Hm.. sebenarnya banyak sih, dan salah satunya adalah membuat installer untuk sistem operasi GNU/Linux seperti installer milik NetBeans IDE yang mempunyai ekstensi *.sh
Nah untuk membantu tujuan kita diatas, kita membutuhkan bantuan sebuah shell script yaitu makeself. Untuk yang belum tahu apa itu script makeself, dibawah ini adalah deskripsi singkat tentang script makeself :
makeself.sh is a small shell script that generates a self-extractable tar.gz 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 checksums).
Dan yang menggembirakan lagi adalah, script makeself ini sudah di test dan dapat digunakan pada beberapa sistem operasi yang kurang lebih seperti berikut :
- 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 5.1L
- MacOS X (Darwin)
- SGI IRIX 6.5
- FreeBSD
- UnicOS / Cray
- Cygwin (Windows)
Sedangkan yang sudah menggunakan script ini sebagai installer mereka adalah :
- Game patches and installers for Id Software games like Quake 3 for Linux or Return To Castle Wolfenstien ;
- All game patches released by Loki Software for the Linux version of popular games
- The nVidia drivers for Linux
- The installer for the Linux version of Google Earth
- The VirtualBox installers for Linux
- The Makeself distribution itself
Menarik bukan ? Masih tertarik bagaimana caranya menggunakan script ini untuk membuat sebuah installer sendiri ?
(more…)






