顯示具有 debian 標籤的文章。 顯示所有文章
顯示具有 debian 標籤的文章。 顯示所有文章

2007年4月16日 星期一

Our-Conf

maintain 多台 debian 機器的設定檔很麻煩,所以我寫了一個 package 來做這件事。

下載之後,目錄裡面會有個 ROOT 目錄,直接對應到你系統上的 /。直接把設定檔放進去,就像裡面的 ROOT/etc/hosts 那樣。然後 make,就會生出 our-conf.deb 了 :D

Our-Conf

2006年11月3日 星期五

debpatch 0.99.10

[lang_zh]
這幾天幫 debpatch 加了新功能 :D

debpatch 舊的功能是自動幫 package 加 patch 然後重新 dpkg-buildpackage 出新的 deb。你所需要做的事是把你的 patch 丟到 /etc/debpatch/PACKAGE.d/ 底下。甚至 patch 之前,還可以 prepatch (PACKAGE.prepatch) 他(例如說在 debian/rules 裡面加一行
include /usr/share/cdbs/1/rules/simple-patchsys.mk

但是如果今天要 patch 的 package 是 locales 的一個檔案(我有這個需求,因為要改 UTF-8.gz),就得把「整個」glibc 重編... 所以我這兩天幫 debpatch 加上新功能,來「取代」package 裡的檔案。

所以現在我要做的事情就變成把我的 UTF-8.gz 丟到 /etc/debpatch/locales.d/data/usr/share/i18n/charmaps/UTF-8.gz 然後 build 就行了 :D (注意那個 data 目錄,概念上可以當成是 install 時的根目錄)
[/lang_zh]

[lang_en]
I add a new feature to debpatch :)

debpatch is a application to help you patch package in a easy manner, it'll like to put your patch in to /etc/debpatch/PACKAGE.d/ or prepatch with /etc/debpatch/PACKAGE.prepatch .

But when I wanted to patch a file like /usr/share/i18n/charmaps/UTF-8.gz , I had to rebuild the whole glibc package"s", which are a big job. So I added a new feature to replace files during these few days.

So what I have to do now is to put my own UTF-8.gz into /etc/debpatch/locales.d/data/usr/share/i18n/charmaps/UTF-8.gz and rebuild. That's it. (Note the "data" directory. Conceptually it can be regarded as the root directory when you install that package)
[/lang_en]

2006年11月1日 星期三

ar / dpkg-deb

[lang_zh]
昨天我提過的問題我在一個討論串中找到答案了。

ar 有不同的版本,例如 SVr4/GNU 的 ar 包成 archive 時,檔名是以 '/' 當作結尾,而 BSD 的 ar 不是。dpkg 用的是 BSD 的格式(而不是 GNU? XD),所以當我在 Debian 上用 GNU 的 ar 做 deb 時,檔名是用 '/' 結尾。而 apt-get 抓下來安裝時,卻發現檔名多了 '/',這不是他喜歡的樣子。

新的 dpkg 應該是同時 support 兩種格式的,但是我測試的 package (in fact, it's locales) 裡面的 debian-binary 是 2.0 (舊版)。不過.. dpkg tools 好像還是沒支援對 deb 寫入的功能 :(

暫時先不理他好了,反正這是 harmless ..
[/lang_zh]

[lang_en]
My problem is located in this discussion

There are different versions of ar. SVr4/GNU's ar packs archive with filename delimited by '/', but BSD's doesn't. dpkg(1) uses BSD's ar format (instead of GNU? XD). So what I built my deb with GNU ar, filenames are end with '/'. When apt-get is trying to install it, it found the filename is not what it expects.

New dpkg supposes to support both format, but the package I'm working on (in fact, it's locales) says it's debian-binary is 2.0, which is old. Anyway, it seems that dpkg tools doesn't support writing to deb until now.

Well, I guess I could ignore it since it's harmless..
[/lang_en]

2006年10月31日 星期二

not a valid DEB package

