In the specfile template, the following lines are present:
%install
mkdir -p %{buildroot}{{installDir}}/{{name}}
cp -r ./* %{buildroot}{{installDir}}/{{name}}
I humbly submit that /{{name}} should not be included here for the reason that a user may wish to specify an absolute path as installDir. By appending {{name}}, the user must jump through hoops (sed, etc) to fix the resultant specfile.
For instance:
package.json:
"spec": {
"installDir": "/opt/mycompany/myproduct/bin"
Using %{buildroot}{{installDir}}/{{name}}, this results in the installation directory being /opt/mycompany/myproduct/bin/myproduct.
This effect also manifests in {{#executableFiles}} in %files:
{{#hasExecutableFiles}}
%defattr(755, {{username}}, {{username}}, 755)
{{#executableFiles}}
{{.}}
{{/executableFiles}}
{{/hasExecutableFiles}
...produces:
%defattr(755, 221b-server, 221b-server, 755)
/opt/mycompany/myproduct/bin/myproduct/221b_worker.py
Thank you!
In the specfile template, the following lines are present:
I humbly submit that /{{name}} should not be included here for the reason that a user may wish to specify an absolute path as installDir. By appending {{name}}, the user must jump through hoops (sed, etc) to fix the resultant specfile.
For instance:
package.json:
Using %{buildroot}{{installDir}}/{{name}}, this results in the installation directory being /opt/mycompany/myproduct/bin/myproduct.
This effect also manifests in {{#executableFiles}} in %files:
...produces:
%defattr(755, 221b-server, 221b-server, 755)
/opt/mycompany/myproduct/bin/myproduct/221b_worker.py
Thank you!