wiki:jazz/Hadoop_deb

Hadoop 0.18.3 Debian Package 打包過程

  • [參考] wordpress-mu 打包全紀錄
    ~$ sudo apt-get install gcc g++ g77 make patch pkg-config dpkg-dev debhelper devscripts dh-make fakeroot lintian
    ~$ export DEBFULLNAME="Jazz Yao-Tsung Wang"
    ~$ export DEBEMAIL="jazz@xxxx.xxx.xx"
    ~$ wget http://ftp.twaren.net/Unix/Web/apache/hadoop/core/hadoop-0.18.3/hadoop-0.18.3.tar.gz
    ~$ tar zxvf hadoop-0.18.3.tar.gz
    ~$ cd hadoop-0.18.3
    ~/hadoop-0.18.3$ dh_make --createorig
    
    Type of package: single binary, multiple binary, library, kernel module or cdbs?
     [s/m/l/k/b] s
    
    Maintainer name : Jazz Yao-Tsung Wang
    Email-Address   : jazz@xxxx.xxx.xx
    Date            : Thu, 19 Mar 2009 16:45:01 +0800
    Package Name    : hadoop
    Version         : 0.18.3
    License         : blank
    Type of Package : Single
    Hit <enter> to confirm:
    Currently there is no top level Makefile. This may require additional tuning.
    Done. Please edit the files in the debian/ subdirectory now. You should also
    check that the hadoop Makefiles install into $DESTDIR and not in / .
    
  • 參考 /var/lib/dpkg/info/openssh-server.postinst
    • 加帳號的參考寫法
      setup_sshd_user() {
              if ! getent passwd sshd >/dev/null; then
                      adduser --quiet --system --no-create-home --home /var/run/sshd --shell /usr/sbin/nologin sshd
              fi
      }
      
      • getent - get entries from administrative database
        jazz@ubuntu:~$ getent passwd jazz
        jazz:x:1000:1000:Jazz Yao-Tsung Wang,,,:/home/jazz:/bin/bash
        jazz@ubuntu:~$ getent passwd hadoop
        
    • 設定預設 run-level 還有啟動服務的寫法
      setup_init() {
              if [ -x /etc/init.d/ssh ]; then
                      update-rc.d ssh start 16 2 3 4 5 . stop 84 1 . >/dev/null
                      if [ -x /usr/sbin/invoke-rc.d ]; then
                              invoke-rc.d ssh restart
                      else
                              /etc/init.d/ssh restart
                      fi
              fi
      }
      
  • [參考] 如何編譯及打包 deb 套件
    dpkg-buildpackage -rfakeroot -k0x570712BF
    # 若有 gpg key 時加 -k[keyid] 最後就會做 sign 的動作
    
  • [結果] 完整打包原始檔請參考 SVN 的 hadoop-0.18.3 檔案內容
    # svn co https://trac.nchc.org.tw/svn/cloud/hadoop-0.18.3
    # cd hadoop-0.18.3
    hadoop-0.18.3# make source; make deb
    
Last modified 15 years ago Last modified on Jul 17, 2009, 4:26:29 PM