Working With Source Packages: Enable Deb-Src Entry in Your /etc/apt/sources - List (Uncommented)
Working With Source Packages: Enable Deb-Src Entry in Your /etc/apt/sources - List (Uncommented)
2. To download a source package, you would use the following command: $ apt-get source packagename eg: - apt-get source vsftpd This will download three files: .orig.tar.gz .dsc .diff.gz In the case of packages made specifically for Debian, the last of these is not downloaded and the first usually won't have "orig" in the name.
3. To create the .deb file $ dpkg-buildpackage -rfakeroot -uc -b or (# dpkg-buildpackage -uc -b) Note : run this command from same directory which contains source dpkg-buildpackage - build binary or source packages from sources -uc -b Do not sign the .changes file. Specifies a binary-only build, no source files are to be built and/or distributed.
-rgain-root-command When dpkg-buildpackage needs to execute part of the build process as root, it prefixes the command it executes with gain-root-command if one has been specified. Otherwise, if none has been specified, fakeroot will be used by default, if the command is present. su is not suitable, since it can only invoke the user's shell. fakeroot runs a command in an environment wherein it appears to have root privileges for file manipulation. This is useful for allowing users to create archives (tar, ar, .deb etc.) with files in them with root permissions/ownership. Without fakeroot one would need to have root privileges to create the constituent files of the archives with the correct permissions and ownership, and then pack them up, or one would have to construct the archives directly, without using the archiver.
4. To auto-build the package when it's been downloaded, just add -b to the command line, like this: $ apt-get -b source packagename eg:- apt-get -b vsftpd note:- this will autobuild package from source and will get a .deb file. But all dependencies for that package must be installed prior.
5.To install the package built by the commands above $ dpkg -i vsftpd_2.3.2-3ubuntu5_amd64.deb