Contents
Here I use dh_make. But for simple packages it is best to use equivs !
Description
You will have to create and install a Debian package with the minimal number of files.
Details
step 1 : preparation
- 1 - create a directory for the package : package-minimal-1.1.1
2 - control that the package is not installed with Aptitude
step 2 : create the source package
3 - create the source package with ?dh_make
step 3 : build the deb file
- 4 - remove all the files which can be removed from the source package
5 - build the package with ?dpkg-buildpackage
- 6 - if you can't build the package or if there are too many files (more than 3) restart from 1 - create a directory for the package : package-minimal-1.1.2
step 4 : testing
7 - install the package with dpkg
- 8 - control that the package was correctly installed
- 9 - find where are the files that were created after the installation of the package.
10 - remove the package with aptitude
- 11 - control that the package was removed
- 12 - remove the files created in package-minimal
Solution
step 1 : preparation
- 1 - create a directory for the package : package-minimal-1.1.1
# mkdir -p package-minimal/package-minimal-1.1.1
# cd package-minimal/package-minimal-1.1.1/
2 - control that the package is not installed with Aptitude
# aptitude show package-minimal
E: Unable to locate package package-minimal
step 2 : create the source package
3 - create the source package with ?dh_make
$package-minimal/package-minimal-1.1.1# dh_make -s -n
step 3 : build the deb file
- 4 - remove some files from the source package
$package-minimal/package-minimal-1.1.1# cd debian/
$package-minimal/package-minimal-1.1.1/debian# rm -fr *.ex *.EX docs source RE* compat copyright
$package-minimal/package-minimal-1.1.1/debian# ls
changelog control rules
$package-minimal/package-minimal-1.1.1/debian# cd ..
5 - build the package with ?dpkg-buildpackage
$package-minimal/package-minimal-1.1.1# dpkg-buildpackage -rfakeroot
- 6 - if you can't build the package or if there are too many files (more than 3) restart from 1 - create a directory for the package : package-minimal-1.1.2
- All the files have been removed in the first go : it is the solution !
step 4 : testing
7 - install the package with dpkg
$package-minimal/package-minimal-1.1.1# cd ..
$package-minimal# dpkg -i p*.deb
- 8 - control that the package was correctly installed
# aptitude show package-minimal
Package: package-minimal
New: yes
State: installed
Automatically installed: no
Version: 1.1.1
- 9 - find where are the files that were created after the installation of the package.
# cd /
$/# find -name "package-minimal*"
./usr/share/doc/package-minimal
./var/lib/dpkg/info/package-minimal.md5sums
./var/lib/dpkg/info/package-minimal.list
10 - remove the package with aptitude
# aptitude remove package-minimal
- 11 - control that the package was removed
# aptitude show package-minimal
E: Unable to locate package package-minimal
- 12 - remove the files created in package-minimal
$package-minimal# # rm p*
rm: cannot remove `package-minimal-1.0': Is a directory
rm: cannot remove `package-minimal-1.1.1': Is a directory