ohpc icon indicating copy to clipboard operation
ohpc copied to clipboard

Fix OHPC_macros rpmlint error

Open jcsiadal opened this issue 5 years ago • 3 comments

Use of $RPM_SOURCE_DIR or %{_sourcedir} is now treated as an error by rpmlint. Red Hat has codified it as an error: "Packages which use files itemized as Source# files, must refer to those files by their Source# macro name, and must not use $RPM_SOURCE_DIR or %{sourcedir} to refer to those files."

Most importantly, OpenHPC packaging shouldn't fail rpmlint and require exceptions to pass a basic check.

It's an easy fix that can be done with a global search and replace: Take the Source42 declaration out of OHPC_macros. Replace all "%includes %{_sourcedir}/OHPC_macros" and variants with Source42: OHPC_macros %includes %{SOURCE42}

This seems to be the "official" format for external spec includes.

Given the number files to be updated, I'm adding it as an issue first instead of creating a PR.

jcsiadal avatar Oct 02 '20 19:10 jcsiadal

@jcsiadal Is this still a problem? Please open a PR if you have a fix.

adrianreber avatar Jun 07 '22 08:06 adrianreber

The fix above is the quick fix, but I think it's the wrong fix. OHPC_macros is not a source file--it's chunk of the specfile. The correct way to fix this is to symlink OHPC_macros under SPECS and just use "%include %{_specdir}/OHPC_macros".

I'm happy to create a PR, but we should discuss first, considering how many files are impacted.

jcsiadal avatar Jun 07 '22 20:06 jcsiadal