Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

%{_builddir}/%{_buildsubdir}

68 views
Skip to first unread message

Arkadiusz Miskiewicz

unread,
Oct 23, 2001, 8:26:16 AM10/23/01
to

Hi,

I need some way to get (from shell) name of directory where build process
will occur for example /home/users/me/rpm/BUILD/blabla-1.0 having only
spec file blabla.spec.

Any suggestions?

I've tried rpm --eval, rpm -bp --nobuild | grep etc but I don't see
any way to get %{_buildsubdir} name.
--
Arkadiusz Miśkiewicz IPv6 ready PLD Linux at http://www.pld.org.pl
misiek(at)pld.org.pl AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PWr

_______________________________________________
Rpm-list mailing list
Rpm-...@redhat.com
https://listman.redhat.com/mailman/listinfo/rpm-list

Ruda Moura

unread,
Oct 23, 2001, 9:32:35 AM10/23/01
to
On Tue, Oct 23, 2001 at 02:24:28PM +0200, Arkadiusz Miskiewicz wrote:
>
> I need some way to get (from shell) name of directory where build process
> will occur for example /home/users/me/rpm/BUILD/blabla-1.0 having only
> spec file blabla.spec.

Hi,
%setup is a primitive macro, not defined by any other macros but
made in C code. I guess (without changing rpm source code) it is impossible
to get %{buildsubdir} easily.

But with:

%setup -q
+%{echo: %{buildsubdir}}
+exit 0

i can get buildsubdir but only if i change the spec file.

also
rpm -bp rpm.spec --eval '%{echo: %{buildsubdir}}'
does not work.

Hope this add more hints for you.

PS1: maybe using rpmlib (or python-rpm) it would be possible to get
buildsubdir.

PS2:
[ruda@woz ruda]$ rpm -bp rpm/SPECS/rpm.spec 2>&1 | grep -v BUILD | grep '+ cd '

show me:

+ cd rpm-4.0.3

--
ruda

Marc Stephenson

unread,
Oct 23, 2001, 9:36:13 AM10/23/01
to
I just use %{_builddir}/%{name}-%{version} - that's right most of the time.

Marc


--
Marc Stephenson IBM Server Group - Austin, TX
Internet: ma...@austin.ibm.com NOTES: ma...@us.ibm.com
Phone: 512-327-5670 T/L 678-3189

Arkadiusz Miskiewicz

unread,
Oct 23, 2001, 10:01:16 AM10/23/01
to
Ruda Moura <ru...@conectiva.com.br> writes:

> %setup -q
> +%{echo: %{buildsubdir}}
> +exit 0
>
> i can get buildsubdir but only if i change the spec file.

Won't work because in my case I have only spec file - no sources.

> PS1: maybe using rpmlib (or python-rpm) it would be possible to get
> buildsubdir.

It will make things to much complicated.

> [ruda@woz ruda]$ rpm -bp rpm/SPECS/rpm.spec 2>&1 | grep -v BUILD | grep '+ cd '

> + cd rpm-4.0.3
Won't work, too - still no sources :-)

> ruda

Looks like there is no simple way to do that...

Jeff Johnson

unread,
Oct 23, 2001, 10:02:16 AM10/23/01
to
On Tue, Oct 23, 2001 at 02:24:28PM +0200, Arkadiusz Miskiewicz wrote:
>
> Hi,
>
> I need some way to get (from shell) name of directory where build process
> will occur for example /home/users/me/rpm/BUILD/blabla-1.0 having only
> spec file blabla.spec.
>
> Any suggestions?
>
> I've tried rpm --eval, rpm -bp --nobuild | grep etc but I don't see
> any way to get %{_buildsubdir} name.

In general
%_buildsubdir %{name}-%{version}

You need to parse the %setup line, looking for explicit -n overrides.

73 de Jeff

--
Jeff Johnson ARS N3NPQ
j...@jbj.org (j...@redhat.com)
Chapel Hill, NC

Jeff Johnson

unread,
Oct 23, 2001, 10:03:20 AM10/23/01
to
On Tue, Oct 23, 2001 at 11:30:50AM -0200, Ruda Moura wrote:
> On Tue, Oct 23, 2001 at 02:24:28PM +0200, Arkadiusz Miskiewicz wrote:
> >
> > I need some way to get (from shell) name of directory where build process
> > will occur for example /home/users/me/rpm/BUILD/blabla-1.0 having only
> > spec file blabla.spec.
>
> Hi,
> %setup is a primitive macro, not defined by any other macros but
> made in C code. I guess (without changing rpm source code) it is impossible
> to get %{buildsubdir} easily.
>

Yup.

> But with:


>
> %setup -q
> +%{echo: %{buildsubdir}}
> +exit 0
>
> i can get buildsubdir but only if i change the spec file.
>

> also
> rpm -bp rpm.spec --eval '%{echo: %{buildsubdir}}'
> does not work.

The --eval happens before parsing.

>
> Hope this add more hints for you.
>

> PS1: maybe using rpmlib (or python-rpm) it would be possible to get
> buildsubdir.

Nope.

73 de Jeff

--
Jeff Johnson ARS N3NPQ
j...@jbj.org (j...@redhat.com)
Chapel Hill, NC

_______________________________________________

Matthew Miller

unread,
Oct 23, 2001, 10:07:15 AM10/23/01
to
On Tue, Oct 23, 2001 at 04:00:39PM +0200, Arkadiusz Miskiewicz wrote:
> > i can get buildsubdir but only if i change the spec file.
> Won't work because in my case I have only spec file - no sources.

What are you trying to do?


--
Matthew Miller mat...@mattdm.org <http://www.mattdm.org/>
Boston University Linux ------> <http://linux.bu.edu/>

Arkadiusz Miskiewicz

unread,
Oct 23, 2001, 10:51:11 AM10/23/01
to
Matthew Miller <mat...@mattdm.org> writes:

> What are you trying to do?

Delete buildsubdir after failed rpm build. Simple task and
I wanted to do this in nicest way :-)

Now I'll probably parse buildlog and do what I want.

0 new messages