[ 上一頁 ] [ 目錄 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ A ] [ 下一頁 ]


Debian新維護人員手冊
附錄 A - 例子


現在我們來給上游軟體gentoo-1.0.2.tar.gz打包裝檔,並且上傳所有的 套裝軟體到nm_target.


A.1 簡單打包裝檔例子

      $ mkdir -p /path/to # new empty directory
      $ cd /path/to
      $ tar -xvzf /path/from/gentoo-1.0.2.tar.gz # get source
      $ cd gentoo-1.0.2
      $ dh_make -e name@domain.dom -f /path/from/gentoo-1.0.2.tar.gz
      ... Answer prompts.
      ... Fix source tree
      ... If it is a script package, set debian/control to "Architecture: all"
      ... Do not erase ../gentoo_1.0.2.orig.tar.gz
      $ debuild
      ... Make sure no warning happens.
      $ cd ..
      $ dupload -t nm_target gentoo_1.0.2-1_i386.changes

A.2 用dpatchpbuilder打包裝檔

      $ mkdir -p /path/to # new empty directory
      $ cd /path/to
      $ tar -xvzf /path/from/gentoo-1.0.2.tar.gz
      $ cp -a  gentoo-1.0.2 gentoo-1.0.2-orig
      $ cd gentoo-1.0.2
      $ dh_make -e name@domain.dom -f /path/from/gentoo-1.0.2.tar.gz
      ... Answer prompts.
      ... Fix source tree by editor
      ... Try building packages message "dpkg-buildpackage -rfakeroot -us -uc"
      ... Edit source to make source buildable.
      ... Do not erase ../gentoo_1.0.2.orig.tar.gz
      $ cd ..
      $ cp -a gentoo-1.0.2 gentoo-1.0.2-keep # safety backup
      $ mv gentoo-1.0.2/debian debian
      $ diff -Nru  gentoo-1.0.2-orig gentoo-1.0.2 > patch-file
      ... You may overwrite gentoo-1.0.2 directory while doing this.
      ... Make sure to keep gentoo-1.0.2-keep for your safety
      $ mkdir -p debian/patches
      $ dpatch patch-template patch-file \
         -p "01_patchname" "patch-file description" \
         < patch-file > debian/patches/01_patchname.dpatch
      $ cd debian/patches
      $ echo 01_patchname.dpatch >00list
      $ cd ../.. # back to /path/to
      $ rm -rf gentoo-1.0.2
      $ editor debian/rules

現在檔案debian/rules的內容是:

      config.status: configure
           ./configure --prefix=/usr --mandir=/usr/share
      build: config.status
           ${MAKE}
      clean:
           $(testdir)
           $(testroot)
           ${MAKE} distclean
           rm -rf debian/imaginary-package debian/files debian/substvars

你可以用編輯器修改debian/rules檔案為以下內容使其使用dpatch:

      config.status: patch configure
           ./configure --prefix=/usr --mandir=/usr/share
      build: config.status
           ${MAKE}
      clean: clean-patched unpatch
      clean-patched:
           $(testdir)
           $(testroot)
           ${MAKE} distclean
           rm -rf debian/imaginary-package debian/files debian/substvars
      patch: patch-stamp
      patch-stamp:
           dpatch apply-all
           dpatch call-all -a=pkg-info >patch-stamp
      
      unpatch:
           dpatch deapply-all
           rm -rf patch-stamp debian/patched

現在你可以用dpatch系統重新打包裝檔了。

      $ tar -xvzf gentoo_1.0.2.orig.tar.gz
      $ cp -a debian/ gentoo-1.0.2/debian
      $ cd gentoo-1.0.2
      $ sudo pbuilder update
      $ pdebuild
      $ cd /var/cache/pbuilder/result/
      $ dupload -t nm_target gentoo_1.0.2-1_i386.changes

[ 上一頁 ] [ 目錄 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ A ] [ 下一頁 ]


Debian新維護人員手冊

version 1.2.3, 2005年4月3日.

Josip Rodin joy-mg@debian.org
華文版翻譯:李凌 lilingv@gmail.com
華文版翻譯:鄭原真 ycheng@slat.org