You are not logged in. Login or Register for free.
Title only?
Strange sound and vision from here to the end of the world.
"We're fans first, journalists second."






  17 comments
  Email this



Posted on Wednesday, August 16th, 2006 23:49:49 GMT by: quietearth
Posted under: ubuntu debian package

Here's how to easily build a .deb package for ubuntu (or debian). You could build a .deb package using checkinstall, but that wouldn't include all the debian/ubuntu specifics you need. I used the following to build the ubuntu package for my next release of News notification.

First off, let's install the necessary tools:
# apt-get install autotools-dev fakeroot dh-make build-essential

Then copy your source tree into a directory in /tmp:
# cp -r news-notification-0.3 /tmp
# cd /tmp/news-notification-0.3


Now let's make the debian control files:
# dh_make
and pick Single for single binary, or whatever is appropriate for your project.

Edit the debian/control file and at least change the Maintainer and Description fields. There are a few other files you will probably want to edit.

Then run the following: (this has to be done as root)
# dpkg-buildpackage -rfakeroot

Looking at the debian/news-notification/DEBIAN/control file we can see that all the dependencies are proper thanks to the autoconf system. If we look in /tmp (one directory up) we see news-notification_0.3-1_i386.deb which is ready to go! If we want to use the appropriate ubuntu package versioning, check out this post. Since this is my first ubuntu package of this version, with no debian original it would be:
news-notification_0.3-0ubuntu1_i386.deb
  

Pingbacks

Pingback from http://www.michelem.org/2007/05/12/links-for-2007-05-12/
on May 12th, 2007 8:24:22 GMT

Pingback from http://www.dotmana.com/index.php/?p=336
on September 15th, 2007 9:34:51 GMT

RSS Feed for comments

Comments

thank you for this document,i have use this to
create my first deb file

Posted by: china.newlad | September 27, 2006 11:53:57 pm | permalink

user icon With newer versions of dh_make, you might need to specify the --createorig flag to dh_make if you do not provide the original source file.

Posted by: quietearth | February 2, 2007 01:47:12 pm | permalink

dpkg-buildpackage -rfakeroot does NOT need to be run as root

Posted by: gerard | June 2, 2007 08:04:39 am | permalink

thank you for this document,i have use this to
create my first deb file : me too !

Posted by: Anonymous | September 17, 2007 02:13:04 pm | permalink

for me, I get a cannot find Glib2 error when running the dpkg-buildpackage command.

Posted by: Anonymous | June 16, 2008 05:19:02 pm | permalink

thanks :) BUT:
dpkg-buildpackage does indeed built the .deb packages, but they are almost empty. The data.tar.gz only contains the folder-structure "down to" the doc folder, but there is no data in the folder...

Posted by: tillux | June 20, 2008 01:04:39 pm | permalink

hey how can i "compile" the source in .deb files??

Posted by: pavan | January 28, 2009 12:38:36 pm | permalink

Thanks! You helped me to backport ghostscript from lenny to sarge today :).

Posted by: tshirtman | November 9, 2009 11:32:26 am | permalink

Great guide. Helped me out too :)

Posted by: Kristian Erikson | November 10, 2009 05:11:30 am | permalink

Nice guide, thanks!

I am trying to package code from somebody else. ./configure && make works. But dh_make -s -e 'acsccid-1.0.1@FransVerster.nl' --createorig && dpkg-buildpackage fails :-(

It is building without some .c file so the linker fails.

Howto fix? Whats so different when using dpkg-buildpackage ?

Thx!

Posted by: FCV | December 23, 2009 01:52:14 pm | permalink

Cheers, this helped me compile scanner backend for my Asus eee Xandros system, had to use a separate Etch installation on an old machine.
Changes must always be expected with new software versions butt this little guide worked fine still (May 2010).

Posted by: stein | May 16, 2010 10:16:06 am | permalink

Thanks

Helped me to back-port vlc to hardy today!

Posted by: Anonymous | June 11, 2010 07:07:07 am | permalink

As i m a newbie, i dont know what rule has to be added.

I got following error for "dpkg" command,
"
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value: -Wl,-Bsymbolic-functions
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package zsync
dpkg-buildpackage: source version 0.9ubuntu1-1
dpkg-buildpackage: source changed by mathankumarb <mk@zohocorp.com>
dpkg-buildpackage: host architecture i386
fakeroot debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
/usr/bin/make clean
make[1]: Entering directory `/tmp/zsync-0.9ubuntu1'
make[1]: *** No rule to make target `clean'. Stop.
make[1]: Leaving directory `/tmp/zsync-0.9ubuntu1'
make: *** [clean] Error 2
dpkg-buildpackage: failure: fakeroot debian/rules clean gave error exit status 2
"

Posted by: hik | July 1, 2010 05:26:22 am | permalink

hi5,

have u installed fakeroot. For me the above procedure is working fine. U might have missed something.

Posted by: creag | July 1, 2010 05:37:49 am | permalink

how to edit debian/control file??

it say Could not find <name>-<version>.orig.tar.gz at dh_make
?????

does not work T.T

Posted by: Soul | July 27, 2010 10:21:49 pm | permalink

Post a comment

Name:
(default is Anonymous)
Contact:
(email or url, optional)
Comment:
(no html or bbcode)
Captcha:



Related articles
Posted on Monday, April 23rd, 2007 3:22:07 GMT by: quietearth |   0 comments

Posted on Wednesday, August 16th, 2006 19:07:02 GMT by: quietearth |   14 comments

Posted on Tuesday, September 19th, 2006 17:42:50 GMT by: quietearth |   0 comments

Posted on Wednesday, January 10th, 2007 4:34:24 GMT by: quietearth |   0 comments

Posted on Monday, August 21st, 2006 18:41:02 GMT by: quietearth |   7 comments




rss | subscribe via email | the team | contact us | mobile
© 2006-2009 Don Neumann (except where applicable)
We are looking for free hosting with a cut of sales, you'll get a link right here.
If you want news of your film posted, use our contact page and we'll check it out
Permission is granted to use material from this site if you provide a reference to us via a link and DO NOT HOTLINK.


GenreBanners.com Banner Exchange