[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ubuntu-devel-discuss
Subject:    Re: How to build systemd
From:       J Fernyhough <j.fernyhough () gmail ! com>
Date:       2016-08-05 10:48:46
Message-ID: 419b5045-0f9c-e01f-304c-6a4419db538c () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


On 04/08/16 15:45, Alex Lyakas wrote:
> Greetings,
>  
> I have downloaded the systemd package for trusty
> (http://packages.ubuntu.com/source/trusty/systemd) with “apt-get source
> systemd”.
>  
> Which commands should I issue to build it? Specifically I need to build
> udev and its accompanying tools (like scsi_id).
>  

The easiest way (I've found) to build packages from source is with
`debuild`, e.g.:

$> apt-get source systemd
$> cd systemd-204
$systemd-204> debuild

This will probably complain about missing dependencies. You can go
through the list and install manually, use `apt-get build-dep systemd`,
or install `equivs` and use `mk-build-deps` (which is what I would do as
it's then easy to remove the deps afterwards), e.g.:

$> mk-build-deps systemd
$> sudo gdebi systemd-build-deps_204-5ubuntu20.19_all.deb

(`gdebi` will automatically install dependencies, `dpkg -i` will not.
`mk-build-deps` will also run without an argument from within a source
directory, the above command makes it explicit and means there's not a
deb file created in the source directory.)

So, putting this together:

$~> sudo apt-get install equivs
$~> apt-get source systemd
$~> mk-build-deps systemd
$~> sudo gdebi systemd-build-deps_204-5ubuntu20.19_all.deb
$~> cd systemd-204
$systemd-204> debuild
$systemd-204> cd ..
$~> ls
[newly created package files]
$~> sudo apt-get purge systemd-build-deps
$~> sudo apt-get autoremove --purge


Be aware that this build will depend on the packages currently installed
on your system. A better approach (which is also used by e.g. Launchpad)
is to build in a chroot, probably using pbuilder:

https://wiki.ubuntu.com/PbuilderHowto
https://www.debian.org/doc/manuals/maint-guide/build.en.html

Once you have this set up you only need to use `pdebuild` instead of
`debuild`:

$~> apt-get source systemd
$~> cd systemd-204
$systemd-204> sudo pdebuild
$systemd-204> ls /var/cache/pbuilder/result/
[newly created package files]

This should automatically install all necessary buildeps within the
chroot and produce the debs (and other package files) in
/var/cache/pbuilder/result by default. To specify a target location use
`pbuilder --buildresult /target/location` (see `man pdebuild`).


There's an awful lot of documentation on the web to wade through for
package maintenance, and quite a bit is contradictory (or at least
inconsistent), but this should at least get you started.

J


["signature.asc" (application/pgp-signature)]

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic