Making an application installer for Linux is much vague word as compared to Windows, this is because there exist a huge list of operating System. Even though you can narrow them down to a few distro based on derivatives you can never ensure if it will all work well unless you have tested it all yourself. When you pack your software you either settled down to on distro say Debian or Ubuntu or release multiple package for Redhat etc. Even then the nature of the software has become so complex that you need to learn a lot about the specifics of package management in detail to get it right. Like always it would be nice to have an universal solution.
I found makeself to be an interesting tool, surprisingly after I discovered it I realised there are many apps that were packaged using it. Now without much delay lets see how to use it.
apt-get install makeself
For this example I took the odoc project that I created sometime ago.
git clone https://github.com/codelectron/odoc
Now lets create a sandbox folder where we will create the binary app of our odoc .
cd odoc mkdir sandbox cp -a odoc sandbox cp -a script sandbox
Now lets say what to do in the installer script.
cd sandbox ---------- vim postinstall.sh #!/bin/bash cp script/odoc /usr/local/bin chmod 777 /usr/local/bin/odoc cp -a odocs /usr/local/share ---------- chmod 777 postinstall.sh cd ..
Now we have defined what to do in the installer, our next step is to create it.
makeself sandbox odoc-install.run ODOC ./postinstall.sh
Now you can copy the odoc-install.run to any Linux system and install it easily.
For more Information visit here or type make makeself in a terminal.