Getting the correct RPM directory for compiling [for scripting purposes]

Joe Huss

Staff member
I found myself needing to know where an SRPM is going to be installed (/usr/src/redhat or /root/rpmbuild,, etc.. ) had basic ways of doing it before (if dir exists assume its right), but finally wrote a good command for figuring it out accurately:

rpmdir="$(grep "^%_topdir" /usr/lib/rpm/macros | sed \
     -e s#"^.*%{getenv:HOME}"#"${HOME}"#g \
     -e s#"^.*%{_usrsrc}"#"/usr/src"#g)";

sets $rpmdir to the dir that rpm will use

not much of a script but im sure theres someone this will help


New Member
i would probably have chosen mysql just based on my own lack of experience, but mongoDG seems to offer quite a few benefits over mysql, such as speed and scalability.