On my .spec file I want to pass alias make=gmake -j3, using a bash script I did

alias make="gmake -j3"

how to do in a .spec file?


You do not want to add -j3. That is settings just for your machine. You want to add something that will work everywhere:

gmake %{?_smp_mflags}

This macro is by default set to:

%_smp_mflags %( \
    [ -z "$RPM_BUILD_NCPUS" ] \\\
        && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
    if [ "$RPM_BUILD_NCPUS" -gt 16 ]; then \\\
        echo "-j16"; \\\
    elif [ "$RPM_BUILD_NCPUS" -gt 3 ]; then \\\
        echo "-j$RPM_BUILD_NCPUS"; \\\
    else \\\
        echo "-j3"; \\\
    fi )

I.e. more or less to number of your CPUs. On your machine it can be 3. On my machine it is 8.

See https://fedoraproject.org/wiki/Packaging:Guidelines#Parallel_make

| improve this answer | |

Solution found using variables

on top of spec

%define installc /opt/freeware/bin/install
%define make /opt/freeware/bin/gmake

on build and install part

%{make} -j3
%{installc} -m644 yasql.conf $RPM_BUILD_ROOT%{_sysconfdir}/yasql.conf
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.