Creating packages for Pardus Linux with pisido

1. Introduction

Pardus Linux is a relative newcomer to the Linux scene. Version 1.0 was released at the end of 2005, and since then, the project started using version numbers that remind us of what Mandriva uses for some time. So, the latest stable version is 2011.2, which means it's the second release for 2011. Pardus Linux is a distribution sponsored and developed by the Scientific & Technological Research Council of Turkey. It's a easy to use distribution, with a series of unique tools like Pisi (Packages Installed Successfully as Intended), which is the package manager. We will not give you a Pardus review, instead we'll assume you have the distro already installed and running and we'll tell you about a tool named PiSiDo. This tool enables you in a graphical, user-friendly way, to create pisi packages starting from source code. So for this article we'll assume only that you have Pardus installed. If you still have some questions after reading this article please try our new LinuxCareer Forum.

2. Using Pisi

I don't know how others are but I, for one, whenever I use a new tool, my reflex is to type "man $command". After I installed Pardus Linux (very nice installer, by the way), since I already knew that it uses pisi as the package manager, I typed "man pisi" only to be dissapointed by the lack of a manual page. I hoped I could get some more help from the graphical front end package manager, but it segfaulted on me every time. So I finally discovered help with

$ pisi -h

so I could get some basic help at least. It would be unfair to compare Pisi or Pardus with other older package management systems/distributions like Fedora or Debian, so, especially since this Python-based package manager isn't as complex as yum/rpm or apt/dpkg, I settled for the help dialog. On the other hand, I think Pardus could use some translators, since it has a wiki and usually the information is pretty easy to find, but sometimes you're stuck reading a page in Turkish.

Two elements are of interest here: the delta command and the build command. Pisi uses delta packages by default, which saves bandwidth, which means that when upgrading (up), only binary differences between the installed and available packages will be installed. Next, as the name implies, build allows you to build your own packages. I think it's kinda cool that one can use the same tools for installing as well as for building packages. Now, as stated earlier, it took me a while to find documentation on how to build my own packages with pisi. The process requires some XML knowledge, plus some Python knowledge if the build process is complicated and there are postinstall operations to make, for example. It looks a lot like RPM packaging to me, except that there you have to know specfile syntax and that's that. Here...it's a different story. So instead of showing you how to write XML or Python for building with pisi, we'll take advantage of PiSiDo.

3. Getting and using PiSiDo

As one can see, there is a pisi package available on Sourceforge, which you can install thusly:

We created the build directory in the user's home because we will need it anyway when starting PiSiDo, since you will be asked for a workspace where the built packages will be saved.

What's important for us, based on the screenshot above, is the left-center part of the window, where you will have to enter data, and the rightside down part, where you will get to decide what actions PiSiDo will perform and to what point, so you can tell it to only unpack, build, install, etc. You'll see every step of the build process as it happens in the terminal-like window. So let's say we're not content with wget being at version 1.12 in 2011.2 stable and we want 1.13. Since we have a build directory we can use that as the location to download the source code in.

$ cd ~/build $ wget -c http://ftp.gnu.org/gnu/wget/wget-1.13.tar.gz

Some of the fields in the screenshot above are pretty self-explanatory, but we'll take it step by step: we used 'wget' as the name, at archive type we used compressed, not URL, since the .tar.gz is already downloaded. We left the dependency fields empty to see what will happen, entered GPLv3+ in the license field, component 'system' and we will let you fill in the remaining three fields. Except for the dependency-related fields and the type, everything else is mandatory, and so is the fact that you'll need a source archive with a configure script. That is unless you want to change the template type (cmake, Python...). When I tried to build a source (written in C) .tgz with no configure script, it failed (see screenshot below), which actually makes a lot of sense.

Now in the upper right part, press the '+' sign to add a new history entry (mandatory as well) and fill in the necessary fields, as you can see in the example below:

So that's about it! In the Build Commands section select "Only Package" and Up To Install", which will basically create a .pisi file in your build directory, but not install it, and just press the button corresponding to "Only Package". If you don't have autotools, automake and the like installed, PiSiDo will take care of that for you, but if your package requires an external dependency, you will get an error.

I also got an error, since wget depends on some GNU TLS headers, so I filled in as a Build Dependency the gnutls-devel package. I was asked to confirm the installation of that package then the build process started normally and I was notified that my fresh wget package is in the build directory. Now that your wget 1.13 package is ready, we recommend uninstalling the older version to avoid potential issues.

If you take some time to play around with PiSiDo you will see that it's also pretty easy to apply a patch to an existing source and create a new package with a new version from it.

4. Conclusion

I see this utility as a very practical tool, since package creation on many distributions is a somehow tedious job. Maybe more Linuxes should look at PiSiDo and try to help their users create packages for their favorite software more easily. All in all, Pardus and its' tools looked like a fun experience, even though I'm more into "geeky" distributions. Certainly worth checking out once in a while.

Author: Rares Aioanei

I'm using Linux/BSD since about 2003, passionate about everything that involves Linux/BSD and Free Software. Contributor to various FOSS projects and your average system administrator in everyday life.

Stay Tuned

Make sure you tune in to our Newsletter and Linux IT jobs portal to stay informed about the latest opportunities in the field. To help you to keep your skills sharp we also offer various Linux Training courses. Lastly, visit our Linux Forum if you want to share your Linux experiences with us or require additional help.

Readers

Stay updated with Linux Career news, advice and tips. Stay informed what IT skills are most likely to help you advance your IT career.

Partners

Who are we?

LinuxCareer.com is not affiliated with any local or international company, nor is it a recruitment or employment agency. We specialise in Linux based careers and closely related Information Technology fields by providing careers advice and latest employment opportunities.

JOIN LINUXCAREER

You can also get involved in the LinuxCareer project by participating on our FORUM or SUBMITTING A LINUX ARTICLE. We offer a range of privileges to our authors and good company.