A simple method to create a deb package from the source code

Source: Internet
Author: User
A simple method to create a deb package from the source code-Debian information of the Linux release-the following is a detailed description. The process for creating a. deb package is as follows:

Take the leafpad-0.7.9.tar.gz package as an example.

1. Create a good working environment and create the leafpad directory
# Mkdir leafpad
# Mv leafpad-0.7.9.tar.gz leafpad/
# Tar zxvf leafpad-0.7.9.tar.gz
# Cd leafpad-0.7.9

2. Install the packaging environment:
# Apt-get install g ++ patch make libc6-dev libgtk2.0-dev (gnupg lintian pbuilder should not be required)
# Apt-get install dh-make dpkg-dev debhelper fakeroot build-essential

3. Debian Initialization
# Dh_make-e winter0324@163.com-f ../leafpad-0.7.9.tar.gz # winter0324@163.com for the author

1) I will ask you some questions, and set the content in the Debian directory as needed. Refer to article 4.

After running this command, the original software package will be packaged as leafpad_0.7.9.orig.tar.gz and placed in the parent directory.

4. Modify Makefile, control, and other files (not required ).
Debian requires that the executable file cannot be installed in the/usr/local directory. Therefore, check the corresponding installation location of the Makefile file, my small software was originally installed under/usr/bin, so you do not need to modify the Makefile file.

For control copyright and other files, if you just create a deb package file for your own use, you can do it without modifying it. However, if you are preparing to upload the file for Debian to the Debian apt source, it must be carefully entered in accordance with the specifications.

5. Generate the deb package file:
$ Dpkg-buildpackage-rfakeroot or $ fakeroot debian/rules binary

After completing the above steps, A. deb package will be created in the upper-level directory of leafpad.

Ii. You can directly use checkinstall-D (execute make first) to generate the. deb package without using the above method (it is not clear what the difference is)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.