问题
I have checked on debian site for creating a package.
But, it is not easy to understand as it does not give a step wise processes.
Please help me how to create a Debian package.
If possible a detailed steps would be very fine.
回答1:
The goal is to create a package that simply puts a shell script where I want it.
1.Create a directory to build your packages in. Some use "deb" and others use "packages". Others create a directory structure for making multiple packages under "deb" (or whatever).
mkdir deb
2.Create the directory structure in deb that represents where you want the script to be placed1
mkdir -p ./deb/usr/local/bin
3.Copy the script into your new directory
cp /path/to/my/script/myscript.sh ./deb/usr/local/bin/
4.Make a subdirectory called "DEBIAN", this will host the package control file.
mkdir -p ./deb/DEBIAN
5.Create a control file.
touch ./deb/DEBIAN/control
6.Open the control file and enter the text below.
Package: myPackagename (no spaces or underscores allowed)
Priority: optional
Section: misc
Maintainer: Maintainer Name
Architecture: all
Version: 1.0
Depends: package1, package2, .........
Description: short description here long description here (don't remove space at the beginning of line) (replace this with an empty line)
7.Change ownership
Change ownership: sudo chown -R root:root ./deb
8.Create the debian package.
dpkg -b ./deb /my/output/destination/packagename.deb
回答2:
Here is the link i got for creating a debian package.
Hope this will help you all guys...
http://ubuntuforums.org/showthread.php?t=51003
Regards, iSight
回答3:
If you have the source code or source code in tar.gz, you can use the following:
sudo apt-get install checkinstall
In the source code, compile it:
./configure
make
And then build the debian package with checkinstall, for example:
sudo checkinstall --install=no --pkgname=XXX --pkgversion=0.X.X --maintainer=YOU_XXX
The debian package is in the same directory :)
来源:https://stackoverflow.com/questions/4623684/creating-debian-package