- 代碼: 選擇全部
apt-get install dpkg-dev gcc debhelper libgtk2.0-dev libatk1.0-dev libpango1.0-dev libxtst-dev imagemagick fakeroot lintian
# imagemagick 只是用來建立 debian 風格的 icon,不會影響套件完成後的相依性
# fakeroot lintian 不一定要裝沒關係
2. 下載 gcin 原始碼 和 GcinDebianization.diff.gz 6.6 KB
3. 將 gcin-0.9.6.tar.bz2 和 GcinDebianization.diff.gz 放在同一個目錄下,執行:
- 代碼: 選擇全部
#!/bin/sh
tar jxvf gcin-0.9.6.tar.bz2
gunzip GcinDebianization.diff.gz
cd gcin-0.9.6
patch -p1 <../GcinDebianization.diff
patch -p1 <debian/PatchToDebianStyle.diff
chmod 755 debian/rules
dpkg-buildpackage -rfakeroot
如果沒有安裝 fakeroot,必需改用 root 權限執行 dpkg-buildpackage
4. 已經完成啦!保證超乎想像的快!
現在可以用 lintian 檢查一下剛出爐的 deb。如果剛剛沒有任何修改,那錯誤訊息只有底下五行。如果還是看不慣,就把所有的 root <root@unknown> 改掉吧!
- 代碼: 選擇全部
W: gcin: readme-debian-contains-debmake-default-email-address
E: gcin: sharedobject-in-library-directory-not-actually-a-shlib usr/lib/libgcin-im-client.so
E: gcin: debian-changelog-file-contains-debmake-default-email-address root@unknown
W: gcin: maintainer-not-full-name root
E: gcin: maintainer-address-malformed root <root@unknown>
新 deb 的 檔案/目錄 結構,純 Debian 風格。
/usr/bin: gcin tsd2a tsa2d phoa2d phod2a tslearn gcin-setup gcin2tab
/usr/share/pixmaps: gcin.png gcin.xpm
/usr/share/pixmaps/gcin: pin-fixed24.png pin-float16.png
/usr/share/gcin/table:
pho.tab tsin.idx cj.gtab ar30.gtab dayi3.gtab pinyin.gtab jyutping.gtab cj5.gtab et.kbm et-asdf.kbm et26.kbm et26-asdf.kbm zo.kbm zo-asdf.kbm ibm.kbm tsin hsu.kbm pho-huge.tab simplex.gtab symbol-table gtab.list phrase.table
/usr/share/gcin/script:
gcin-user-setup gcin-utf8-setup utf8-edit
/usr/share/doc/gcin: changelog.gz README.zh_TW README.Debian copyright changelog.Debian.gz
使用 gcin-setup 的「求助(H)」時會呼叫 README.zh_TW
/usr/share/man/man1: gcin.1.gz gcin2tab.1.gz gcin-setup.1.gz phoa2d.1.gz phod2a.1.gz tsa2d.1.gz tsd2a.1.gz tslearn.1.gz
/usr/lib: libgcin-im-client.so
/usr/lib/gtk-2.0/2.4.0/immodules: im-gcin.so
/usr/lib/menu: gcin(兩檔合一,內含 gcin-setup)
/usr/include: gcin-im-client.h
另外也同時建立了 postinst 和 postrm,自動更新 menu 和 gtk.immodules
postinst 的內容:
- 代碼: 選擇全部
#!/bin/sh
set -e
if [ "$1" = "configure" ]; then
/usr/sbin/update-gtk-immodules
fi
# Automatically added by dh_installmenu
if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
update-menus
fi
# End automatically added section
exit 0
postrm 的內容:
- 代碼: 選擇全部
#!/bin/sh
set -e
# Automatically added by dh_installmenu
if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
# End automatically added section
if [ "$1" = "remove" ]; then
/usr/sbin/update-gtk-immodules
fi
exit 0