Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[SOLVED] create .deb from upstream source
[SOLVED] create .deb from upstream source
I've been looking for some decent and up-to-date documentation about creating deb files from upstream sources. During my search, I found the following:
https://www.debian.org/doc/manuals/debm ... 04.en.html
Can anyone tell me if this is the preferred way, or are there other tutorials/tools out there...
thx
https://www.debian.org/doc/manuals/debm ... 04.en.html
Can anyone tell me if this is the preferred way, or are there other tutorials/tools out there...
thx
Last edited by Chrisdb on 2020-01-02 16:34, edited 1 time in total.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: create .deb from upstream source
Yes, debmake is the most convenient option, it fills in most of the debian folder contents for you.Chrisdb wrote:if this is the preferred way
deadbang
Re: create .deb from upstream source
One thing I don't understand is this:
Does this mean that an installed deb would reside next to stable software packages?
I would think that upstream produced binaries would some day collide with the stable packages, or am I missing something?
Code: Select all
Debian packaging requires changing this “make install” process to install files to the target system image location instead of the normal location under /usr/local.
I would think that upstream produced binaries would some day collide with the stable packages, or am I missing something?
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: create .deb from upstream source
Most programs should install to DESTDIR, which dpkg will automatically convert to /usr/bin (not /usr/local/bin), so that's not something you usually have to worry about.
deadbang
Re: create .deb from upstream source
Sometimes upstream will give *.deb specific instructions.
https://github.com/johanmalm/jgmenu/blo ... an-package
https://github.com/johanmalm/jgmenu/blo ... an-package
- Soul Singin'
- Posts: 1605
- Joined: 2008-12-21 07:02
Re: create .deb from upstream source
HowTo Build a Package from Source the Smart Way. It's a little out-of-date (10 years old), but still a good starting point.Chrisdb wrote:I've been looking for some decent and up-to-date documentation about creating deb files from upstream sources.
I think you're both missing something and understanding correctly at the same time.Chrisdb wrote:One thing I don't understand is this:Does this mean that an installed deb would reside next to stable software packages?Code: Select all
Debian packaging requires changing this “make install” process to install files to the target system image location instead of the normal location under /usr/local.
I would think that upstream produced binaries would some day collide with the stable packages, or am I missing something?
The page begins by explaining how source is traditionally compiled using the "make install" process. The sentence that you quoted is from that section. It means that Debian packaging requires changing that process.
What you understand correctly is that installation of the DEB package (that you build) would place the files in /usr/bin/ alongside your other software packages. You also understand correctly that the package you build will "some day collide" with a Debian version of that package.
What you're missing is the version number. If the package that you build has a higher version number than the package available from Debian, then APT will not touch your package. APT assumes that you prefer the package with the higher version number (unless you specify a different preference with pinning).
Of course, one day in the future, Debian may offer a version that is newer than the one you built. If so, APT will upgrade to that newer version. That's what most people prefer, so in most cases there's no issue.
But if your compiled package supports a particular feature and if that feature differs from what Debian's package supports, you might prefer your own package. If so, you can use pinning to prevent the upgrade. Or your can build yourself yet another package that suits your tastes and preferences.
Re: create .deb from upstream source
Thx for the link. Like you said it is a good starting point. What do you think about debmake and debuild in contrast to running dh-make and dpkg-buildpackage?Soul Singin' wrote: HowTo Build a Package from Source the Smart Way. It's a little out-of-date (10 years old), but still a good starting point.
Another question, in the rules file I see the following:
Code: Select all
override_dh_auto_install: dh_auto_install -- prefix=/usr
- stevepusser
- Posts: 12930
- Joined: 2009-10-06 05:53
- Has thanked: 41 times
- Been thanked: 72 times
Re: create .deb from upstream source
What particular rules file are you referring to? Anyway, what you have to use depends on how the upstream Makefile or whatever is configured and installing the files. If you're lucky, you don't have to do any overrides, but sometimes the install prefix is set in either the configuration or the install step--sources vary wildly.Chrisdb wrote:Thx for the link. Like you said it is a good starting point. What do you think about debmake and debuild in contrast to running dh-make and dpkg-buildpackage?Soul Singin' wrote: HowTo Build a Package from Source the Smart Way. It's a little out-of-date (10 years old), but still a good starting point.
Another question, in the rules file I see the following:Shouldn't the prefix be used with 'override_dh_auto_configure'?Code: Select all
override_dh_auto_install: dh_auto_install -- prefix=/usr
Are you trying to package any project in particular? Maybe someone has already done the packaging work for you, and you can copy it.
MX Linux packager and developer
Re: create .deb from upstream source
I was thinking of the most recent php version 7.4 and it has several configure options. I know there is a SURY PHP Repository, but I would like to create a Deb file myself
https://www.debian.org/doc/manuals/debm ... maintainer
Happy newyear everybody btw
I was referring to:stevepusser wrote:What particular rules file are you referring to?
Are you trying to package any project in particular? Maybe someone has already done the packaging work for you, and you can copy it.
https://www.debian.org/doc/manuals/debm ... maintainer
Happy newyear everybody btw
- Soul Singin'
- Posts: 1605
- Joined: 2008-12-21 07:02
Re: create .deb from upstream source
In that case, take a look at Ondrej Sury's work. Study his Debian-ization of the upstream source and then build your own DEB packages.Chrisdb wrote:I was thinking of the most recent php version 7.4 and it has several configure options. I know there is a SURY PHP Repository, but I would like to create a Deb file myself
Happy New Year to you too!Chrisdb wrote:Happy newyear everybody btw
And happy DEB building! Have fun!
Re: create .deb from upstream source
Thx for the infoSoul Singin' wrote: In that case, take a look at Ondrej Sury's work. Study his Debian-ization of the upstream source and then build your own DEB packages.
Maybe this is also an opportunity for you to update your wiki
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: create .deb from upstream source
That version is in experimental: https://packages.debian.org/experimental/php7.4Chrisdb wrote:I was thinking of the most recent php version 7.4 and it has several configure options.
Just add a deb-src line for experimental then update the package database and grab the source:
Code: Select all
apt source php7.4
deadbang
Re: create .deb from upstream source
Just to be sure, if I use source from unstable/experimental and I compile it on my stable system, I will not create a frankendebian right?Head_on_a_Stick wrote:That version is in experimental: https://packages.debian.org/experimental/php7.4Chrisdb wrote:I was thinking of the most recent php version 7.4 and it has several configure options.
Just add a deb-src line for experimental then update the package database and grab the source:^ That should download the package source from Debian, which will include the debian/ folder with all the patches and compilation options so you can build a custom version.Code: Select all
apt source php7.4
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: create .deb from upstream source
That's right. FrankenDebians are Debian stable machines that have been polluted with packages from testing/unstable (or Ubuntu PPAs) but rebuilding the package in your stable environment will produce a "safe" backport.Chrisdb wrote:if I use source from unstable/experimental and I compile it on my stable system, I will not create a frankendebian right?
deadbang
Re: create .deb from upstream source
Thx. I will have a try with some packagesHead_on_a_Stick wrote:That's right. FrankenDebians are Debian stable machines that have been polluted with packages from testing/unstable (or Ubuntu PPAs) but rebuilding the package in your stable environment will produce a "safe" backport.Chrisdb wrote:if I use source from unstable/experimental and I compile it on my stable system, I will not create a frankendebian right?