How to get spec file path within rpm spec file
5,200
%{_specdir} /${name}.spec
will do the job. See this Fedora Wiki Page for more information.
Related videos on Youtube
Author by
Felipe Rodriguez
Updated on September 18, 2022Comments
-
Felipe Rodriguez over 1 year
The spec file is present inside the source directory. The specfile build section looks like
%build cd ~/path/sources make
If the spec file path can be detected then the hardcoding of the ~/path/sources can be avoided. How to get the spec file path.
-
Abby about 5 yearsNote that the
%{_specdir}
macro will redirect to%{_topdir}/SPECS/
, which by default is~/rpmbuild/SPECS/
. Not sure if that is what the OP was looking for.