Re: cleaning build dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Jeff Johnson wrote:
>  On 8/22/06, Lars Wilke <lars_wilke@xxxxxx> wrote:
> > Many tutorials out there suggest something like this in the %clean
> > section
> >
> >    test "X$RPM_BUIlD_ROOT" != "X/" && rm -rf "$RPM_BUILD_ROOT"
>
>  Many tutorials on rpm packageing are on crack. Seriously, the test is bogus
>  when you consider what happens with
>      BuildRoot: /lib
>  or
>      BuildRoot: /home/user
>  rpm can and will run
>      rm -rf %{buildroot}
>  perhaps several times.

Yeah, i thought that. But if the build is run as a user, well the user
just loses his home dir but if this is run as root ... well ... you
become a real luser :) Ok, you are quite right here.

> >    test "X$RPM_BUIlD_ROOT" != "X/" && rm -rf "$RPM_BUILD_ROOT"
> >    if test "X$RPM_BUILD_DIR" != "x/"; then
> >       cd "$RPM_BUILD_DIR"
> >       rm -rf "${RPM_PACKAGE_NAME}-$RPM_PACKAGE_VERSION"
> >    fi
> > [...]
>
>  Well, BuildRoot: and %clean just dropped out of rpm-4.4.7 this week,
>  so It Really Doesn't Matter what you put in spec files any more.

Eh, you really do main surgery on this thing, right?

Is this stuff documented, especially how one is going to use that
thing to cleanup after the build. What will rpm choose as BuildRoot
in this version?

>  Meanwhile, this is probably sanest and simplest
>      BuildRoot: %{_tmppath}/%{name}-root
>      ...
>      %install
>       rm -rf %{buildroot}
>      ...
>      %clean
>      rm -rf %{buildroot}

Yeah, but this does not delete the build dir i.e. ../BUILD/bla-123.
That was my question. What is the way[tm] to get rid of that dir.
Using --clean or a script in the specfile.

But i bet you will tell me know that it doesn't matter that much, right :)


Thanks a lot

   --lars

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

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux