## page was renamed from HenriLeFoll/Tricks/Packaging/Minimal/Size ## page was renamed from Packaging/Minimal/Size <> Here I use dh_make. But for simple packages it is best to use equivs ! = Description = You will have to create the smallest Debian package possible. = Details = == step 1 : preparation == * 1 - create a directory debian in the directory : package-minimal-1.2.1 * 2 - copy changelog, control, rules from package-minimal-1.1 == step 2 : build the deb file == * 3 - remove and modify each file so they contain the minimum of data * 4 - build the package with [[dpkg-buildpackage]] * 5 - if you can't build the package or if there are too many files (more than 3) restart from 1 - create a directory debian in the directory : package-minimal-1.2.2 == step 4 : testing == * 6 - install the package with [[dpkg]] * 7 - control that the package was correctly installed * 8 - find where are the files that were created after the installation of the package. * 9 - remove the package with [[aptitude]] * 10 - control that the package was removed * 11 - remove the files created in package-minimal = Solution = == step 1 : preparation == * 1 - create a directory debian in the directory : package-minimal-1.2.1 {{{#!highlight console numbers=disable # mkdir -p package-minimal/package-minimal-1.2.1/debian # cd package-minimal/package-minimal-1.2.1/debian/ }}} * 2 - copy changelog, control, rules from minimal-package-files {{{#!highlight console numbers=disable $package-minimal/package-minimal-1.2.1/debian# ls changelog control rules }}} == step 2 : build the deb file == * 3 - remove from each file the maximun of data Here are the content of the three remaining files : changelog, control and rules. {{{#!highlight console numbers=disable $package-minimal/package-minimal-1.2.1/debian# more changelog package-minimal (1) unstable; urgency=low -- r Tue, 30 Aug 2011 07:27:05 -1000 $package-minimal/package-minimal-1.2.1/debian# more control Source: package-minimal Section: unknown Package: package-minimal Architecture: any $package-minimal/package-minimal-1.2.1/debian# more rules %: dh $@ }}} * 4 - build the package with [[dpkg-buildpackage]] {{{#!highlight console numbers=disable $package-minimal/package-minimal-1.2.1/debian# cd .. $package-minimal/package-minimal-1.2.1# dpkg-buildpackage -rfakeroot }}} * 5 - 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. it is the solution, so we can go on. == step 4 : testing == * 6 - install the package with [[dpkg]] {{{#!highlight console numbers=disable $package-minimal/package-minimal-1.2.1# cd .. $package-minimal# dpkg -i p*.deb }}} * 7 - control that the package was correctly installed {{{#!highlight console numbers=disable $package-minimal# aptitude show package-minimal Package: package-minimal New: yes State: installed Automatically installed: no Version: 1 }}} * 8 - find where are the files that were created after the installation of the package. {{{#!highlight console numbers=disable # cd / $/# find -name "package-minimal*" ./usr/share/doc/package-minimal ./var/lib/dpkg/info/package-minimal.md5sums ./var/lib/dpkg/info/package-minimal.list }}} * 9 - remove the package with [[aptitude]] {{{#!highlight console numbers=disable $package-minimal# aptitude remove package-minimal }}} * 10 - control that the package was removed {{{#!highlight console numbers=disable # aptitude show package-minimal E: Unable to locate package package-minimal }}} * 11 - remove the files created in package-minimal {{{#!highlight console numbers=disable $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 rm: cannot remove `package-minimal-1.2.1': Is a directory }}}