The Debian software package is created by the dpkg software package management tool. Dpkg follows a series of commands specified by a separate text file. In Debian-based systems, if you use the following command:
Apt-Get source MSN-pecan
From the downloaded MSN-pecan directory, we can see that there is a Debian Directory, which mainly contains two important files: the control file and the packaging rule file rules. The control file mainly includes:
Depends: Specifies the software package that must be installed first, because the current software package depends on this package. For example, the GTK application must depend on GTK +-2.0 to avoid serious system damage.
Suggests:
Software packages that can be thought of as optional
Conflicts: indicates that if you install the current package, it must not be the same as this specific package. For example, installing the pidgin software conflicts with the Gaim software.
Provides: Debian
Sometimes virtual software packages or non-existing software packages are defined. It provides a friendly way to point to a specific type of software, and many available software may belong to this type. This helps users find
Some software packages or a well-known software package are moved to the latest Debian version, without the need for users to understand the policies behind this.
The process of creating a separate Debian software package is very simple and easy to understand. Thanks to Debian's automated help script. In this example, given an existing source code project, we can
Create a new software package by using dh_make in the command line. For example, we copy the msn-pecan-0.18.tar.bz2 downloaded from Google Souce to a new directory.
Bunzip2-D msn-pecan-0.18.tar.bz2
Tar-xvvf msn-pecan-0.18.tar
And the msn-pecan-0.18 as a whole
The basis of the new Debian software package. Go to msn-pecan-0.18 directory
# Dh_make-e dalashan@gmail.com-f ../msn-pecan-0.18.tar.gz
In this case, the system will ask you which type of software package you want to create:
Type of package: single binary, multiple binary, library, kernel module or CDBs?
[S/L/m/k/B]
Generally, in most cases, we create a separate Binary Package, so select the option "S" (other types are more complex. For details, see the related documentation of dh_make ).
Maintainer name: Root
Email-Address: dalashan@gmail.com
Date: Mon, 20 Apr 2009 16:29:11 + 0800
Package name: MSN-pecan
Version: 0.18
License: blank
Type of package: single
Hit to confirm:
Done. Please edit the files in the Debian/subdirectory now. You shoshould also
Check that the MSN-pecan makefiles install into $ destdir and not in /.
In this case, you will find a Debian directory in the source code directory.
# Cd Debian
# Ls
Changelog dirs init. d. Ex menu. Ex preinst. Ex
Compat docs init. d. LSB. Ex msn-pecan-default.ex prerm. Ex
Control emacsen-install.ex manpage.1.ex msn-pecan.doc-base.EX readme. Debian
Copyright emacsen-remove.ex manpage. SGML. Ex postinst. Ex rules
Cron. d. Ex emacsen-startup.ex manpage. xml. Ex postrm. Ex watch. Ex
You will find that many files are generated by dh_make. You can modify the control file and rules file as needed. I usually delete all the *. ex files. We recommend that you modify the changelog file every time you modify the source code. The modification format must be as follows:
MSN-pecan (0.0.18-0 ~ Hardy1) Hard-backports; urgency = low
* Dalashan cross compile.
-- Dalashan Mon, 20 Apr 2009 15:53:06 + 0800
(Note: You can use date-R in the command line to obtain the date string)
Now, you can use dh_make as follows:
# Dpkg-buildpackage-rfakeroot-B (only Binary Package is generated)-Tc (clean after packaging)
Finally, you can use dpkg-c x. Deb to view the files contained in the generated software package. Use sudo dpkg-I *. Deb to install the software.