mirror of https://github.com/OpenTTD/OpenTTD
Fix: support non-ubuntu/debian Linux variants with LSB support (#8408)
This now generates a warning, as we would still like people to make a Pull Request to support the target. But it does continue with packing to a txz.pull/8409/head
parent
f24bc8b509
commit
0c3ddc5436
|
@ -114,13 +114,9 @@ elseif(UNIX)
|
||||||
# With FHS, we can create deb/rpm/... Without it, they would be horribly broken
|
# With FHS, we can create deb/rpm/... Without it, they would be horribly broken
|
||||||
# and not work. The other way around is also true; with FHS they are not
|
# and not work. The other way around is also true; with FHS they are not
|
||||||
# usable, and only flat formats work.
|
# usable, and only flat formats work.
|
||||||
if(OPTION_INSTALL_FHS)
|
if(NOT OPTION_INSTALL_FHS)
|
||||||
set(CPACK_GENERATOR "DEB")
|
|
||||||
include(PackageDeb)
|
|
||||||
else()
|
|
||||||
set(CPACK_GENERATOR "TXZ")
|
set(CPACK_GENERATOR "TXZ")
|
||||||
endif()
|
else()
|
||||||
|
|
||||||
find_program(LSB_RELEASE_EXEC lsb_release)
|
find_program(LSB_RELEASE_EXEC lsb_release)
|
||||||
execute_process(COMMAND ${LSB_RELEASE_EXEC} -is
|
execute_process(COMMAND ${LSB_RELEASE_EXEC} -is
|
||||||
OUTPUT_VARIABLE LSB_RELEASE_ID
|
OUTPUT_VARIABLE LSB_RELEASE_ID
|
||||||
|
@ -128,17 +124,28 @@ elseif(UNIX)
|
||||||
)
|
)
|
||||||
if(NOT LSB_RELEASE_ID)
|
if(NOT LSB_RELEASE_ID)
|
||||||
set(PLATFORM "generic")
|
set(PLATFORM "generic")
|
||||||
|
set(CPACK_GENERATOR "TXZ")
|
||||||
|
|
||||||
|
message(WARNING "Unknown Linux distribution found for packaging; can only pack to a txz. Please consider creating a Pull Request to add support for this distribution.")
|
||||||
elseif(LSB_RELEASE_ID STREQUAL "Ubuntu" OR LSB_RELEASE_ID STREQUAL "Debian")
|
elseif(LSB_RELEASE_ID STREQUAL "Ubuntu" OR LSB_RELEASE_ID STREQUAL "Debian")
|
||||||
execute_process(COMMAND ${LSB_RELEASE_EXEC} -cs
|
execute_process(COMMAND ${LSB_RELEASE_EXEC} -cs
|
||||||
OUTPUT_VARIABLE LSB_RELEASE_CODENAME
|
OUTPUT_VARIABLE LSB_RELEASE_CODENAME
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
string(TOLOWER "${LSB_RELEASE_ID}-${LSB_RELEASE_CODENAME}" PLATFORM)
|
string(TOLOWER "${LSB_RELEASE_ID}-${LSB_RELEASE_CODENAME}" PLATFORM)
|
||||||
|
|
||||||
|
set(CPACK_GENERATOR "DEB")
|
||||||
|
include(PackageDeb)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unknown Linux distribution found for packaging; please consider creating a Pull Request to add support for this distribution.")
|
set(PLATFORM "unknown")
|
||||||
|
set(CPACK_GENERATOR "TXZ")
|
||||||
|
|
||||||
|
message(WARNING "Unknown LSB-based Linux distribution '${LSB_RELEASE_ID}' found for packaging; can only pack to a txz. Please consider creating a Pull Request to add support for this distribution.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-linux-${PLATFORM}-${CPACK_SYSTEM_NAME}")
|
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-linux-${PLATFORM}-${CPACK_SYSTEM_NAME}")
|
||||||
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unknown OS found for packaging; please consider creating a Pull Request to add support for this OS.")
|
message(FATAL_ERROR "Unknown OS found for packaging; please consider creating a Pull Request to add support for this OS.")
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue