Re: cleaning build dir

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

 



On 8/22/06, Lars Wilke <lars_wilke@xxxxxx> wrote:
Hi,

i am wondering atm about the prefered way to cleanup the build dir,
not the build root!

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.

The rpmbuild command provides the --clean flag to delete the build dir
after finishing.
But i could also use something like this in the clean section

   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

which would delete the build dir and the build root.
So what is the prefered way to do it. IIUC the %clean section is exactly
for this. Cleaning up after build.


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.

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

But feel free to shop whatever other answers you want from the
packaging policy police.

73 de Jeff

_______________________________________________
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