Skip to content

Can't build RPM for GCC9 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
velomatt opened this issue Feb 19, 2021 · 1 comment
Open

Can't build RPM for GCC9 #5

velomatt opened this issue Feb 19, 2021 · 1 comment

Comments

@velomatt
Copy link

This appears to affect both GCC8 and GCC9, looking at the code.

the gcc_install_scripts_prefix macro is not defined when executing make-gcc-rpm.sh

Processing files: kewb-gcc930-9.3.0-0.7.4.x86_64
error: File must begin with "/": %{gcc_install_scripts_prefix}/setenv-for-gcc930.sh
error: File must begin with "/": %{gcc_install_scripts_prefix}/restore-default-paths-gcc930.sh
error: File must begin with "/": %{gcc_install_scripts_prefix}/gcc930
error: File must begin with "/": %{gcc_install_scripts_prefix}/g++930


RPM build errors:
    File must begin with "/": %{gcc_install_scripts_prefix}/setenv-for-gcc930.sh
    File must begin with "/": %{gcc_install_scripts_prefix}/restore-default-paths-gcc930.sh
    File must begin with "/": %{gcc_install_scripts_prefix}/gcc930
    File must begin with "/": %{gcc_install_scripts_prefix}/g++930

Looking at the SPEC file in both GCC8 and GCC9 branches, it looks like the wrong macro name is being specified in the make-gcc-rpm.sh script :

function rpmcmd ()
{
    rpmbuild -bb $RPM_QUIET                                             \
    --define "build_root_dir $BO_ROOT_DIR"                              \
    --define "gcc_install_dir $GCC_INSTALL_PREFIX"                      \
    --define "gcc_install_reldir $GCC_INSTALL_RELDIR"                   \
    --define "gcc_install_scripts_dir $GCC_INSTALL_SCRIPTS_PREFIX"      \
    --define "gcc_install_scripts_reldir $GCC_INSTALL_SCRIPTS_RELDIR"   \
    --define "gcc_tag $GCC_TAG"                                         \
    --define "gcc_version $GCC_VERSION"                                 \
    --define "gcc_rpm_release $RPM_RELEASE"                             \
    --define "product_arch $PLATFORM_ARCH"                              \
    --define "product_os $PLATFORM_OS"                                  \
    --define "_topdir $WORK_DIR"                                        \
    --define "_tmppath $WORK_DIR/TMP"                                   \
    --define "_rpmdir $OUTPUT_DIR"                                      \
    --define "_build_name_fmt %%{NAME}-%%{RELEASE}.%%{ARCH}.rpm"        \
    $SPEC_FILE
}

After changing gcc_install_scripts_dir to gcc_install_scripts_prefix I am able to build RPM without issues.

@BobSteagall
Copy link
Owner

Thanks for finding this. I haven't built RPMs in a while. I'll see that it gets fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants