Apt HOWTO-Chapter 6 Source Package

xiaoxiao2021-03-06  78

Apt HowTo

Chapter 6 Source Package

6.1 Download Source Pack

==============

In the world of free software, you often need to learn the source or deactivate the program, so you need to download them. The APT provides a simple way to help you get the source code for many programs in the release, and all files you need to create .deBS.

Another universal purpose of the Debian source code is to rewrite the new version of the unsteable release to use, for example, introducing a new package from the Stable release version, need to be regenerated. DEBS will be in the original release Association relationship migrates to a new release.

Complete these work, the / etc / apt / sources.list file should be a mirror source to be unsteable, don't forget to remove the annotation of the head. See the 2.1 / etc / APT / SOURFES.LIST file for details.

Download the source package with the following command:

Apt-Get Source PackageName

Three files are usually downloaded: a .orig.tar.gz, a .dsc and a .diff.gz. For DEBIAN-specific packages, the last file will not download, there is no "orig" item in the file name of the first file.

DPKG-SOURCE reads the .dsc file information, unpack the source package to the package-version directory, there is a debian / directory in the Source package downloaded, which is the file required to create a .deb package.

The source package you want to download is automatically compiled into a package, just add -b in the command line, as follows:

Apt-get -b source packagename

If you are not intended to create a .deb package now, you can run the following command, then create it.

DPKG-buildpackage -rfakeroot -UC -B

Run the above command in the directory where the download package is downloaded.

The Source command of the apt-get is different from its other commands. The normal user privileges can run the source command, and the specified file is downloaded to the user to call the apt-source package command.

6.2 Compile the package required by the source code package

==========================

Typically, when compiling the source package, you should use some header files and shared libraries. There is a domain "build-depends:" in all source package management files (Control File), which points to compile the source code package. Additional package.

APT provides a simple way to download these additional packages, you only need to run the APT-Get Build-Dep Package, where package is the source package name you intend to compile. See here:

[root] @ [/] # APT-Get Build-Dep GMC

Reading package lists ... DONE

Building Dependency Tree ... DONE

The Following New Packages Will Be Installed:

COMERR-DEV E2FSLIBS-DEV GDK-IMLIB-DEV IMLIB-PROGS LIBGNOME-DEV LIBGNORBA-DEV

Libgpmg1-dev

0 Packages Upgraded, 7 Newly Installed, 0 to remove and 1 not upgraded.

NEED TO GET 1069KB of Archives. After unpacking 3514kb Will be used.do you want to continue? [Y / n]

These additional packages for GMC to correctly compile specifying the source package will be installed. Note that this command cannot be used to search for a source of software, you have to run an additional APT-GET SOURCE download source package.

转载请注明原文地址:https://www.9cbs.com/read-70964.html

New Post(0)