1 - Write the program
This is a simple step. Write the program and compile it into an executable. You can also send the source off to be made into a package, but this article does not explain that step. Once you have the executable, make the .deb file.
2 - Make the .deb
To do this, make a folder called "hworld". Then, inside of this file, make "DEBIAN" and "usr". DEBIAN is a control directory. Anything else will go in the root filesystem. For instance, a file at /etc/xdg/file would be placed in /etc/xdg/file on the installee's filesystem. You should have a grasp on how /usr works. Place the executable in /usr/bin. In /usr/doc/hworld you should put your license and a README. You can make the man page in /usr/man. When you're ready, move to the main directory of this .deb where the DEBIAN folder is. Move to DEBIAN.
Inside of DEBIAN you need to make three files called "control", "postinst", and "prerm". "control" has its own syntax that gives some information about the .deb. "postinst" and "prerm" are two BASH scripts that execute after the program is installed and before it is removed. Both of the files should contain the command "ldconfig". Here is how the syntax of "control" should be:
Maintainer: Norton "dymatic" Jenkins <email@example.com>
Description: Do nothing
There are extra fields that you can add, but this is the basic functionality. You are now ready to create the .deb file. Issue this command "fakeroot dpkg -b [path/without/brackets] [output/path/name.deb]
Fakeroot is important. The package will have the wrong permissions without it. Sudo is NOT a replacement for fakeroot. Now, you need to make the package name standards-compliant. Easy. Do this: "dpkg-name [/path/to/deb].
You can crack open any old .deb with an archive manager to examine how they go about their business. A good program to try it with is guru, my most recent project.
Try to install it with the software center and see if it gives you any trouble. If it does, try again. If not, move onto step 3.
3 - Submit it
Go to https://myapps.developer.ubuntu.com/dev/ and submit an application. This whole process is explained very well on the site, so I do not need to describe it in-depth here. You DO need to make a 64X64 icon for the program, though. You can download and edit mine here: http://dl.dropbox.com/u/34155613/GuruSys.png or you can get it right from this blog.
If you do not want to edit the Guru icon, you can make your own in GIMP or Kolourpaint if you wish. On the main uploading screen, upload the .deb, NOT the executable. Also, do not worry if it says "Buy $0.00" if you want it to be free. This is a minor bug.
The package has to be reviewed before it is published. It can be rejected for a number of reasons, and if it is it is up to you to fix it according to their suggestions and then re-submit it. The reviewing process can take up to 5 days. It can take even longer for your package to appear in the repositories.
4 - Done
You're done. You can now sit back and relax and add this published application to your resume. Remember that you can still update it and that it is a good idea to do so.