User Tools

Site Tools


helpdocs:builddebs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
helpdocs:builddebs [2017/01/14 01:20] localadminhelpdocs:builddebs [2017/01/14 01:24] (current) – [For Modifying a deb file] localadmin
Line 40: Line 40:
   * source: http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html   * source: http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html
  
 +===== For Modifying a deb file =====
 +
 +If you have a deb file and want to modify something in it so it is more compatible with the CS repo, we will need to extract the required files and modify them.
 +First we extract the elements in the deb file and we place them in a temporary location.
 +<code>#dpkg-deb -x name-of-package.deb tmpdir</code>
 +
 +Then we are going to pull the control file that is located in the tmp/DEBIAN/ folder. This is where you will make your changes.
 +<code>#dpkg-deb --control name-of-package.deb</code>
 +
 +
 +Now to edit the file
 +<code># gedit tmpdir/DEBIAN/control</code>
 +
 +Once all changes are done, repackage the deb file.
 +<code>#dpkg -b tmpdir new-name-of-package.deb</code>
 +
 +source: http://forums.linuxmint.com/viewtopic.php?f=46&t=35136 (Modify a .deb file)
 +
 +===== Simple deb file =====
 +
 +In the case you require to make a simple deb file there is also a very simple way to do it.
 +Decide on the name of your package. Standard debian notation is all lowercase in the following format:
 +<project>_<major version>.<minor version>-<package revision>
 +For example, you could name your first package: "helloworld_1.0-1"
 +Create a directory to make your package in. The name should be the same as the package name.
 +#mkdir helloworld_1.0-1
 +
 +Pretend that the packaging directory is actually the root of the file system. Put the files of your program where they would be installed to on a system.
 +#mkdir helloworld_1.0-1/usr
 +#mkdir helloworld_1.0-1/usr/local
 +#mkdir helloworld_1.0-1/usr/local/bin
 +#cp "~/Projects/Hello World/helloworld" helloworld_1.0-1/usr/local/bin
 +
 +Now create a special metadata file with which the package manager will install your program...
 +#mkdir helloworld_1.0-1/DEBIAN
 +#gedit helloworld_1.0-1/DEBIAN/control
 +
 +Create a control file.
 +<code>
 +Package: helloworld
 +Version: 1.0-1
 +Section: base
 +Priority: optional
 +Architecture: i386
 +Depends: libsomethingorrather (>= 1.2.13), anotherDependency (>= 1.2.6)
 +Maintainer: Your Name <you@email.com>
 +Description: Hello World
 + When you need some sunshine, just run this
 + small program! 
 + (the space before each line in the description is important)
 +</code>
 +
 +Now you just need to make the package:
 +Code:
 +<code>#dpkg-deb --build helloworld_1.0-1</code>
 +
 +source: http://ubuntuforums.org/showthread.php?t=910717
 +
 +Have fun making deb files :)
  
helpdocs/builddebs.1484378450.txt.gz · Last modified: 2017/01/14 01:20 by localadmin