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

2025年10月14日 星期二

ubuntu-dev-tools: /usr/bin/pbuilder-dist-simple

pbuilder-dist-simple 是個方便用來創建 pbuilder base 的 wrapper 腳本,使用的方式也很特別,就是要自己手動建立一個 symbolic link,然後它就會根據 symbolic link 的名稱來自動解析參數來處理。

例如:questing 是 Ubuntu 25.10 的 series name。

$ dpkg -S /usr/bin/pbuilder-dist-simple
ubuntu-dev-tools: /usr/bin/pbuilder-dist-simple
$ mkdir ~/bin
$ ln -s /usr/bin/pbuilder-dist-simple ~/bin/pbuilder-questing

建立完 symbolic link 就可以直接使用了,如果 PATH 有先設好的話。

$ echo $PATH
/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

$ pbuilder-questing create
W: /root/.pbuilderrc does not exist
I: Distribution is questing.
I: Current time: Tue Oct 14 06:55:39 UTC 2025
I: pbuilder-time-stamp: 1760424939
I: Building the build environment
I: running debootstrap
/usr/sbin/debootstrap
...
I: creating base tarball [/home/user/pbuilder/questing-base.tgz]
...

接下來我們可以抓 Debian libchewing source package 來試試看

$ pull-debian-source libchewing
Found libchewing 0.10.3-1 in sid
...
Downloading libchewing_0.10.3.orig.tar.xz from deb.debian.org (1.571 MiB)
[=====================================================>]100%
Downloading libchewing_0.10.3-1.debian.tar.xz from deb.debian.org (0.008 MiB)
[=====================================================>]100%

$ pbuilder-questing build libchewing_0.10.3-1.dsc
W: /root/.pbuilderrc does not exist
I: pbuilder: network access will be disabled during build
I: Current time: Tue Oct 14 07:02:09 UTC 2025
I: pbuilder-time-stamp: 1760425329
I: Building the build Environment
I: extracting base tarball [/home/user/pbuilder/questing-base.tgz]
...
dpkg-deb: building package 'libchewing3-data' in '../libchewing3-data_0.10.3-1_all.deb'.
dpkg-deb: building package 'libchewing3-dev' in '../libchewing3-dev_0.10.3-1_amd64.deb'.
dpkg-deb: building package 'libchewing3' in '../libchewing3_0.10.3-1_amd64.deb'.
dpkg-deb: building package 'chewing-tools' in '../chewing-tools_0.10.3-1_amd64.deb'.
...

$ cd ~/pbuilder/ && ls *chewing*
chewing-tools_0.10.3-1_amd64.deb          libchewing_0.10.3-1_amd64.buildinfo  libchewing_0.10.3-1.debian.tar.xz  libchewing_0.10.3-1_source.changes  libchewing3_0.10.3-1_amd64.deb     libchewing3-dbgsym_0.10.3-1_amd64.ddeb
chewing-tools-dbgsym_0.10.3-1_amd64.ddeb  libchewing_0.10.3-1_amd64.changes    libchewing_0.10.3-1.dsc            libchewing_0.10.3.orig.tar.xz       libchewing3-data_0.10.3-1_all.deb  libchewing3-dev_0.10.3-1_amd64.deb

看起來目前的 libchewing 0.10.3-1 in sid 可以在 Ubuntu 25.10 正常編譯沒有問題。

2024年11月29日 星期五

${shlibs:Depends} 使用上的一些陷阱

其實 0~git202411270842.3c1cdd3 這樣的 Debian Version 會等於 0~git202411270842.3c1cdd3-0

$ dpkg --compare-versions 0~git202411270842.3c1cdd3-0 eq 0~git202411270842.3c1cdd3; echo $?
0

於是 0~git202411270842.3c1cdd3-0~ 這樣的 Debian Version 就會小於 0~git202411270842.3c1cdd3

$ dpkg --compare-versions 0~git202411270842.3c1cdd3-0~ lt 0~git202411270842.3c1cdd3; echo $?
0

例如套件 A 使用了 0~git202411270842.3c1cdd3-0~ 這樣的版號。

陷阱來自於在套件 B 的 debian/control 裡面相依性使用 ${shlibs:Depends} 時,只會找到套件 A 的 upstream version 而已,然後會自動代入 (>= 0~git202411270842.3c1cdd3) 這樣的版號相依。

