How to create a debian package

method 1
see also http://ubuntuforums.org/showthread.php?t=910717
supposing anything-sync-daemon-5.76 contains all package's files

Than simply create anything-sync-daemon-5.76/DEBIAN/control file with a similar content:
Package: anything-sync-daemon
Version: 5.76
Section: Utilities
Priority: optional
Architecture: amd64
Maintainer: Gigi Kent <gigi77@yahoo.com>
Description: anything sync daemon

then run
dpkg-deb --build anything-sync-daemon-5.76
dpkg-deb -c anything-sync-daemon-5.76.deb
sudo dpkg -i anything-sync-daemon-5.76.deb
method 2 (problem: will include only the doc files ...)
see also http://packaging.ubuntu.com/html/packaging-new-software.html
sudo apt-get install build-essential
e.g. for anything-sync-daemon
NEW_BUILD_NAME=anything-sync-daemon
NEW_BUILD_VER=5.76
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ubuntu_packages/*/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
build command was something like this: make install DESTDIR=$NEW_BUILD_NAME_AND_VER
tar czf $NEW_BUILD_NAME_AND_VER.tgz $NEW_BUILD_NAME_AND_VER

e.g. package anything-sync-daemon
at this point anything-sync-daemon-5.76.tgz must exists!
bzr dh-make anything-sync-daemon 5.76 anything-sync-daemon-5.76.tgz
find anything-sync-daemon
cd anything-sync-daemon/debian
rm *ex *EX
rm README.source README.Debian
take the Ubuntu release name
lsb_release -a | grep Codename | awk '{print $2}'
and use it here (e.g. wily):
sed -i s/"unstable"/"wily"/ changelog
sed -i s/"gigi <gigi@unknown>"/"Gigi Kent <gigi77@yahoo.com>"/ changelog
sed -i s/"gigi <gigi@unknown>"/"Gigi Kent <gigi77@yahoo.com>"/ control
sed -i s/"Section: unknown"/"Section: Utilities"/ control
also fill Description in control file

Finally commit the code to your packaging branch
cd ..
now you should be back to the anything-sync-daemon directory
bzr add debian/source/format
bzr commit -m "Initial commit of Debian packaging ($NEW_BUILD_NAME)."
building the package
bzr builddeb -- -us -uc
lesspipe ../anything-sync-daemon_5.76-1_amd64.deb
check deb file for errors
lintian ../anything-sync-daemon_5.76-1_amd64.deb -> for single binary
lintian ../anything-sync-daemon_5.76-1_all.deb -> for indep binary
list deb content
dpkg-deb -c ../anything-sync-daemon_5.76-1_amd64.deb
dpkg-deb -c ../anything-sync-daemon_5.76-1_all.deb

ERROR
	bzr: ERROR: Unable to determine your name
	Please, set your name with the 'whoami' command.
SOLUTION
	bzr whoami "firstname name <email address>"
	e.g.:
	bzr whoami "Gigi Kent <gigi77@yahoo.com>"

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.