empty RPM_BUILD_ROOT #19

Closed
akkumar opened this Issue Aug 27, 2012 · 7 comments

Comments

Projects
None yet
2 participants
@akkumar

akkumar commented Aug 27, 2012

As per this wiki, http://www.rpm.org/max-rpm/s1-rpm-inside-scripts.html .

there is a reference to the variable RPM_BUILD_ROOT , that can be possibly set, by the rpm packaging software to get a sense of where this rpm would go into.

Currently, the list of RPM_ environment variables, written are available at:

./src/main/groovy/com/trigonic/gradle/plugins/rpm/RpmCopySpecVisitor.groovy +118

RPM_ARCH=%s \n
RPM_OS=%s \n
RPM_PACKAGE_NAME=%s \n
RPM_PACKAGE_VERSION=%s \n
RPM_PACKAGE_RELEASE=%s \n\n

It would be useful to consider RPM_BUILD_ROOT , as well, if possible.

( May be, task.destinationDir , might be appropriate ? ) .

@AlanKrueger

This comment has been minimized.

Show comment
Hide comment
@AlanKrueger

AlanKrueger Sep 19, 2012

Member

I thought RPM_BUILD_ROOT was used by the rpmbuild tool when constructing the rpm package, pulling specified files to be included in the rpm from that location. Can you flesh out how you propose this to be used?

Member

AlanKrueger commented Sep 19, 2012

I thought RPM_BUILD_ROOT was used by the rpmbuild tool when constructing the rpm package, pulling specified files to be included in the rpm from that location. Can you flesh out how you propose this to be used?

@akkumar

This comment has been minimized.

Show comment
Hide comment
@akkumar

akkumar Sep 20, 2012

Quoting the wiki,
" - This environment variable is used to hold the "build root", into which the newly built software will be installed "

In the preInstall.sh , postInstall.sh scripts of rpm, this information might be useful .

akkumar commented Sep 20, 2012

Quoting the wiki,
" - This environment variable is used to hold the "build root", into which the newly built software will be installed "

In the preInstall.sh , postInstall.sh scripts of rpm, this information might be useful .

@AlanKrueger

This comment has been minimized.

Show comment
Hide comment
@AlanKrueger

AlanKrueger Sep 20, 2012

Member

I believe that's where the built software is installed on the build machine before actually assembling the rpm. I don't think RPM_BUILD_ROOT is used at all in the RPM when installing on a destination machine.

Member

AlanKrueger commented Sep 20, 2012

I believe that's where the built software is installed on the build machine before actually assembling the rpm. I don't think RPM_BUILD_ROOT is used at all in the RPM when installing on a destination machine.

@akkumar

This comment has been minimized.

Show comment
Hide comment
@akkumar

akkumar Sep 22, 2012

Based off RPM_BUILD_ROOT description - ".. into which the newly built software will be installed. If no explicit build root has been specified (either by command line option, spec file tag line, or rpmrc file entry), this variable will be null." .

This seems more like a hint from the build process ( spec file / rpmrc / cmd line ) etc. about where we can figure out this particular package is getting installed. The ambiguous part about this variable is this could be null for the most part and rpm will ignore / work fine. Case in point: even today the rpm-s created by the gradle rpm plugin install fine, even if RPM_BUILD_ROOT is set null .

But, if there is a way to inject this to gradle script explicitly setting this build root information from build.gradle through some property, that in turn sets RPM_BUILD_ROOT, that will be useful for the postInstall.sh / preInstall.sh scripts to pick up the same.

akkumar commented Sep 22, 2012

Based off RPM_BUILD_ROOT description - ".. into which the newly built software will be installed. If no explicit build root has been specified (either by command line option, spec file tag line, or rpmrc file entry), this variable will be null." .

This seems more like a hint from the build process ( spec file / rpmrc / cmd line ) etc. about where we can figure out this particular package is getting installed. The ambiguous part about this variable is this could be null for the most part and rpm will ignore / work fine. Case in point: even today the rpm-s created by the gradle rpm plugin install fine, even if RPM_BUILD_ROOT is set null .

But, if there is a way to inject this to gradle script explicitly setting this build root information from build.gradle through some property, that in turn sets RPM_BUILD_ROOT, that will be useful for the postInstall.sh / preInstall.sh scripts to pick up the same.

@AlanKrueger

This comment has been minimized.

Show comment
Hide comment
@AlanKrueger

AlanKrueger Sep 24, 2012

Member

Please take a look at the Inside Scripts section of the Maximum RPM documentation. The default value of RPM_BUILD_ROOT is typically /usr/src/redhat/BUILD and is used as the working directory for the prep and build scripts, which are run while the rpm file is being built, not while it's installing on the target machine.

Member

AlanKrueger commented Sep 24, 2012

Please take a look at the Inside Scripts section of the Maximum RPM documentation. The default value of RPM_BUILD_ROOT is typically /usr/src/redhat/BUILD and is used as the working directory for the prep and build scripts, which are run while the rpm file is being built, not while it's installing on the target machine.

@akkumar

This comment has been minimized.

Show comment
Hide comment
@akkumar

akkumar Oct 7, 2012

May be, you are referring to RPM_BUILD_DIR ( when referring to, /usr/src/redhat/BUILD as default ) ? On contrast, I guess RPM_BUILD_ROOT refers to where the new software will be optional, albeit optional though .

akkumar commented Oct 7, 2012

May be, you are referring to RPM_BUILD_DIR ( when referring to, /usr/src/redhat/BUILD as default ) ? On contrast, I guess RPM_BUILD_ROOT refers to where the new software will be optional, albeit optional though .

@AlanKrueger

This comment has been minimized.

Show comment
Hide comment
@AlanKrueger

AlanKrueger Oct 7, 2012

Member

You're correct that RPM_BUILD_ROOT and RPM_BUILD_DIR are distinct, but they're both build-time settings. Please see this Stack Overflow article.

Member

AlanKrueger commented Oct 7, 2012

You're correct that RPM_BUILD_ROOT and RPM_BUILD_DIR are distinct, but they're both build-time settings. Please see this Stack Overflow article.

@AlanKrueger AlanKrueger closed this Feb 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment