Ubuntu – How to create a .deb file


Yes, I know that this question has been asked many times before, but none of the answers really helped.
I'd like to package the Minecraft launcher (which has no proprietary code, AFAIK,) into a .deb file so that I can put it on a flash drive and share it with my friends. I have managed to install Minecraft it manually (put some files into /opt/minecraft, download an icon, and create a .desktop file in /usr/share/applications,) and I have made a shell script that completely automates the process, but it relies on wget to retrieve a few files, including the .desktop file. (It isn't a self-extracting archive, after all.)

I'd like to be able to do this offline, as a lot of my friends have slow or no internet. (One of their internet lines was buried so shallowly that it actually got knocked out by the lawnmower.)
I won't be loading it into a PPA or anything like that; I just want it to be a "formal" package that can be easily installed and uninstalled. (One thing that I would like is for sudo apt-get purge minecraft to also remove the .minecraft folder. It would also be nice to define the dependedcies as being able to accept OpenJDK or Sun's JVM.)

Oh, just so you know, the Minecraft launcher is a .jar file, but I can very, very easily launch it via shell scripts. The exact command is right on the download page.

Best Answer

I can feel your pain. Some time ago I asked myself the same question just trying to package a little shell script with a launcher. The best I could find was this video (can't remember the original file name - so I had to upload it to U1). Following the steps in the video I was able to create a .deb in ~2 hours.

Other helpful resources (just quickly scan through it):
Ubuntu Forum
Package Basics

All the tutorials I could find were much, much too long, incomplete, or not usable for a beginner (too complicated.) I'm sure there are a lot of people out there that have written little useful scripts and would like to package and share them but its just to time consuming & frustrating when trying to create a .deb for the first time.

Related Question