1. Overview
Sometimes when we provide software to users, we don't want to provide source code (although this is a dog...), but just want to provide some executable files. The applet can easily extract useful information.
However, for some large programs, especially those that require configuration files and Kernel support, the complexity of each file and program inside the program will occur, it takes a lot of time to figure out the relationship.
In this way, you need a way to extract the executable files and ensure that they can be executed normally. Of course, you can delete all the code in the directory where you compile the source code, it is okay to leave only intermediate products and executable files. But here we will discuss how to achieve the goal by making the Deb software package.
Another advantage of using the Deb package is to facilitate the installation and uninstallation of software, which is not possible for many software installed in the source code.
2. Tools Required
To complete the operation just described, you only need one tool: checkinstall, which is a tool that converts the source code to Deb or RPM packages. The operation is also relatively simple.
The installation package is not the final destination. We sometimes need to modify the installation package appropriately. In this case, we need a powerful package management tool under dpkg and Debian.
Some systems may not provide checkinstall online installation, as follows: http://asic-linux.com.mx /~ Izto/checkinstall /. But I really don't know how to use it. It should be used directly, but it will report an error, and I don't want to go further, so don't despise me.
I directly installed it with APT-Get On Debian.
==== Operation procedure ====
3. Create a package
We can use./configure; Make; make install to compile the software source code normally.
What we need to do is replace make install with checkinstall, and then we will get a deb package...
The entire process will be shown as follows:
After using./configure & make, enter the sudo checkinstall command.
After a short period of initialization, the system will prompt you
The package documentation directory ./doc-pak does not exist. Should I create a default set of package docs? [y]:
Select y
Then you will be given a certain description of the package, ending with a blank line
Please write a description for the package.End your description with an empty line or EOF.>> i am description>>
Then you will be prompted to complete some descriptive input.
This package will be built according to these values:0 - Maintainer: [ [email protected] ]1 - Summary: [ i am the summary ]2 - Name: [ name ]3 - Version: [ 1.0 ]4 - Release: [ 1 ]5 - License: [ GPL ]6 - Group: [ checkinstall ]7 - Architecture: [ amd64 ]8 - Source location: [ nameofthesrc ]9 - Alternate source location: [ ]10 - Requires: [ ]11 - Provides: [ command ]12 - Conflicts: [ ]13 - Replaces: [ ]
Here, requires can specify the required package
For example, I need libxml2-dev, PKG-config support, input
10 # carriage return> libxml2-dev, PKG-config # carriage return
Of course, you can also add a parameter when the checkinstall command is applied.
checkinstall --requires="libxml2-dev,pkg-config"
Here, if you add requirements, when someone else installs your package, if there is no corresponding library or software, the program will check and prompt, otherwise it will not check, install the program directly. The program cannot be used at last, and no one knows why. Unless you can provide a description.
If you don't have the option, press enter to create the Deb package.
Under normal circumstances, this Deb package can be used to install software for others. The installation process requires the use of commands.
sudo dpkg -i name.deb
4. Manage the Deb package through dpkg
Sometimes we may need to deal with this Deb first, because the process of creating a package is completed by replacing the make install process. Maybe some things I don't want to put in the package, I want to delete it. I also want to add something else to it. For example, it is two programs of different systems. You want your system to own them at the same time, but do not want to go through multiple steps.
The dpkg command is required to implement this process. Some basic functions of dpkg are as follows:
Dpkg-I name. deb # install the software package dpkg-I name. deb # obtain the Deb package information from the package dpkg-I name # Remove the installed package. You can view the package information to obtain the dpkg-c Name. deb # view the content in the package, it looks like the compressed package dpkg-s name # view the installed package information dpkg-r name # delete an installed package dpkg-P name # delete an installed package, including configuration files
In fact, it is to re-assemble the Directory, which is probably the meaning.
In fact, dpkg has been powerful to the point where it can be reused. For more details, see here.
Http://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.zh-cn.html
Http://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html
Some other features of dpkg are described here, including unpackaging and repackaging.
Dpkg-x name. deb name # obtain the dpkg-e name in the package. deb name/Debian # obtain the control information dpkg-B name in the package. deb # create a deb package
Use checkinstall to create a Deb or RPM Toolkit