Changeset - r26220:12c5263cff20
[Not reviewed]
master
0 1 1
Nik Nyby - 3 years ago 2022-04-19 00:11:42
nikolas@gnu.org
Add: [CMake] support rpm for fedora and rhel (#9861)
2 files changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
cmake/InstallAndPackage.cmake
Show inline comments
 
@@ -126,13 +126,13 @@ if(APPLE)
 
    include(PackageBundle)
 

	
 
    if (APPLE_UNIVERSAL_PACKAGE)
 
        set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-macos-universal")
 
    else()
 
        set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-macos-${CPACK_SYSTEM_NAME}")
 
	endif()
 
    endif()
 
elseif(WIN32)
 
    set(CPACK_GENERATOR "ZIP")
 
    if(OPTION_USE_NSIS)
 
        list(APPEND CPACK_GENERATOR "NSIS")
 
        include(PackageNSIS)
 
    endif()
 
@@ -178,12 +178,16 @@ elseif(UNIX)
 
            file(STRINGS "/etc/os-release" OS_RELEASE_CONTENTS REGEX "^ID=")
 
            string(REGEX MATCH "ID=(.*)" _ ${OS_RELEASE_CONTENTS})
 
            set(DISTRO_ID ${CMAKE_MATCH_1})
 
            if(DISTRO_ID STREQUAL "arch")
 
                set(PLATFORM "arch")
 
                set(CPACK_GENERATOR "TXZ")
 
            elseif(DISTRO_ID STREQUAL "fedora" OR DISTRO_ID STREQUAL "rhel")
 
                set(PLATFORM "fedora")
 
                set(CPACK_GENERATOR "RPM")
 
                include(PackageRPM)
 
            else()
 
                set(UNSUPPORTED_PLATFORM_NAME "Linux distribution '${DISTRO_ID}' from /etc/os-release")
 
            endif()
 
        else()
 
            set(UNSUPPORTED_PLATFORM_NAME "Linux distribution")
 
        endif()
cmake/PackageRPM.cmake
Show inline comments
 
new file 100644
 
set(CPACK_RPM_PACKAGE_ARCHITECTURE "${ARCHITECTURE}")
0 comments (0 inline, 0 general)