2005年4月24日 星期日

FreeBSD ports in Debian

我一直滿喜歡 FreeBSD 的 ports 的,但是比較習慣 Linux 的 kernel。至於 Gentoo 嘛,python-base 玩起來實在很慢,雖然有一些可以加速的 solution,但是我覺得還是滿慢的。所以我試著在 Debian 上玩 FreeBSD 的 ports。

首先,當然是先裝一下 cvsup (Debian 的 pool 就有了)。因為有些工具 FreeBSD 跟 Linux 不相容的關係,還得裝一下 freebsd5-buildutils。

然後找台 FreeBSD 把他的 /usr/share/examples/cvsup/standard-supfile 偷過來。裡面有些設定得改一下,例如像這樣:

*default host=freebsd.csie.ntu.edu.tw
*default base=/home/victor/usr/var/db
*default prefix=/home/victor/usr


檔名如果取成 ports-supfile 的話,就執行

cvsup -g -Z -L 2 ports-supfile


把 ports 拉回來。

另外,freebsd5-buildutils 的 /usr/share/freebsd5-buildutils/ports/bsd.port.mk 是沒辦法直接用的(version 5.3+2-2)。剛才把這個 bug report 上去了(URL),不知道他會不會理我 XD 如果不行的話,可以拿這個 patch 去用。裡面應該還有其他東西要改啦,不過這樣子已經夠 make 不少東西了。

由於 FreeBSD ports 本來就是設計給 FreeBSD 用的(?),所以有些參數得從 /etc/make.conf override 掉。例如:

ARCH=i686
OSVERSION=502123
PKGINSTALLVER=0

GNU_CONFIGURE=1
CONFIGURE_MAX_CMD_LEN!=/usr/bin/getconf ARG_MAX

FETCH_CMD=/usr/bin/wget

# override default SH=sh , 避免 configure 產生錯的 libtool
SH=/bin/sh

PREFIX=/home/victor/usr
PORTSDIR=/home/victor
PORT_DBDIR=$(PREFIX)/var/db/ports
PKG_DBDIR=$(PREFEX)/var/db/pkg

NO_DEPENDS=1
WITH_GLIB=2


最後就是真的 make install 啦。由於 make 版本不同的關係,必須用 freebsd5-buildutils 裡提供的 freebsd-make 來裝(pmake 是 NetBSD make)。如果沒意外的話,就可以 make 啦:

freebsd-make WITH_OPENSSL_BASE=1


至於 make install 的話,因為我懶得去追 sed(1) regular expression 格式有些不一樣的問題,所以沒去修。我在 bug report 裡面建議他生個 freebsd-sed 出來。

結論是,為什麼我要做這種事呢 XD 還是用之前寫的 debpatch 比較實在 XD 缺點就是 patch 們得自己 maintain 了。

2 則留言:

Antoniowei 提到...

The idea of integrating FreeBSD ports into Debian is intriguing, offering access to a vast library of software. However, careful attention is needed to manage compatibility, dependency conflicts, and maintain a consistent system environment. Documentation and support could also present challenges for users unfamiliar with FreeBSD conventions.
New York Divorce No Fault

davidrichard 提到...

The idea of integrating FreeBSD ports into Debian is intriguing, offering access to a vast library of software. However, careful attention is needed to manage compatibility, dependency conflicts, and maintain a consistent system environment. Documentation and support could also present challenges for users unfamiliar with FreeBSD conventions.
Arc fault Breakers buyers in Mesa