Usually, rpmbuild related variables are set in ~/.rpmmacros
. To change the current working directory, one could simply alter the default settings:
%_topdir %(echo $HOME)/rpmbuild
This would change rpmbuild’s working directory on a per-user basis.
Sometimes it’s quite convenient to keep the default setting and change the working directory on a per-project basis:
$ rpmbuild --define "_topdir workingdir" -ba project.spec
To use the current directory as working directory, one could invoke rpmbuild
as follows:
$ rpmbuild --define "_topdir `pwd`" -ba SPECS/project.spec
Careful: Double quotes are mandatory as well as having a proper subdirectory structure in the new working directory (BUILD, SRPM, RPM, SPECS and SOURCES).
Resources:
http://www.rpm.org/max-rpm/s1-rpm-anywhere-different-build-area.html
http://stackoverflow.com/questions/416983/why-is-topdir-set-to-its-default-value-when-rpmbuild-called-from-tcl
This site was… how do you say it? Relevant!! Finally I’ve found something that helped me. Many thanks!
Thanks!, Just what i was searching for, fastly!
Thank you!