星期四, 6月 11, 2009

how to build a debian package (.deb)

need some packages first
dh-make
build-essential
devscripts
pbuilder
cdbs

00 change the changelog and control file to be your own files, it will be authorize through internet.
1. create a test folder
2. in test folder create a project-version folder (like abc-1.1)
3. in abc-1.1 folder, exec "dh_make native" and select "s" option
4. then we have "debian" folder there, inside has example files
** replace some files **
5. in abc-1.1 folder, create etc/pm/config.d/unload file
6. in debian folder, create a file named "install"
7. add "etc/pm/config.d/unload /etc/pm/config.d" in replace file.
*** script file ***
8. add your script into postinst file (you can remove all *.ex file, only left one for modifying.)
9. script better includes #!/bin/bash
10. back to abc-1.1 folder, and run "debuild -i -I -sa" or try this "debuild -us -uc -b"

list some example files.
changelog:
minix-config (1.1) jaunty; urgency=low

* update for ppa

-- Juergen Chiu Thu, 11 Jun 2009 10:38:49 +0000

postinst:
#!/bin/sh
set -e
#Sound

amixer sset "Input Source" "Front Mic"
amixer -q set "Front Mic" 0% unmute
amixer -q set "Front Mic Boost" 10% unmute
amixer -q set "Capture" 100% unmute

#DEBHELPER#
rules:
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk

binary-install/minix-config::
install -d $(CURDIR)/debian/minix-config/etc/pm/config.d/
install -m 644 $(CURDIR)/etc/pm/config.d/10minix_module $(CURDIR)/debian/minix-config/etc/pm/config.d/

binary-fixup/minix-config::
dh_gconf --priority=16

沒有留言: