Debian package advanced

νŒ¨ν‚€μ§€μ˜ λͺ©μ , ꡬ성 μ–Έμ–΄ 등이 λ‹€μ–‘ν•˜κΈ° λ•Œλ¬Έμ— νŒ¨ν‚€μ§€λ₯Ό λ§Œλ“œλŠ” 방식도 λ‹€μ–‘ν•©λ‹ˆλ‹€. λͺ¨λ“  방법을 μ•Œ μˆ˜λŠ” μ—†μ§€λ§Œ debhelper(dh)와 debian/rules의 역할을 톡해 흐름을 μ•Œ 수 μžˆμŠ΅λ‹ˆλ‹€.

debhelper

debhelperλŠ” dh dh_<command> λͺ…λ Ήμ–΄λ‘œ λ°λΉ„μ•ˆ νŒ¨ν‚€μ§€λ₯Ό λ§Œλ“€μ–΄μ£ΌλŠ” νˆ΄μž…λ‹ˆλ‹€.

dh λͺ…령어에 μ˜ν•΄ dh_<command> λͺ…λ Ήμ–΄κ°€ 정해진 μˆœμ„œλ‘œ μ‹€ν–‰λ©λ‹ˆλ‹€.

dh <sequence> [options]
  • <sequence>
    • clean
    • build, build-arch, build-indep
    • binary, binary-arch, binary-indep
    • patch(optional)

νŒ¨ν‚€μ§€λ₯Ό λ§Œλ“€ λ•Œ 일반적으둜 μ•„λž˜μ™€ 같은 순으둜 μ§„ν–‰λ©λ‹ˆλ‹€.

cd <package>
sudo dh clean
sudo dh build
sudo dh binary

dh_<command>

dh_<command>λŠ” dhλͺ…령에 μ˜ν•΄ ν˜ΈμΆœλ©λ‹ˆλ‹€. dhλͺ…령어에 μ˜ν•΄ ν˜ΈμΆœλ˜λŠ” λͺ…λ Ήμ–΄μ˜ μˆœμ„œλ₯Ό ν™•μΈν•˜κΈ° μœ„ν•΄ μ•„λž˜ λͺ…λ Ήμ–΄λ₯Ό μ‚¬μš©ν•˜λ©΄ λ©λ‹ˆλ‹€.

dh <command> --no-act
dh clean
dh_testdir
dh_auto_clean
make distclean
dh_clean
dh build
dh_testdir
dh_update_autotools_config
dh_auto_configure
dh_auto_build
make
dh_auto_test
dh binary
dh_testroot
dh_prep
dh_installdirs
dh_auto_install
make install DESTDIR=/<path>/debian/<package>
dh_install
dh_installdocs
dh_installchangelogs
dh_installexamples
dh_installman
dh_installcatalogs
dh_installcron
dh_installdebconf
dh_installemacsen
dh_installifupdown
dh_installinfo
dh_installinit
dh_installmenu
dh_installmime
dh_installmodules
dh_installlogcheck
dh_installlogrotate
dh_installpam
dh_installppp
dh_installudev
dh_installgsettings
dh_bugfiles
dh_ucf
dh_lintian
dh_gconf
dh_icons
dh_perl
dh_usrlocal
dh_link
dh_installwm
dh_installxfonts
dh_strip_nondeterminism
dh_compress
dh_fixperms
dh_missing
dh_strip
dh_makeshlibs
dh_shlibdeps
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb

debian/rules

λͺ…λ Ήμ–΄ 싀행을 μˆ˜μ •ν•˜κ³  싢은 경우 override_dh_<command>λ₯Ό νƒ€κ²ŸμœΌλ‘œ μ„€μ •ν•˜λ©΄ λ©λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄ dh_auto_clean을 μƒλž΅ν•˜κ³  싢은 경우 μ•„λž˜μ™€ 같이 μž‘μ„±ν•˜λ©΄ λ©λ‹ˆλ‹€.

#!/usr/bin/make -f
%:
dh $@
override_dh_auto_clean:

dpkg

  • dpkg -c <deb file>: contents
  • dpkg -I <deb file>: info
  • sudo dpkg -i <deb file>: install
  • sudo dpkg -P <package>: purge
Last updated on