It is already some time since I first started a coding project to provide a tool that easily generates Debian or RedHat packages.

Now that it is finally finished, I can happily announce it: UnixPackage on GitHub. There are instructions and examples on different README files, and also a step-by-step guide in the wiki.

Of course, the package could be better validated (ahem, only three tests for the arguments); but it seemed to work quite well in its Simple and Manual modes. Hopefully it will work for many interested users.

Initially this tool was going to be developed using Python’s Tkinter graphical library. Being Python, the development was quite straightforward and the main part of the GUI was finished in no time. However, the results were not as graceful as I would expect. Thus I embarked on a Java adventure with the AWT/Swing libraries. To be honest, the development of the GUI itself took much more time than the development and debugging of the scripts to generate the UNIX packages; where some work was already done by the time I started with the graphical interface. Basically, the tool is a JAR package with a GUI (and CLI) wrapper on top of some Shell scripts.

So far, this is the history and brief contents of the tool. Now, you are welcome to try generating some packages with it or doing it manually (see steps below).

Creating a DEB package

First, the Debian packages. These are the .deb files used to install sources through apt-get or other package manager. The benefits of packaging and installing following this standard is that there is a built-in registry and workflow (hooks) for installing and uninstalling such packages.

Put simply, these are the commands to create a Debian package:

Does not seem complicated, until trying to figure out where to put every file and, sometimes, which values to use for seemingly trivial parameters, as license/copyright, architecture, etc. Yet, as with most stuff, expertise comes with practise.

There are a myriad of configuration possibilities in the Debian control files, located under debian/control. For instance, you can define the behaviour before and after installing or uninstalling the package.

Creating a RPM package

Unlike the Debian package system, the Red Hat package system is less constrained and, in my experience, more prone to funny behaviours upon installation and update of the packages. On the other hand, RPM packages are much easier to generate. For instance, the structure of the folders is quite clear.

Here are the steps I followed:

The SPEC file (as it can be observed in this example) provides a way to insert all package-related data in a single file. Data such as the package name, description, list of files to be installed, behaviours on build and install, or the changelog can be defined there.

Share on FacebookTweet about this on TwitterShare on Google+Share on RedditEmail this to someonePrint this page
Rate the usefulness:
(No Ratings Yet)
Loading...