Skip to main content

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