Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  Purpose of /opt/freeware/src/packages/BUILD

    Posted Thu May 19, 2022 10:16 AM
    Hello,

    beginners question maybe, but what is the purpose of the directory /opt/freeware/src/packages/BUILD.
    I am self-compiling a few OS packages and found several older versions using up space in that directory.
    As I understand it the buildroot is set from the .spec file, which for me is %{_tmppath}/%{name}-%{version}-%{release}-root.
    Or is the directory used every time I build without using a .spec file? (./configure&make)
    Can I safely delete the older versions form the BUILD directory?

    Thank you for your help.

    Kind regards
    Frank

    ------------------------------
    Frank Lindner
    ------------------------------

    #AIXOpenSource


  • 2.  RE: Purpose of /opt/freeware/src/packages/BUILD

    Posted Thu May 19, 2022 10:42 AM
    Edited by Ayappan P Thu May 19, 2022 10:42 AM
    When you trigger rpmbuild on a spec file, /opt/freeware/src/packages/BUILD is the directory where the source tarball will be extracted and compiled. 
    buildroot in the spec file refers to the place where the package will be installed before packaging. From 4.6.X.X onwards,  specifying buildroot in the spec file won't have any effective. It will always be "/var/tmp/%{NAME}-%{VERSION}-%{RELEASE}.%{_arch}. arch will be ppc in AIX case.

    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: Purpose of /opt/freeware/src/packages/BUILD

    Posted Thu May 19, 2022 11:16 AM
    Thank you for the clarifications.
    So, the older versions under /opt/freeware/src/packages/BUILD can safely be removed.
    Considering buildroot I have a few questions of understanding (sorry!)
    Currently all my .spec files have the directive: BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
    This will be obsolete with RPM 4.6.X.X, because it will be enforced to /var/tmp/%{NAME}-%{VERSION}-%{RELEASE}.%{_arch}, correct?

    Within the .spec I several times refer to ${RPM_BUILD_ROOT}. I assume that variable got set by the BuildRoot directive?
    I just saw on https://access.redhat.com that I maybe should change all my ${RPM_BUILD_ROOT} for %{buildroot}.
    Is that preferable and safe to do?

    Thanks,
    Frank

    ------------------------------
    Frank Lindner
    ------------------------------



  • 4.  RE: Purpose of /opt/freeware/src/packages/BUILD

    Posted Thu May 19, 2022 11:31 AM
    Yes, setting BuildRoot in the spec file will have no effect. It will be enforced to /var/tmp/%{NAME}-%{VERSION}-%{RELEASE}.%{_arch} unless you modify the rpm macros file directly which is not recommended. 
    You can use any of them,  %{buildroot} or ${RPM_BUILD_ROOT}. They refer to the same ie., /var/tmp/%{NAME}-%{VERSION}-%{RELEASE}.%{_arch}

    ------------------------------
    Ayappan P
    ------------------------------



  • 5.  RE: Purpose of /opt/freeware/src/packages/BUILD

    Posted Thu May 19, 2022 11:51 AM
    One final question (I hope).
    On my AIX 7.2 system this is the output to
    # rpm --version
    RPM version 4.15.1

    I assume this is a version that is higher than the previous mentioned 4.6.X.X, am I right?

    Kind regards
    Frank

    ------------------------------
    Frank Lindner
    ------------------------------



  • 6.  RE: Purpose of /opt/freeware/src/packages/BUILD

    Posted Thu May 19, 2022 12:37 PM
    Yes, that's right.

    ------------------------------
    Ayappan P
    ------------------------------