Projects:Android:Opkg

Opkg is a lightweight package management system. It is written in C and resembles apt/dpkg in operation. It is currently used on embedded Linux devices, and it is possible to use it with Android.

Compiling
To build a statically-linked version of Opkg, simply check a copy out of SVN and run

LDFLAGS=-static ./autogen.sh --enable-sha256=no --enable-openssl=no --enable-ssl-curl=no --enable-gpg=no --enable-curl=no --with-opkglibdir=/cache/usr/lib --with-opkgetcdir=/cache/etc make clean make gcc -Ilibopkg -g -O2 -static -o opkg-cl src/opkg-cl.o libopkg/.libs/libopkg.a libbb/.libs/libbb.a

You should cross-compile for your target platform. Since Android runs on the little-endian ARM platform, you could also just use a qemu-arm-static chroot debootstrap'd with Debian armel.

Configuration
Configuration files go under /cache/etc. When Opkg is run, it reads everything in that directory. Through configuration, it is possible to specify preferred architectures, repositories, and other options.

Scratch Area
Opkg needs a place to put temporary files while it works. /cache is pretty universal on Android phones.

option tmp_dir /cache

Architectures
Architectures specify what can be installed on the system. Furthermore, multiple packages may be added to a repository with the same name, and architecture preferences are used to choose the best package for installation. Here's a nonstandard recommendation...

MDPI Devices
arch all 1 arch any 6 arch noarch 11 arch arm 16 arch armel 21 arch apk 26 arch apkmdpi 31

HDPI Devices
arch all 1 arch any 6 arch noarch 11 arch arm 16 arch armel 21 arch apk 26 arch apkmdpi 31 arch apkhdpi 36

Repositories
Repositories are simply Web servers with packages and an index. They allow Opkg to fully utilize its dependency resolution capabilities. Indices may be either uncompressed or gzipped.

src inportb-android-froyo http://repo.inportb.com/android/froyo src/gz inportb-android-froyo http://repo.inportb.com/android/froyo

Standardization
This is new stuff, so many things have yet to be standardized. Where should configuration and temporary files go? What architectures should be used?