Creating .deb Packages: Difference between revisions
From Leo's Notes
This page was last edited on 21 May 2013, at 17:16.
Created page with " == Required Files and Directories == At the minimum, you should have: <syntaxhighlight lang="text" line start="1" enclose="div"> ./my-package/ ./my-package/DEBIAN ./my-pa..." |
No edit summary |
||
| Line 51: | Line 51: | ||
rm $BaseDirectory/$1.deb | rm $BaseDirectory/$1.deb | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Linux]] | |||
[[Category:Todo]] | |||
Revision as of 17:16, 21 May 2013
Required Files and Directories
At the minimum, you should have:
./my-package/
./my-package/DEBIAN
./my-package/DEBIAN/prerm
./my-package/DEBIAN/postinst
./my-package/DEBIAN/control
./my-package/usr/some/other/file
What's critical is the control file. The prerm/postinst scripts are optional. The rest are the files that are part of your package.
The control File
Package: cpsc-gpxe
Section: cpsc
Priority: extra
Maintainer: Leo Leung <lleung@ucalgary.ca>
Version: 0.1.1
Homepage: http://pages.cpsc.ucalgary.ca/~leo/support
Architecture: all
Depends: bash, coreutils, grub2-common, cpsc-initd
Description: Enables the gPXE grub option
Building the .dep Package
Once you have all your files
#!/bin/sh
BaseDirectory="/mnt/package_build/debbuild"
OutputDirectory="/mnt/repository/extras"
if [ -z $1 ] ; then
echo "Usage: sh build <package directory>"
exit
fi
cd $BaseDirectory
dpkg-deb --build $1
dpkg-sig --sign builder $1.deb
cd $OutputDirectory
sh add_deb.sh $BaseDirectory/$1.deb
rm $BaseDirectory/$1.deb