Чтв, 2003-11-27 у 23:13, Fezzik Giant написав:
Yes, I've recently looked at the LFS book. I wish it was scripted
Right now the package dependencies are getting in my way (in terms of a
manual process). I'm thinking of writing a script that extracts the
'BuildRequires' tags, creates a directed graph of the build dependencies (as
different from the installation dependencies), does a topological sort on
the graph and kicks off the build process.
I would love to get some comments on this approach. Hopefully it's been done
and someone can send a link.
I'm using rather simple prototype of build system written in python.
This is not a complete solution, but it works well for me.
It works this way:
1. It analyzes spec file and determines list of packages needed to
build(BuildReq BuildPreReq fields).
2. Append to this list basic packages needed to build (gcc, rpm-build
3. Recursively determines all packages needed by packages from this list
and appends them to list too.
4. Installs them in chroot jail, copies spec and sources, setup
5. Build package in chroot
6. If all is Ok, it copies built packages to package set and remove
This approach has several advantages
1. You don't break your system anyhow.
2. You always build against actual RPMs
3. This way can be built package to any version of distribution,
everything you need is set of its RPM packages. You
don't need several virtual or real machines for this.
4. You save disk space, since you don't need to have installed all
development packages needed to build every package in distribution.
5. It helps to discover missing dependencies between packages. If some
dependency is missing - required package wont be installed in chroot,
therefore you cannot built your package until you fix it.
1. Installing packages in chroot jail need 1-2 minutes
on Athlon 2.4GHz with IDE disk. It is possible to reduce this time
It would be great to append dependencies resolution scheme
to build several source packages automatically. But it's impossible for
me now because many Fedora packages have missing dependencies and build
process stops very often.
PS. Sorry for poor English.
Maxim Dziumanenko <mvd(a)mylinux.com.ua>