Skip to content

Commit

Permalink
Honor rpm vendor setting from cmake, use a saner name
Browse files Browse the repository at this point in the history
The vendor was hardwired to "redhat" as a leftoever from early cmake
bootstrapping phase and bugs in the surrounding logic. Simplify the
setup somewhat: call the setting RPM_VENDOR and pass that around in the
code tree as well. The CANON fubar along with other similar weirdness
can thus remain hidden in the makemacros() cmake function.

Reported and initial patch by Neil Gompa.
  • Loading branch information
pmatilai committed Mar 30, 2023
1 parent 4f2627e commit a2b4927
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ option(WITH_FSVERITY "Build with fsverity support" OFF)
option(WITH_IMAEVM "Build with IMA support" OFF)

set(RPMCONFIGDIR "${CMAKE_INSTALL_PREFIX}/lib/rpm" CACHE PATH "rpm home")
set(RPMCANONVENDOR "vendor" CACHE STRING "rpm vendor string")
set(RPM_VENDOR "vendor" CACHE STRING "rpm vendor string")

# emulate libtool versioning
set(RPM_SOVERSION 9)
Expand Down Expand Up @@ -90,7 +90,7 @@ function(makemacros)

set(host_cpu ${CMAKE_HOST_SYSTEM_PROCESSOR})
string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} host_os)
set(host_vendor redhat)
set(host_vendor ${RPM_VENDOR})
set(host ${host_cpu}-${host_vendor}-${host_os})

set(RPMCANONVENDOR ${host_vendor})
Expand Down
2 changes: 1 addition & 1 deletion config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@
#define PACKAGE "@PROJECT_NAME@"
#define VERSION "@PROJECT_VERSION@"
#define PACKAGE_BUGREPORT "@PROJECT_HOMEPAGE_URL@"
#define RPMCANONVENDOR "@RPMCANONVENDOR@"
#define RPM_VENDOR "@RPM_VENDOR@"
4 changes: 2 additions & 2 deletions lib/rpmrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static void setDefaults(void)
const char *confdir = rpmConfigDir();
if (!defrcfiles) {
defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
confdir, "/" RPM_VENDOR "/rpmrc", ":",
SYSCONFDIR "/rpmrc", ":",
"~/.rpmrc", NULL);
}
Expand All @@ -468,7 +468,7 @@ static void setDefaults(void)
confdir, "/macros.d/macros.*", ":",
confdir, "/platform/%{_target}/macros", ":",
confdir, "/fileattrs/*.attr", ":",
confdir, "/" RPMCANONVENDOR "/macros", ":",
confdir, "/" RPM_VENDOR "/macros", ":",
SYSCONFDIR "/rpm/macros.*", ":",
SYSCONFDIR "/rpm/macros", ":",
SYSCONFDIR "/rpm/%{_target}/macros", ":",
Expand Down

0 comments on commit a2b4927

Please sign in to comment.