Installing & Launching Debreate

The first thing we’ll need to do is install Debreate. You can download the package from Sourceforge here, then install with the package manager of your choice, or with the following command: Then we can launch Debreate from KRunner by executing “debreate“, or by clicking the item in the “Development” section of the application menu. Start up the program, and you’ll get the following (first-run) screen, as shown below at left, followed by an info screen, below at right.

Control Info

Clicking on the arrow in the upper corner brings us to a screen called “Control.” This where we’ll fill in the data that will end up in the “control.tar.gz” part of the package. You’ll need to fill in the following fields shown below:

Click the right arrow at the upper right to move to the next screen.

The Dependencies

The next thing we’ll need to prepare is a list of any other packages that this program will use. Obviously, we’ll need “Pandoc” to be installed, since the script calls that program, and since we’re including a GUI, we’ll need to make sure “Zenity” is installed too. We’ll need to enter each of these on the Dependencies screen (we could also include a version number, but for this script, whatever version of Pandoc and Zenity the distribution has should suffice), and hit the “Add” button to add it to the list.

Now, let’s pack up some files!

The Files

The first thing to do is to gather all the files you’ll be including, and arrange them in the folder structure described above. For this article, I’m going to be packing up the pandoc-pub.sh script I created in a previous article. The Files screen allows you to select files one at a time, and indicate to what folder they should be installed, as shown below. I have three files I’d like to include:

The script itself… Since this program is a shell script, it’s self-contained. I’ll need to put this in “/usr/bin” according to FHS. Next, I’m going to include a brief README file with usage instructions. This will go in “/usr/share/doc”. Lastly, I’m going to include an icon. I’ll place this in “/usr/share/icons”.

The next screen will allow you to specify the “preinst”, “postinst”, “prerm”, and/or “postrm” scripts described in the previous article on DEB basics. Three more will follow: Changelog (which allows you to describe changes since the last version), Copyright (a statement on how the software can be used), and Menu Launcher (which will automate the creation of an item in the main desktop menu). For the purposes of this test package, I’m not using any of these.

Build It!

The final screen will give you some “Extra Options” that we can safely ignore… let’s get to building. Click the big green button!

My package had some warnings (which is developer speak are different than errors, which are “show-stoppers” so to speak) like a missing Copyright statement, missing man page, etc… since this package is just for my own use, this is OK. But it’s built! You can install with the following standard “dpkg” command: But it fails… why? Because it has dependencies on Zenity and Pandoc (which I just removed, to test this feature). Double-clicking on the package in a file manager will let GDebi do the dependency installation for us, as shown below:

Once installed, I can now distribute this to my friends (who are, by and large, much better programmers than me). So find some of your more useful scripts or programs, and get packaging. Distributing helpful software to others is what makes the FOSS community so great!