MIPKG Brief
时间:2007-03-23 来源:hellwolf
MIPKG Brief
Last Update Time : 23/03/07
Contents
1.Introduction 1
2.Requirements 1
3.Installation 1
4.Usage 2
Repository Operations 3
Command add 3
Command delrepo 3
Command listrepo 3
Command repoinfo 3
Package Management 3
Update packages list 3
List available packages 3
Install packages 4
Remove packages 4
Upgrade packages 4
5.Creating ipkg file 4
6.Hacking 4
-
Introduction
MIPKG is abbreviation for Multirepo Ipkg PacKaGe manager. As its name suggests, it's based on ipkg, which can be found here http://handhelds.org/moin/moin.cgi/Ipkg . "Multirepo" means we can install softwares to different repository, and dependencies are resolved cross every repositories. That is to say, to use mipkg we have a distributed package database semanteme for package management.
-
Requirements
-
shells : bash, ash(busybox)
-
tar : gnu tar, tar(busybox) with gnu extension option
-
wget
-
Installation
Mipkg is still in developing, and only available in cvs currently, you can checkout it by :
$ cvs -d:pserver:[email protected]:/cvsroot/ybuild login
$ cvs -z3 -d:pserver:[email protected]:/cvsroot/ybuild co -P mipkg
A web interface is available also : http://ybuild.cvs.sourceforge.net/ybuild/mipkg/
Then prepare a BUILD directory somewhere, in it you can create a i386-linux directory for building native ipkg tool, a arm-linux for use on arm machine. Then you build the software for each platform by :
$ /path/to/mipkg/configure –prefix=/usr --with-ipkglibdir=/ --with-mipkglibdir=/mipkg
$ make
$ make DESTDIR=/path/to/offline/root/if/needed install
That's it. You can run the native version without a argument to see if it works:
$ mipkg
Usage: mipkg [OPTION] command
Multirepos Ipkg PacKaGes manager
Options:
-r, --root=dir treat dir as root directory
-c, --config=file config file path
-h, --help display this help and exit
-V, --version output version information and exit
Commands:
addrepo add a new sub repo to main repo
delrepo delete a sub repo from main repo
listrepo list available sub repos in main repo
repoinfo display infomation on repository
syncrepo synchron sub repos with centre repo
list list packages installed in main repo
available list packages available for installation
install install new packages to sub repo
remove remove packages from sub repo
update update software sources list
upgradecheck check upgradable packages
upgrade upgrade software available listed in sources list
Command needed
-
Usage
Firstly you should create a mipkg config file for mipkg, in it you need to specify these things :
-
Package architectures we can accept
-
Package source list(debian like)
An example of it looks like :
arch arm
arch all
arch noarch
src main http://www.someplace.org/arm/yrepos/ipks/base
In this config, we will accept packages built for arm, all or noarch platform. And a software list in http://www.someplace.org/arm/yrepos/ipks/base will be updated.
You can specify the path of config file use "-c, --config" option, or you can export a MIPKG_CONF environment variable instead.
For offline root use of mipkg, you can use "-r, --root" option, or MIPKG_ROOT environment variable.
Repository Operations
Command add
To add a repository you should use :
mipkg addrepo name origdest redirect_to
name : the literal name of the repository
origdest : path of the real location of repository
redirect_to : if this value is different to origdest, mipkg will create a bunch of symlinks referencing to the files of installed packages of this repository. Which is useful if the origdest is not the prefix that softwares compiled with.
For examples, you can invoke it like this :
mipkg addrepo main / /
mipkg addrepo usbdisk1 /media/disk1 /opt
Command delrepo
remove specified repository be caution that dependencies of the package will be removed from centre database.
Command listrepo
to list availabe repositories
Command repoinfo
check infomations on repository
Package Management
Update packages list
A update command is enough, internally mipkg download a Packages.gz file from source url specified in config file.
List available packages
Example :
# mipkg available
busybox - 1.4.2-1.y3 - Statically linked binary providing simplified versions of system commands
glibc - 2.5-1.fc6.y12.5-1.y2 - The GNU libc libraries.The GNU libc libraries.
libgcc - 4.1.2-1.y3 - GCC version 4.1 shared support library
libssp - 4.1.2-1.y2 - GCC ssp shared support library
libvolume-id - 095-1.y1 - Dynamic libraries to get volume ids
udev - 095-1.y1 - A userspace implementation of devfs
Install packages
usage : install reponame pkgname...
Install a package to reponame.
You can choose a package name listed in available list, or use a ipk file directly.
Remove packages
Remove packages from repository it belongs, and it will be remove from centre database after a automatically repository sync.
Upgrade packages
Use upgradecheck command to check which packages are upgradable. And use upgrade command without a argument to upgrade all, or specified packags to upgrade in arguments.
-
Creating ipkg file
Ipkg file is a debian like package, ipkg project's origianal guide can be found here : http://handhelds.org/moin/moin.cgi/BuildingIpkgs
But it's highly recommended that you check the infomations on ybuild project, use ybuild and ycross can make everythings more easy.
-
Hacking
Current code is really a mess, and not memory leak free. It's simply a layer over the current ipkg libs. A fork from ipkg is considering, it would be appreciated that if you could give me some suggestion, or join ybuild project directly here : http://sourceforge.net/projects/ybuild.