於是在套件 B 的 Debian packaging 打包後,就會遇到明明套件 B 的 Debian source packages 可以成功編譯成 Debian binary packages,但是卻無法安裝使用的情況。

$ sudo apt install libcamhal-ipu6ep
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libcamhal-ipu6ep : Depends: libbroxton-ia-pal-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libgcss-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-aiq-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-aiqb-parser-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-bcomp-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-cca-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-cmc-parser-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-coordinate-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-dvs-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-emd-decoder-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-exc-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-isp-bxt-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-lard-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-log-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-ltm-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-mkn-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
                    Depends: libia-nvm-ipu6ep0 (>= 0~git202411270842.3c1cdd3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

至於解決方法就是避免使用比 0~git202411270842.3c1cdd3-0 還要小的版號,像是可以改用 0~git202411270842.3c1cdd3-1~ 這樣的版號就不會產生問題了。

$ dpkg --compare-versions 0~git202411270842.3c1cdd3-1~ gt 0~git202411270842.3c1cdd3; echo $?
0

以上是測試打包 ppa:oem-solutions-group/intel-ipu6 時的一些心得感想。

2015年9月17日 星期四

從 git repository 自行製作上游軟體的 snapshot tarball

在 Linux 系統上面的軟體開發,偶而會遇到需要直接從 git repository 取出尚未正式釋出的版本,以下分享一下我在參加 DebConf15 後,學會的使用流程。

以下以 http://www.freedesktop.org/wiki/Software/libmbim/ 為例子。

首先要找到 git repository 的位置,然後使用 git 指令 clone 到本地端。

$ git clone git://anongit.freedesktop.org/libmbim/libmbim

然後在該目錄底下,找出最後 commit 的日期。

$ git log -1 --format=%cd --date=short . | sed 's/-//g'
20150910

找出目前的版本號碼,libmbim 的版本號碼在寫作這篇文章時寫在 configure.ac 裡面。

dnl Process this file with autoconf to produce a configure script.                                                                                                                                                                             
AC_PREREQ([2.68])

dnl The libmbim version number
m4_define([mbim_major_version], [1])
m4_define([mbim_minor_version], [13])
m4_define([mbim_micro_version], [0])
m4_define([mbim_version],
          [mbim_major_version.mbim_minor_version.mbim_micro_version])

版本號碼也就是 1.13.0 這樣。

然後檢查一下有沒有 .gitignore,如果有的話要先另建一個文字檔 .gitattributes 放入下面的內容。

.gitattributes export-ignore
.gitignore export-ignore

然後就可以使用 git 跟 xz 指令來產生 tarball 檔案。

$ git archive --worktree-attributes --format=tar --prefix=libmbim-1.13.0+20150910/ HEAD | xz > ../libmbim-1.13.0+20150910.tar.xz

如果本來就沒有 .gitignore 的話,就可以不需要使用參數 --worktree-attributes,這樣產生出來的 tarball 檔案就不會包含 .gitignore 在裡面,在使用 Debian 上的一些 git based 的管理工具,會因為 .gitignore 的存在而產生問題。

最後檢查一下 libmbim-1.13.0+20150910.tar.xz 的內容,看看是否沒有那些不應該存在的 .git 開頭的檔案在裡面。

$ tar tf libmbim-1.13.0+20150910.tar.xz
libmbim-1.13.0+20150910/
libmbim-1.13.0+20150910/AUTHORS
libmbim-1.13.0+20150910/COPYING
libmbim-1.13.0+20150910/COPYING.LIB
libmbim-1.13.0+20150910/Makefile.am
libmbim-1.13.0+20150910/NEWS
libmbim-1.13.0+20150910/README
libmbim-1.13.0+20150910/autogen.sh
libmbim-1.13.0+20150910/build-aux/
libmbim-1.13.0+20150910/build-aux/Makefile.am
libmbim-1.13.0+20150910/build-aux/mbim-codegen/
libmbim-1.13.0+20150910/build-aux/mbim-codegen/Makefile.am
libmbim-1.13.0+20150910/build-aux/mbim-codegen/Message.py
libmbim-1.13.0+20150910/build-aux/mbim-codegen/ObjectList.py
libmbim-1.13.0+20150910/build-aux/mbim-codegen/Struct.py
libmbim-1.13.0+20150910/build-aux/mbim-codegen/mbim-codegen
libmbim-1.13.0+20150910/build-aux/mbim-codegen/utils.py
libmbim-1.13.0+20150910/build-aux/templates/
libmbim-1.13.0+20150910/build-aux/templates/Makefile.am
libmbim-1.13.0+20150910/build-aux/templates/mbim-enum-types-template.c
libmbim-1.13.0+20150910/build-aux/templates/mbim-enum-types-template.h
libmbim-1.13.0+20150910/build-aux/templates/mbim-error-quarks-template.c
libmbim-1.13.0+20150910/build-aux/templates/mbim-error-types-template.c
libmbim-1.13.0+20150910/build-aux/templates/mbim-error-types-template.h
libmbim-1.13.0+20150910/configure.ac
libmbim-1.13.0+20150910/data/
libmbim-1.13.0+20150910/data/Makefile.am
libmbim-1.13.0+20150910/data/mbim-service-auth.json
libmbim-1.13.0+20150910/data/mbim-service-basic-connect.json
libmbim-1.13.0+20150910/data/mbim-service-dss.json
libmbim-1.13.0+20150910/data/mbim-service-ms-firmware-id.json
libmbim-1.13.0+20150910/data/mbim-service-ms-host-shutdown.json
libmbim-1.13.0+20150910/data/mbim-service-phonebook.json
libmbim-1.13.0+20150910/data/mbim-service-proxy-control.json
libmbim-1.13.0+20150910/data/mbim-service-sms.json
libmbim-1.13.0+20150910/data/mbim-service-stk.json
libmbim-1.13.0+20150910/data/mbim-service-ussd.json
libmbim-1.13.0+20150910/data/pkg-config/
libmbim-1.13.0+20150910/data/pkg-config/Makefile.am
libmbim-1.13.0+20150910/data/pkg-config/mbim-glib.pc.in
libmbim-1.13.0+20150910/docs/
libmbim-1.13.0+20150910/docs/Makefile.am
libmbim-1.13.0+20150910/docs/libmbim-icon.svg
libmbim-1.13.0+20150910/docs/libmbim-logo.png
libmbim-1.13.0+20150910/docs/libmbim-logo.svg
libmbim-1.13.0+20150910/docs/man/
libmbim-1.13.0+20150910/docs/man/Makefile.am
libmbim-1.13.0+20150910/docs/reference/
libmbim-1.13.0+20150910/docs/reference/Makefile.am
libmbim-1.13.0+20150910/docs/reference/libmbim-glib/
libmbim-1.13.0+20150910/docs/reference/libmbim-glib/Makefile.am
libmbim-1.13.0+20150910/docs/reference/libmbim-glib/libmbim-glib-common.sections
libmbim-1.13.0+20150910/docs/reference/libmbim-glib/libmbim-glib-docs.xml
libmbim-1.13.0+20150910/docs/reference/libmbim-glib/version.xml.in
libmbim-1.13.0+20150910/gtester.make
libmbim-1.13.0+20150910/m4/
libmbim-1.13.0+20150910/m4/compiler-warnings.m4
libmbim-1.13.0+20150910/src/
libmbim-1.13.0+20150910/src/Makefile.am
libmbim-1.13.0+20150910/src/libmbim-glib/
libmbim-1.13.0+20150910/src/libmbim-glib/Makefile.am
libmbim-1.13.0+20150910/src/libmbim-glib/generated/
libmbim-1.13.0+20150910/src/libmbim-glib/generated/Makefile.am
libmbim-1.13.0+20150910/src/libmbim-glib/libmbim-glib.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-cid.c
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-cid.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-compat.c
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-compat.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-device.c
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-device.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-enums.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-errors.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-message-private.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-message.c
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-message.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-proxy-helpers.c
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-proxy-helpers.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-proxy.c
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-proxy.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-utils.c
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-utils.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-uuid.c
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-uuid.h
libmbim-1.13.0+20150910/src/libmbim-glib/mbim-version.h.in
libmbim-1.13.0+20150910/src/libmbim-glib/test/
libmbim-1.13.0+20150910/src/libmbim-glib/test/Makefile.am
libmbim-1.13.0+20150910/src/libmbim-glib/test/test-cid.c
libmbim-1.13.0+20150910/src/libmbim-glib/test/test-fragment.c
libmbim-1.13.0+20150910/src/libmbim-glib/test/test-message-builder.c
libmbim-1.13.0+20150910/src/libmbim-glib/test/test-message-parser.c
libmbim-1.13.0+20150910/src/libmbim-glib/test/test-message.c
libmbim-1.13.0+20150910/src/libmbim-glib/test/test-proxy-helpers.c
libmbim-1.13.0+20150910/src/libmbim-glib/test/test-uuid.c
libmbim-1.13.0+20150910/src/mbim-proxy/
libmbim-1.13.0+20150910/src/mbim-proxy/76-mbim-proxy-device-ownership.rules.in
libmbim-1.13.0+20150910/src/mbim-proxy/Makefile.am
libmbim-1.13.0+20150910/src/mbim-proxy/mbim-proxy.c
libmbim-1.13.0+20150910/src/mbimcli/
libmbim-1.13.0+20150910/src/mbimcli/Makefile.am
libmbim-1.13.0+20150910/src/mbimcli/mbimcli-basic-connect.c
libmbim-1.13.0+20150910/src/mbimcli/mbimcli-completion
libmbim-1.13.0+20150910/src/mbimcli/mbimcli-dss.c
libmbim-1.13.0+20150910/src/mbimcli/mbimcli-helpers.c
libmbim-1.13.0+20150910/src/mbimcli/mbimcli-helpers.h
libmbim-1.13.0+20150910/src/mbimcli/mbimcli-ms-firmware-id.c
libmbim-1.13.0+20150910/src/mbimcli/mbimcli-ms-host-shutdown.c
libmbim-1.13.0+20150910/src/mbimcli/mbimcli-phonebook.c
libmbim-1.13.0+20150910/src/mbimcli/mbimcli.c
libmbim-1.13.0+20150910/src/mbimcli/mbimcli.h
libmbim-1.13.0+20150910/utils/
libmbim-1.13.0+20150910/utils/Makefile.am
libmbim-1.13.0+20150910/utils/mbim-network.in

2015年8月17日 星期一

在 Ubuntu 14.04 上面使用 git-pbuilder 來編譯 Debian packages 給 sid 使用

在使用

$ DIST=sid ARCH=amd64 git-pbuilder create
之前,可以先編輯 ~/.pbuilderrc 檔案,加上下面的內容。

MIRRORSITE=http://ftp.debian.org/debian
DEBOOTSTRAPOPTS=( '--keyring' '/usr/share/keyrings/debian-archive-keyring.gpg' )

然後安裝 debian-archive-keyring cowbuilder git-buildpackage 這幾個套件。

 $ sudo apt-get install debian-archive-keyring cowbuilder git-buildpackage

然後就可以使用

$ DIST=sid ARCH=amd64 git-pbuilder create
來產生 /var/cache/pbuilder/base-sid-amd64.cow 這個目錄。

之後就可以在有使用 gbp 管理的 Debian package 的 git repository 底下使用

$ gbp buildpackage --git-pbuilder --git-arch=amd64 --git-dist=sid --git-export-dir=../build-dir
來編譯 Debian package 了。

2014年9月13日 星期六

解決 Debian packaging 過程中的 compiler-flags-hidden 警告訊息

compiler-flags-hidden 警告訊息的說明在 https://qa.debian.org/bls/bytag/W-compiler-flags-hidden.html 可以看到。

裡面提到的

可以參考一下,其主要的目的是要盡可能地強化執行檔的安全性。

以 x11-touchscreen-calibrator 0.2-1 為例,將其編譯導向某個檔案儲存,然後再使用 blhc 指令來檢查,就可以看到:

$ blhc --all --color ../log
NONVERBOSE BUILD:   CC       x11_touchscreen_calibrator-x11-touchscreen-calibrator.o
NONVERBOSE BUILD:   CCLD     x11-touchscreen-calibrator

因為 x11-touchscreen-calibrator 上游將 Automake Silent Rules 預設開啟,然後 x11-touchscreen-calibrator 又只使用最簡單的 debian/rules 如下:

#!/usr/bin/make -f                                                                                                                                      
# -*- makefile -*-

%:
        dh  $@

然而 debhelper 到了 9.20140817 預設上還是不會將 --disable-silent-rules 自動加上使用,請見 https://wiki.debian.org/ReleaseGoals/VerboseBuildLogs 的資料。

不過在 Debian Bug report logs - #751207 在有設定 DH_VERBOSE 且 DH_VERBOSE 的值不為空字串的條件下,會自動加上 --disable-silent-rules,所以將 debian/rules 改寫成如下:

#!/usr/bin/make -f                                                                                                                                      
# -*- makefile -*-

export DH_VERBOSE=1

%:
        dh  $@

這樣就可以將 --disable-silent-rules 加上,而且有更詳細的套件包裹編譯過程,不過 blhc 的檢查還是會看到其它的訊息:

$ blhc --all --color ../log
CFLAGS missing (-fPIE): gcc -DHAVE_CONFIG_H -I.   -D_FORTIFY_SOURCE=2  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -c -o x11_touchscreen_calibrator-x11-touchscreen-calibrator.o `test -f 'x11-touchscreen-calibrator.c' || echo './'`x11-touchscreen-calibrator.c
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z -Wl,relro -o x11-touchscreen-calibrator x11_touchscreen_calibrator-x11-touchscreen-calibrator.o  -lX11 -lXi -lXrandr

這時候就可以將 debian/rules 改成如下:

#!/usr/bin/make -f                                                                                                                                      
# -*- makefile -*-

export DH_VERBOSE=1
export DEB_CFLAGS_MAINT_APPEND=-fPIE
export DEB_LDFLAGS_MAINT_APPEND=-fPIE -pie -Wl,-z,now

%:
        dh  $@

這樣就可以將缺少的 CFLAGS 跟 LDFLAGS 參數加入使用。

最後我們可以使用 hardening-check 來檢查一下執行檔。

使用前:

$ hardening-check /usr/bin/x11-touchscreen-calibrator 
/usr/bin/x11-touchscreen-calibrator:
 Position Independent Executable: no, normal executable!
 Stack protected: yes
 Fortify Source functions: yes
 Read-only relocations: yes
 Immediate binding: no, not found!

使用後:

$ hardening-check /usr/bin/x11-touchscreen-calibrator 
/usr/bin/x11-touchscreen-calibrator:
 Position Independent Executable: yes
 Stack protected: yes
 Fortify Source functions: yes
 Read-only relocations: yes
 Immediate binding: yes

這也是 W-compiler-flags-hidden 這個警告訊息想要讓我們做的事情,透過調整編譯時的參數來強化執行檔的安全性。

2014年2月27日 星期四

Debian package 打包時遇到需要使用 Pre-Depends 來解決問題

最近在使用 Python 的 XlsxWriter 來產生 Excel 檔案。

可是在 Ubuntu 上面只有在 Trusty 裡面才有 python-xlsxwriter/python3-xlsxwriter 可以使用。

但是我自己在使用的是 Ubuntu 13.10 (Saucy) 於是我就先自己從 Trusty 上面抓 Debian source package 回來 backport 到 Saucy 上面使用。

本來想說等到程式寫好的差不多再來 backport 到 Ubuntu 12.04 (Precise) 上面給人家使用,結果卻發現事情並非如此單純,因為 xlsxwriter 這個套件還需要使用 dh-python 來編譯,但是在 Precise 上面根本就沒有這個套件,於是這件事就變成要先去 backport dh-python 到 Precise 上面使用。

想說不然就從跟 Precise 比較接近的 Wheezy 來抓 Debian source package 回來 backport 好了,於是就找到了 wheezy-backports 裡面的 dh-python,原本以為只要抓回來改一下 debian/changelog 再推到 PPA 上編譯完成就可以了,沒想到 dh-python 已經編譯好了,再去修改 xlsxwriter 裡面的 debian/control 加上 dh-python 的相依性來編譯就可以了,結果卻又遇到了下面這段錯誤訊息:

running python rtupdate hooks for python3.2...
Usage: py3clean [-V VERSION] [-p PACKAGE | DIR_OR_FILE]

py3clean: error: only one action is allowed at the same time (cleaning directory or a package)
error running python rtupdate hook dh-python
dpkg: error processing python3 (--configure):
 subprocess installed post-installation script returned error exit status 4
dpkg: dependency problems prevent configuration of dh-python:
 dh-python depends on python3 (>= 3.2.3-0); however:
  Package python3 is not configured yet.
dpkg: error processing dh-python (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-all:
 python3-all depends on python3 (= 3.2.3-0ubuntu1.2); however:
  Package python3 is not configured yet.
dpkg: error processing python3-all (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin ...
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
ldconfig deferred processing now taking place
Errors were encountered while processing:
 python3
 dh-python
 python3-all
E: Sub-process /usr/bin/dpkg returned an error code (1)

後來追查了一下才發現,原來 dh-python 在 python3 還沒有安裝好的時候會去執行 py3clean 才導致這個問題的發生,於是查了一下 Debian Policy Manual,發現在 7.2 Binary Dependencies 這一章節提到 Pre-Depends 可以使用來解決我遇到的問題。

於是我就再修改一下 dh-python 將 ${python3:Depends} 移到 Pre-Depends 上面,等 dh-python 推上 PPA 編譯完成後,再來編譯 xlsxwriter 這個額外加上 dh-python 相依性的套件,才順利過關。

xlsxwriter backports 的 PPA 放在 ppa:fourdollars/xlsxwriter

2013年8月26日 星期一

使用 git-buildpackage 維護原本就是使用 Git 維護的上游軟體的 Debian package

首先是將上游軟體的原始碼庫抓回來。

git clone https://github.com/fourdollars/x11-touchscreen-calibrator.git

然後是進到該原始碼目錄底下匯入已經釋出的 tarball

git-import-orig --upstream-vcs-tag=0.0 --upstream-branch=master --pristine-tar ../x11-touchscreen-calibrator_0.0.orig.tar.xz

上面這個指令會建立一個 commit 將 tarball 的內容 import 進去,並且建立一個 upstream/0.0 的 tag,只不過 master 也會指過去,所以再執行以下的指令倒回。

git reset --hard HEAD^

接下來是開始製作 Debian package 的部份,先建立一個 debian 的分支。

git checkout -b debian

然後在將 debian/ 這個目錄所需要的檔案都準備好,最後再 commit,然後就可以使用下面的指令來產生 Debian source package。

git-buildpackage --git-pristine-tar --git-debian-branch=debian -S --lintian-opts --profile debian

上面指令中的 `--lintian-opts --profile debian` 是在 Ubuntu 上面才需要加入的,如果在 Debian 裡面應該不需要使用。

另外,在還沒有完全準備好 debian/ 底下的檔案之前,也可以加入使用 `--git-ignore-new` 先試試看產生出來的 Debian source package 的品質如何,再決定要不要 commit。

等到這個 Debian package 已經成功被放進 Debian 官方套件庫裡面,就可以執行以下指令建立 debian/0.0-1 的 tag。

git-buildpackage --git-tag --git-pristine-tar --git-debian-branch=debian -S --lintian-opts --profile debian

最後就可以執行

git push --tags
將所有的 commit 跟 tag 都送回原本的 Git Repo 裡面。

參考文件:

2007年11月7日 星期三

betaradio v0.1.1 package for Ubuntu 7.10 (Gutsy Gibbon)

雖然是在 Ubuntu 7.10 (Gutsy Gibbon) 上面打包的
http://betaradio.googlecode.com/files/betaradio_0.1.1-1_i386.deb
但是也不曉得在其他平台會不會有什麼問題!? @_@a
這次不是用 checkinstall
改使用比較正統的 Debian Package 方式~
不過因為也只是剛學習 Debian Package
所以不知道會不會打包的過程中有什麼疏忽掉的地方~ ^^a

2007年9月24日 星期一

Beta Radio v0.1.0 的 Ubuntu 安裝包

在 Ubuntu 7.04 上面練習使用 checkinstall 做出來的 Ubuntu 安裝包
Download it

2007年5月14日 星期一

重新打包 deb 加上自己的 patch

首先是要安裝相關的套件
$ sudo aptitude install build-essential dh-make devscripts fakeroot dpatch patch diff patchutils dpkg-dev
這次目標的問題套件是 scim-chewing
$ apt-get source scim-chewing
進入解開的scim-chewing-0.3.1目錄
執行
$ dpatch-edit-patch 50_patch-from-fedora
開始盡情的修改程式要離開時再執行 exit 就可以了
結束後再將 50_patch-from-fedora.dpatch 加到 debian/patches/00list 之中
接下來呢~ 再使用 dch -i 來增加一個 debian 的 changelog
然後再使用 dpkg-buildpackage -rfakeroot 來產生 deb 套件檔
新產生出來的套件分別是
scim-chewing_0.3.1-1ubuntu5.diff.gz
scim-chewing_0.3.1-1ubuntu5.dsc
scim-chewing_0.3.1-1ubuntu5_i386.changes
scim-chewing_0.3.1-1ubuntu5_i386.deb
這樣應該就包好 deb 套件了... 不過 scim-chewing 在 ubuntu 7.04 上會讓 gnome-terminal 突然當掉關閉的問題還是沒有解掉啊~~~ XD

P.S. 我打包出來的套件放在 http://fd.idv.tw/ubuntu/7.04/