[Rpm-maint] Automatic BuildRoot by default?

Pixel pixel at mandriva.com
Thu Jun 12 13:42:18 UTC 2008


Jindrich Novy <jnovy at redhat.com> writes:

> Panu and me had a discussion related to automatic BuildRoot feature in
> the upcoming rpm. The plan is to actually obsolete BuildRoot tag from
> specs and to let decide rpm itself where the BuildRoot should be if
> not explicitely reconfigured.

cool :)


mandriva has the following (introduced when switching from rpm 4.4.8
to rpm.org):

# MDV2008.0 sets %buildroot globally, but default rule is %buildroot overrides BuildRoot
# this breaks (broken) .spec relying on a specified BuildRoot (mdvbz#34705).
# Introducing a global %defaultbuildroot which is used when neither %buildroot nor BuildRoot is used
# So %buildroot/$RPM_BUILD_ROOT in .spec are set to %buildroot or BuildRoot or %defaultbuildroot (in that order)

http://svn.mandriva.com/svn/packages/cooker/rpm/current/SOURCES/rpm-4.4.2.2-defaultbuildroot.patch

it works great :)

(but most mandriva pkgs still have "BuildRoot: ..." in spec file to
allow backporting)

> https://fedoraproject.org/wiki/PackagingDrafts/BuildRoot
> proposes the following BuildRoots in specs:
> 1. %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
> 2. %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
> 3. %{_tmppath}/%{name}-%{version}-%{release}-root
>
> The problem is that the 1. buildroot would break rpm --short-circuit
> and requires mktemp. The others are quite acceptable,

we've been talking about this on mandriva ml too.

some people require the addition of %{arch} to allow having build on
different archs.

> but here we go
> with another proposal:
>
> Let's add BUILDROOTS directory among others like RPMS, SOURCES, etc.
> to %{_topdir} and new %{_buildrootdir} variable originally pointing to
> %{_topdir}. So what I mean is to have:

FYI mandriva uses "bm" (initially from conectiva), which sets %_topdir
to the current directory. It also sets buildroot dir to `pwd`/BUILDROOT

i've no big preference between BUILDROOT and BUILDROOTS, but i wonder
why BUILDROOTS would have an "S" whereas BUILD doesn't :)



More information about the Rpm-maint mailing list