Linux from scratch¶
A debian package contains 3 files;
#ar tv cdmserver.deb rw-r--r-- 0/0 4 Feb 5 17:29 2010 debian-binary rw-r--r-- 0/0 1741 Feb 5 17:29 2010 control.tar.gz rw-r--r-- 0/0 39005565 Feb 5 17:29 2010 data.tar.gz
The debian-binary file contains some info about the package and for the apt-get install commad.
The control file contains control info about the package such as version, dependencies, md5 cheks and the post/pre installl/uninstall scripts
The data package contains all the files generated by the sources such as binary files, also contains the documentation (man pages), etc...
0.First of all install some utils which will help with the package creation
apt-get install devscripts build-essential dpkg-dev dh-make debhelper fakeroot
1.Create the following environment variables
DEBNAME=Name DEBEMAILfirstname.lastname@example.org DEBFULLNAME=Name Surname
which are used in order to have an appropiate contact and responsible person for the package.
2.Create the directory packageName-0.0.1 and put inside your sources with the Makefile (if any).
3.Go inside the directory and execute
and select the package type s. This will create the debian directory which will contains all the configuration files in order to build a .deb
This will generate the tar.gz with the sources and the debian directory with all the necesary in order to make the package
4.Go to the debian directory and edit the Copyright file with the license of your code, the control file with the dependencies and other info of your package.
5.post|pre int|rm are scripts which are executed after the installation, before the installation and when remove of the package. Edit them in oder to move some files, activate a daemon, etc...
- Execute the following command to generate the .deb
The debian directory contains another directory, usually with the same name as the application. This directory is the target for the $(DESTDIR) of the source's Makefile and also for the post and pre install/uninstall scripts. The content of this directory is used to create the data.tar.gz and control.tar.gz
In the following directories is the currently version of the cdmserver.deb configuration files
220.127.116.11/home/frevilla/debian# 18.104.22.168/home/frevilla/safe# 22.214.171.124/home/frevilla/safe#
-debian contains all the configuration files in order to create a new package, if you want to create a new version just actualize the cdmserver-standalone.jar file at /var/www/downloads/cdmserver/stable/go to debian/cdmserver_version/ and run the script donewpackage.sh. The new version will be /debian/cdmserver_version.deb .
-safe constains the files to substitute when the debian package package is made from step 0
It is possible to create the debian package with maven, in this case only the debian file will be created and no changelog, or source.tar.gz will be created. Just execute
cdmlib-remote# maven install
from the cdmlib-remote directory and the new directory cdmlib-remote/dist will be created with the new version of the debian package.