[lang_zh]
今天在用 ar 取代 .deb 裡面的 control.tar.gz 跟 data.tar.gz 時(關於 ar 跟 deb,請見我之前提過的這篇,發現做出來的 deb 會讓 apt-get install 叫 "not a valid DEB package"。雖然只是 warning,不過看了很不爽。

經過這篇 Creating Debian Packages 的提示,發現要用 dpkg-deb 做才不會有這個 warning。於是我好奇地拿兩個方法做出來的 deb 解開看,內容(包括 data 跟 control)完全一模一樣。但 dinary diff 之後的確有一小段差異,不知道是不是什麼 comment @@

不過.. 我要寫的東西只是將 package 裡面的少數幾個檔案換掉。所以用 ar 來做,所需的步驟大概是:

  1. ar x 解開

  2. gunzip data.tar.gz

  3. tar uf data.tar my_file

  4. gzip data.tar

  5. ar r data.tar.gz


但是用 dpkg-deb 的話,就必須把整個 data.tar.gz 「全解開」,丟我的檔案進去,tgz 起來... 有時間再來看看那段疑似 comment/signature 的東西是什麼 @@
[/lang_zh]

[lang_en]
I was trying to "replace" control.tar.gz and data.tar.gz in a .deb package using ar(1) command. Yes it works, but the new package make apt-get cry "not a valid DEB package." Although it's just a warning, it makes me feel bad.

I searched this problem with google and found Creating Debian Packages. It said you have to use dpkg-deb(1) to build .deb to free the warning. Curiously, I checked the two .deb (generated by ar and dpkg-deb) by extracting the package, but they were all the same. Then I took a look at the binary diff of these two, they really had some bytes of different. I don't know if they were comment or so.

Actually, what I want to do is to replace a few files in a deb package. Do it with ar(1), I only need to:


  1. ar x to extract
  2. gunzip data.tar.gz
  3. tar uf data.tar my_file
  4. gzip data.tar
  5. ar r data.tar.gz


However, with dpkg-deb(1), I have to extract the whole data.tar.gz, putting my file in, and then re-tgz it, which is very bad. I'll try to figure what the magic bytes is later.
[/lang_en]

2006年3月18日 星期六

debian 的 urxvt 7.5-1 ...

好一陣子前升級到 urxvt 7.5-1 之後,每次開它都會叫 "urxvt: unable to load base fontset, please specify a valid one using -fn, aborting." 結果查不到原因只好 downgrade 回 stable,變成這樣... Orz

剛發現... 問題是上傳的 binary 有問題 %^!#$^#!$%#%$!
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=351371

2005年7月13日 星期三

xorg 終於要進 sid 了!

剛發現現在 xorg 已經在 incoming.debian.org 出現了!不過我是裝 ubuntu 的 xorg,所以沒什麼差就是了 :Q

BTW,好久沒 blog 了。

2005年6月8日 星期三

dpkg -S

[lang_zh]
之前要查一個檔案在那一個 package 裡面都用 apt-file,它有個壞處是要手動更新 package 的資訊(麻煩,且導致 apt-file 跟 package system 不同步)。剛才發現原來 dpkg -S 可以做到同樣的事情!
[/lang_zh]

[lang_en]
I used to use apt-file to search which file is in which package. But the disadvantage is you have to upda the package information manually (annoying, also causing the asynchronization to the package system).

I just found the dpkg -S can do the same thing. Since it use the same database as the package system, there's not the same problem!
[/lang_en]

2005年5月11日 星期三

glibc typo

[lang_zh]
glibc 裡面的 localedata/charmaps/BIG5 裡面,把 Arphic 拚錯了 :p
[/lang_zh]

[lang_en]
There is a wrong spelling in file localedata/charmaps/BIG5 of glibc. The "Aprhic should be Arphic.
[/lang_en]



% This charmap is converted from:
% ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
% and also merged several characters (/xc6/xa1-/xc7/xfc) from:
% Aprhic Tech. CO., LTD. Big5 Unicode mapping table.

2005年5月4日 星期三

irssi 0.8.10-rc5

[lang_zh]
參考這篇 把 irssi 0.8.9 + recode.pl upgrade 成 irssi 0.8.10-rc5 with native recode。Everything works perfectly! :D

BTW, debian 的 package 在這兒:
[/lang_zh]

[lang_en]
Refering to this article, I just upgrade my irssi from 0.8.9 + recode.pl to 0.8.10-rc5 with native recode. Everything works perfectly! :D

BTW, debian's package is over here:
[/lang_en]


deb http://irssi.qvr.info/debian/ sarge/

2005年5月3日 星期二

no OpenSSL in lftp 3.1.3-1 :X

[lang_zh]
lftp 3.1.3-1 把 OpenSSL 拿掉了 Orz,因為 OpenSSL 的 license 與 GPL 相容性的爭議 :X
[/lang_zh]

[lang_en]
OpenSSL is removed in lftp 3.1.3-1 because of the license incompatibility with GTL :/
[/lang_en]


lftp (3.1.3-1) unstable; urgency=medium

* new upstream from 2005-04-15
* disabled ssl support because of license problem. See:
http://bugs.debian.org/305160
http://www.mail-archive.com/lftp%40uniyar.ac.ru/msg02012.html
http://www.openssl.org/support/faq.html#LEGAL2
http://www.gnome.org/~markmc/openssl-and-the-gpl.html
If the author add the needed exception to allow to link
against openssl it will be enabled again.
Better a lftp without ssl than no lftp in sarge.
(closes: Bug#305160)

-- Noèl Köthe Thu, 28 Apr 2005 18:11:59 +0200

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 了。

2005年3月2日 星期三

cpanplus's dependency.deb


我把 cpanplus depend 的 perl packages 全包成 deb 了。如果想裝這些 cpanplus 跟這些 packages,可以在 /etc/apt/sources.list 中加入




deb http://victor.csie.org/debian/ unstable cpanplus


並安裝 libcpanplus-perl-snapshot :)





順便讀了 Debian Policy Manual 中關於 Conflics, Provieds, Replaces 的部分 :)

