UniPackage is an alternative to distribution-specific packaging systems like dpkg and RPM. UniPackage is a simple system that works on any Linux distribution.
UniPackage packages are tar.bz2 archives which contain a self-contained "AppDir" which can be moved anywhere in the filesystem without disturbing the application's installation. In most cases, this packaging does not require changes to the application's code.
The issue of dependencies is avoided by bundling all required libraries in the AppDir. However, to conserve memory, applications will default to using existing libraries already installed on the system if they are available.
Disk space is conserved by transparently decompressing the application's "bin" and "lib" directories upon execution of the application (new to v0.5.2).
In the following example, we will show how to create a package for MPlayer.
1. Extract the UniPackage tarball somewhere on your system (if you're reading this, then obviously you've done that).
2. Download the MPlayer source archive (the .tar.bz2) and extract it somewhere on your system (anywhere is fine).
3. Change your working directory to where you extracted UniPackage.
4. UniPackage makes use of 'recipes' to compile programs, similar to in GoboLinux (www.gobolinux.com). A recipe is a simple bash script that contains the commands necessary to compile a program. For most programs, the 'Recipe.Standard' recipe should
work fine. However, for more complex programs you may need to either create a recipe or find one that someone else has created.
Included with UniPackage is an example of a "complex" recipe for creating an MPlayer package - 'Recipe.MPlayer'. If you have a look through the recipe, you will see that it's not
really complex. It just sets up a few extra directories, downloads and extracts fonts/codecs/skins which are specific to MPlayer. You can modify the recipe as much as you like to get the desired compilation result.
Once you have created/found your recipe, you invoke the 'CreatePackage' script to create your package. CreatePackage requires a few arguments, and running CreatePackage without any arguments will give you a concise overview of what you
need to supply to it.
To create our MPlayer package, we invoke CreatePackage by typing:
./CreatePackage /usr/local/src/MPlayer-1.0pre5 MPlayer-1.0pre5 gmplayer Recipe.MPlayer "--enable-gui"
To break down the arguments:
Arg1: Path to the program's source files /usr/local/src/MPlayer-1.0pre5
Arg2: Name of the program (arbritrary, use whatever you like) MPlayer-1.0pre5
Arg3: Name of the binary which will launch the compiled program gmplayer
Arg4: Filename of the recipe you wish to use (MUST be in the current directory).
Arg5: Any additional commands you would like to send to the configure script when compiling (this is just exported to the recipe as a variable so even if the program does not use a configure script, you can still specify options which the recipe will
insert into the right place).
If there are no additional options you wish to specify, you must still provide the argument, but just use empty quotes: ""
And that's it. The program should compile, and be packaged up into a nice
To distribute the package, just have your users download the tarball and instruct them to extract its contents to wherever they like (I like to place my packages under /Applications but it's entirely up to the user).
All configuration files (if applicable) will be contained within the extracted package directory. Regardless of where the user extracts the tarball, the program should still be able to find all required config files, libraries etc just fine.
To run the program, the user just navigates to the directory and executes the "AppRun" script. If they use Rox-Filer, all they need to do is click on the directory in Rox to launch the program.