This is a guide to building ipkg for the Zaurus Sharp ROM and distributing them as a feed.

Building a Package

  1. Create a directory somewhere on your drive, let's call it ipk, but you can choose anything
  2. Inside the directory create a directory called CONTROL
  3. On the Sharp ROM, everything gets installed in opt so create an opt directory
  4. Now create the paths on opt to all the files you wish to install, including the files
  5. Inside CONTROL create a text file called control, an example of which is given below. All the files you wish to install must be listed in control on the files line, separated by spaces
  6. Run the ipkg-build.sh script with the target directory as the only argument
  7. Your ipkg file should be built

An example ipkg directory structure:

 /home/user/ipk
 /home/user/ipk/CONTROL
 /home/user/ipk/CONTROL/control
 /home/user/ipk/opt
 /home/user/ipk/opt/Qtopia
 /home/user/ipk/opt/Qtopia/lib
 /home/user/ipk/opt/Qtopia/lib/libexample.so.1.0
 /home/user/ipk/opt/Qtopia/lib/libeg.so.1.0

The example control file:

Files: opt/Qtopia/lib/libexample.so.1.0 opt/Qtopia/lib/libeg.so.1.0
Package: libexample
Priority: optional
Maintainer: A User 
Architecture: arm
Section: libs
Version: 1.0
Description: Example libraries

In CONTROL you can also include pre and post installation scripts, post removal (uninstall) scripts. They should be called preinst, postinst, postrm. See ipkg-build.sh for more details. These are bash scripts that can do things like make symlinks for your library. Control scripts do not need to be listed in the Files manifest.

A postinst script for our example:

#!/bin/sh
# make symlinks for library
ln -sf /opt/Qtopia/lib/libexample.so.1.0 /opt/Qtopia/lib/libexample.so
ln -sf /opt/Qtopia/lib/libexample.so.1.0 /opt/Qtopia/lib/libexample.so.1
ln -sf /opt/Qtopia/lib/libeg.so.1.0 /opt/Qtopia/lib/libeg.so
ln -sf /opt/Qtopia/lib/libeg.so.1.0 /opt/Qtopia/lib/libeg.so.1

A postrm script for our example:

#!/bin/sh
# remove symlinks
rm /opt/Qtopia/lib/libexample.so
rm /opt/Qtopia/lib/libexample.so.1
rm /opt/Qtopia/lib/libeg.so
rm /opt/Qtopia/lib/libeg.so.1

Note that uninstalling the package will remove all the files listed in the manifest so there is no need to remove those files in the postrm script.

Building a Feed

  1. Create a directory on your webserver
  2. Upload all your ipks to the directory
  3. Run the ipkg-make-index.sh script on the directory to create the Packages file

You can run the script on a local copy of the directory and upload the Packages file separately. Only include the latest version of each package.