Does %_prefix in your .rpmmacros not do this already?

On 06/12/13 15:49, Andy Riebs wrote:
> This patch allows the user to specify a different location for SLURM by
> redefining _prefix when building the RPM files. For example, this will
> base SLURM in /opt/slurm:
>
> $ rpmbuild -vv -ba \
>        --define="_prefix /opt/slurm" \
>          SPECS/slurm.spec
>
> Andy
>
> ------------ snip -----------------------
> --- slurm.spec.orig     2013-06-12 17:40:29.000000000 -0500
> +++ slurm.spec  2013-06-12 15:09:22.000000000 -0500
> @@ -29,7 +29,7 @@
>    #    slurm_with    builds option by default unless --without is specified
>    #    slurm_without builds option iff --with specified
>    #
> -%define _prefix /usr/local
> +%{!?_prefix: %define _prefix /usr/local}
>    %define _slurm_sysconfdir %{_prefix}/etc/slurm
>    %define _mandir %{_prefix}/share/man
>    %define _infodir %{_prefix}/share/info
> --------------- snip --------------
>

Reply via email to