2004年12月28日 星期二

好用的 ar

[lang_zh]
原來 ar(1) 這麼好用!
剛才抓了 ATI radeon for linux 的 driver,
先用 alien 轉成 deb 之後,
要裝時才發現 dependency 出了一點問題。
有某一個檔案在 xlibmesa-gl 裡面已經有了 @_@
於是想到之前 kane 說過的 ar。


ar x XXX.deb 可以解開這個 archive,
並得到幾個檔案 (以我這邊的例子是 control.tar.gz data.tar.gz debian-binary)。
然後把 control.tar.gz 裡面的 control 加一下 Replaces、
包回去 control.tar.gz。
再來,
ar r XXX.deb control.tar.gz !!
可以把 XXX.deb 裡面的 control.tar.gz replace 掉!
再來就可以很高興地 dpkg -i XXX.deb 了 :D

當然還可以做其他像是..
delete, append 之類的、
還有 move, print 等等的,
不錯用 :p
[/lang_zh]

[lang_en]
Hey, ar(1) is such a useful stuff! I downloaded ATI radeon's driver for Linux, and use alien to convert it to deb. But something wrong about dependency happened when I try to install it. Some file had already been there in xlibmesa-gl @_@ Then I think of ar, what kane has mentioned before.

ar x XXX.deb will help you extract this archive, and you'll get several files (control.tar.gz, data.tar.gz, debian-binary in my case). What I did next is to add a /Replaces/ to the /control/ inside control.tar.gz and put it back.

The last step is ar r XXX.deb control.tar.gz !! It'll replace control.tar.gz inside XXX.deb with the given one! Finally, I can dpkg -i XXX.deb happily :)

Of course there are something useful such as delete, append, move, and print. They're helpful :)
[/lang_en]