Wednesday, September 28, 2011

arch build system-howto

/usr/share/vim/vimfiles/doc/Untitled.html
arch的安装包管理机制类似debian的deb包管理机制

昨天ibus更新导致无法激活中文输入,上irc问了问才知道需要重新编译ibus-sunpinyin.

于是 https://wiki.archlinux.org/index.php/ABS 根据wiki学习了一下.

首先需要安装abs
# pacman -S abs
然后安装编译环境
# pacman -S base-devel

然后根据需要编辑/etc/abs.conf
# vim /etc/abs.conf
去除你想编译的包的源,比如:
REPOS=(core extra community !testing)

接着下载ABS tree
# abs
你的ABS tree 将在/var/abs目录创建.

你也可以单独下载你需要编译的软件包:
# abs <repository>/<package>
(比如 # abs community/ibus-sunpinyin)

The ABS tree

When you run abs for the first time, it synchronizes the ABS tree on the Arch Linux server to your computer. The ABS tree is an SVN directory hierarchy located under /var/abs and looks like this:

| -- core/
|     || -- base/
|     ||     || -- acl/
|     ||     ||     || -- PKGBUILD
|     ||     || -- attr/
|     ||     ||     || -- PKGBUILD
|     ||     || -- ...
|     || -- devel/
|     ||     || -- abs/
|     ||     ||     || -- PKGBUILD
|     ||     || -- autoconf/
|     ||     ||     || -- PKGBUILD
|     ||     || -- ...
|     || -- ...
| -- extra/
|     || -- daemons/
|     ||     || -- acpid/
|     ||     ||     || -- PKGBUILD
|     ||     ||     || -- ...
|     ||     || -- apache/
|     ||     ||     || -- ...
|     ||     || -- ...
|     || -- ...
| -- community/
|     || -- ...

The ABS tree has exactly the same structure as the package database:

    First-level: Category directories
    Second-level: Package name directories
    Third level: PKGBUILD (contains information needed to build a package) and other related files (patches, other files needed for building the package)

The source code for the package is not present in the ABS directory. Instead, the PKGBUILD file contains a URL that will download the source code when the package is built.

创建软件目录
$ mkdir -p $HOME/abs
然后拷贝你需要编译的软件到你的abs目录(比如ibus-sunpinyin)
$ cp -r /var/abs/community/ibus-sunpinyin ~/abs
然后进入工作目录
$ cd ~/abs/ibs-sunpinyin
编辑PKGBUILD文件(add or remove support for components, to patch or to change package versions, etc. (optional):)
$ vim PKGBUILD
然后以普通用户编译(with -s switch to install with automatic dependency handling)
$ makepkg -s
然后以root安装
# pacman -U ibus-sunpinyin-2.0.3-1-x86_64.pkg.tar.xz

No comments: