Inhaltsverzeichnis
Overview
The Itsy Package Management (ipkg) is mainly used for embedded systems. It reproduces a subset of the debian package management system (dpkg).
At least the following distributions use ipkg:
openwrt - for the Linksys WRT54G wireless router
FamiliarDistribution - for the Compaq iPAQ
Palm webOS - for the Palm Pre smartphone
It is quite easy to package self written or ported software for the Itsy Package Management system. The following text will show you, how it works and where to get the information alternatively.
You may also want to maintain a repository of your package(s) to ease the installation for your users. This part will be a little bit tricky, if you want to do this through a web interface. But it will be worth the trouble!
(the command line interface works out of the box)
Requirements
You need to install ipkg-util. It includes the necessary tools to build packages and to manage a repository.
Before installing ipkg-util you need the following packages (as of debian):
- python2.3
- python2.3-dev
- python2.3-libxml2
- gcc
- make
- fakeroot (recommended)
(change the version of python according to your system - version 2.1 should work too)
Then you can start:
get ipkg-util from handhelds.org
untar it and then
make make install
If you need more than the most essential tools of ipkg-util, then you should add the necessary files to the first line of the Makefile und do make install again. At least the following scripts should be included this way:
- ipkg-buildpackage
- ipkg-make-index
- ipkg-update-index
Change the first line of ipkg-make-index to:
To build ipkg packages with tar instead of ar (as some small system do not support it) then you should change line 215 to:
ipkg-build -c /tmp/${pkg} || exit 1
Building a package
There are some useful tutorials in the internet:
http://handhelds.org/moin/moin.cgi/BuildingIpkgs - a good one (hint: there the control directory is named CONTROL, but ipkg would be more appropriate)
http://download.intrinsyc.com/supported/os/linux/distribution/i-linux-4.1/i-packages-1.1/src/hello-world/HOWTO-ipkg - quite detailed
http://openwrt.org/BuildingPackages?highlight=%28ipkg%29 - short and fast
After you finished your preparations as described, you run
fakeroot ipkg-buildpackage
To sign the package, you type gpg -sab $IPKG_FILE.
Managing a repository
You can manage a repository with command line tools or a web interface. Both are part of ipkg-util.
command line
- build your package(s)
- copy the binaries to the destination directory (DEST_DIR)
run ipkg-make-index $DEST_DIR
to add a single package, you do: ipkg-update index $DEST_DIR $PACKAGE_FILE
web interface
This needs a bit of preparation, as the cgi that comes with ipkg-util is not ready to use.
Hint: the web interface assumes that you maintain more than one repository - e.g. unstable, devel and so on. This can be changed, of course.
Try the following steps:
copy upload-package.cgi to the cgi-bin-directory of your webserver (e.g.: /usr/lib/cgi-bin)
create the parent directory for the repositories within the webserver's document tree (e.g.: /var/www/ipkg/)
- fix some problems of the cgi-script:
change the first line to #!/usr/bin/env python
remove one of the feeds_base lines
- point the other line to the directory you recently created
line 85: add the complete path to ipkg-update-index
- change the mail addresses in line 94 to 100
comment out lines 189 to 191, as they prevent you from building tar packages (instead of ar)
fix the path of gpgv in lines 198 and 204
comment out line 214 to disable rss feeds (I did not try to get it working)
- change line 255 and 256 to fit your needs
change line 281 from # make_index(feed_dir) to:
update_index(feed_dir, feed_dir + form["filename"].filename)
you should change line 285 und 298 from h1 to h2
change the action attribut in line 299 to the URL of the cgi script
- change the name of the repositories in line 302 and 303, if you like
make subdirectories for the repositories, you want to host (the defaults of the original cgi are: unstable and devel)
- signed package management:
install gnupg
- import public keys of the people who are allowed to upload packages
copy the public keyring file to keyring.gpg in each of your repository directories
- the keyring files should be readable by the user of your webserver
- the repository directories should be writable by the webserver user
If you want to upload you freshly built packages automatically, then you may use the following curl command:
curl -F "filename=@$(IPKG_FILE)" \ -F "signaturefilename=@$(SIG_FILE)" \ -F "sourcefilename=@$(SRC_FILE)" \ -F "feedname=unstable" \ $(CGI_URL)