/********************************************************************* * Author : Samson * Date : 07/04/2014 * Test platform: * 3.11.0-12-generic #19-Ubuntu * GNU bash, version 4.2.45 * *******************************************************************/
The command for building the Deb package is:
Dpkg-buildpackage
This will automatically complete all the work of building a binary package from the source code package, including the following steps:
0. Clear the source code tree (Debian/rules clean)
1. Build the source code package (dpkg-source-B)
2. Build a program (Debian/rules build)
3. Build a Binary Package (fakeroot Debian/rules binary)
4. Use GPG to sign the. DSC File
5. Use dpkg-genchanges and GPG to create and sign the. Changes file for upload
0 ~ 3. All these four steps are actually called DH commands,
The first step is to execute DH clean. If you want to modify the default clean item, you can use the following statement to write it to the Rules file to rewrite the Clean Action content:
Override_dh_auto_clean:
Rm-RF build-Deb build-udeb
Step 3 is actually executing DH build. Of course, like clean in step 1, override_dh_auto_configure, override_dh_auto_build, and other actions similar to those in step 1 can also be rewritten;
For example:
Override_dh_auto_configure:
Dh_auto_configure-bbuild-Deb -- $ (confflags)
Dh_auto_configure-bbuild-udeb -- $ (confflags_udeb)
Override_dh_auto_build:
# Debian's/var/log/btmp has inappropriate permissions.
Perl-pi-E's,. * # define use_btmp. *,/* # UNDEF use_btmp */, 'Build-DEB/config. h
Perl-pi-E's,. * # define use_btmp. *,/* # UNDEF use_btmp */, 'Build-udeb/config. h
Step 4: Execute DH binary. In this step, various DH _ * commands are used, including the following commands:
Dh_testroot
Dh_prep
Dh_installdirs
Dh_install
Dh_installdocs
Dh_installchangelogs
Dh_installexamples
Dh_installman
Dh_installcatalogs
Dh_installcron
Dh_installdebconf
Dh_installemacsen
Dh_installifupdown
Dh_installinfo
Dh_pysupport
Dh_installinit
Dh_installmenu
Dh_installmime
Dh_installmodules
Dh_installlogcheck
Dh_installlogrotate
Dh_installpam
Dh_installppp
Dh_installudev
Dh_installwm
Dh_installxfonts
Dh_installgsettings
Dh_bugfiles
Dh_ucf
Dh_lintian
Dh_gconf
Dh_icons
Dh_perl
Dh_usrlocal
Dh_link
Dh_compress
Dh_fixperms
Dh_installdeb
Dh_md5sums
Dh_gencontrol
Dh_builddeb
The preceding commands can all use override_dh_auto _ $ (strstr ("DH _*","*")):
Action ..............................
The above * is the name corresponding to DH;
Of course, powerful installation commands will also be used:
Install
The above dh_install * command is to install Dongdong under the same path name of the directory path in the system corresponding to/Debian/Deb package name/to the corresponding directory of the system, for example, if a package named openssh-client exists in the Debian directory: debian/openssh-Client/usr/share/man/PL/man */, dh_installman is the/usr/share/man in the directory of Debian/openssh-Client/usr/share/man/ PL/man */directory, for the installation path of other commands, see the Command help information;
Refer:
Http://www.debian.org/doc/manuals/maint-guide/build.zh-cn.html