0

I want to build mysoftware.deb package for ubuntu and debian.

Every tutorial about building deb files is for maintaining not your own software, just for making deb files for ready source code. In my case I want to have building and installing software together with building deb package in one Makefile. So I can:

make
make install
make deb

How to write that makefile? I'm assuming I have debian/* files ready and under my version control system.

Very mysterious to me is creating that mysoftware.orig.tar.gz and uncompressing it back so I can invoke debuild inside that folder. !?!?....

Does anybody have some short and accurate documentation?

Tomek Wyderka
  • 1,425
  • 1
  • 15
  • 21

1 Answers1

1

If you already have a debian/rules file and just want to create a simple target to create your Debian package from your main Makefile, you could do something like this:

.PHONY: deb
deb:
        # maybe invoke dch here to add a new entry to debian/Changelog ...
        debuild -us -uc -rfakeroot -b

Just make sure this is not your default target (assuming your debian/rules invokes the main Makefile, as it usually does).


With dh-make you can create a simple "native" package, which means there is no upstream.

debian$ dh_make --native --other-options ...

I agree that the upstream assumption is kind of distracting. On the other hand, making a native package is so simple you hardly need much of a tutorial.

tripleee
  • 175,061
  • 34
  • 275
  • 318
  • Above command generates debian/* files. I have those files ready. How to generate my_1.0.deb package (I need command to insert in my Makefile). – Tomek Wyderka Nov 22 '12 at 06:31
  • Updated the answer slightly. Hope this helps. – tripleee Nov 22 '12 at 08:48
  • Your update works. Option I was missing is -b. Without it debuild asks about missing *.orig.* file. But "man debuild" doesn't list that switch... What means -b ? – Tomek Wyderka Nov 22 '12 at 14:00
  • One more important thing. That debuild command generates *.deb file in parent directory, which is out of my code tree. How I can change this? – Tomek Wyderka Nov 22 '12 at 14:01
  • You cannot really AFAIK; just move it when you are done, or make a superfluous parent directory. – tripleee Nov 22 '12 at 17:43
  • `-b` is a `dpkg-buildpackage` option properly; many of the programs in the dpkg toolchain have options which are simply passed on to one or more of the lower-level tools they invoke, so you have to chase forward links between the man pages. – tripleee Nov 22 '12 at 17:48