1
0

set install paths and files for the system config

* if not run_in_place is defined. install daemon files and
  assume the path of PREFIX/usr/games for binary lauchers,
  not PREFIX/usr/bin
* use FHS as https://www.pathname.com/fhs/2.2/fhs-4.11.html
  that defines the right place for game data files as in the
  path of PREFIX/usr/share/games
* install all the daemons files for openrc, sysvinit and shitstemd
* install defaults and config files as default for daemon scripts
This commit is contained in:
mckaygerhard 2024-06-03 13:51:09 -04:00
parent acbd75d2bc
commit b3eae2dd81
3 changed files with 18 additions and 10 deletions

View File

@ -13,11 +13,9 @@ stages:
script:
- mkdir cmakebuild
- mkdir -p artifact/multicraft/usr/
# - mkdir -p games
# - cd games
# - git clone -b stable-5.2 --single-branch https://codeberg.org/minenux/minetest-game-minetest minetest
- cd cmakebuild
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/multicraft/usr/ -DBUILD_SERVER=ON -DBUILD_CLIENT=ON -DRUN_IN_PLACE=OFF -DENABLE_CURL=ON -DENABLE_SOUND=ON -DENABLE_LUAJIT=ON -DENABLE_GETTEXT=ON -DENABLE_FREETYPE=ON -DENABLE_SYSTEM_GMP=ON -DENABLE_SYSTEM_JSONCPP=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_POSTGRESQL=ON ..
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/multicraft/usr/ -DBUILD_SERVER=ON -DBUILD_CLIENT=ON -DENABLE_CURL=ON -DENABLE_SOUND=ON -DENABLE_LUAJIT=ON -DENABLE_GETTEXT=ON -DENABLE_FREETYPE=ON -DENABLE_SYSTEM_GMP=ON -DENABLE_SYSTEM_JSONCPP=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_POSTGRESQL=ON \
-DRUN_IN_PLACE=OFF -DCUSTOM_BINDIR=/usr/games -DCUSTOM_LOCALEDIR=/usr/share/locale -DCUSTOM_SHAREDIR=/usr/share/games/multicraft -DCUSTOM_EXAMPLE_CONF_DIR=/etc/multicraft ..
- make -j$(nproc)
- make install
artifacts:

View File

@ -130,11 +130,11 @@ elseif(UNIX) # Linux, BSD etc
set(ICONDIR "unix/icons")
set(LOCALEDIR "locale")
else()
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}")
set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share")
set(BINDIR "${CMAKE_INSTALL_PREFIX}/games")
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
set(EXAMPLE_CONF_DIR ${DOCDIR})
set(EXAMPLE_CONF_DIR "${CMAKE_INSTALL_PREFIX}/../etc/${PROJECT_NAME}")
set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/metainfo")
set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
@ -157,8 +157,8 @@ endif()
set(CUSTOM_DOCDIR "" CACHE STRING "Directory to install documentation into")
if(NOT CUSTOM_DOCDIR STREQUAL "")
set(DOCDIR "${CUSTOM_DOCDIR}")
if(NOT RUN_IN_PLACE)
set(EXAMPLE_CONF_DIR ${DOCDIR})
if(RUN_IN_PLACE)
set(EXAMPLE_CONF_DIR ".")
endif()
message(STATUS "Using DOCDIR=${DOCDIR}")
endif()
@ -221,7 +221,7 @@ install(FILES "doc/client_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/menu_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/texture_packs.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/world_format.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "multicraft.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
install(FILES "multicraft.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}" RENAME "${PROJECT_NAME}.conf")
if(UNIX AND NOT APPLE)
install(FILES "doc/minetest.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}.6")
@ -232,6 +232,15 @@ if(UNIX AND NOT APPLE)
install(FILES "misc/multicraft-xorg-icon-128.png"
DESTINATION "${ICONDIR}/hicolor/128x128/apps"
RENAME "multicraft.png")
install(FILES "doc/multicraftserver.confd" DESTINATION "${EXAMPLE_CONF_DIR}/conf.d" RENAME "${PROJECT_NAME}server")
install(FILES "doc/multicraftserver.defaults" DESTINATION "${EXAMPLE_CONF_DIR}/defaults" RENAME "${PROJECT_NAME}server")
if(NOT RUN_IN_PLACE)
install(FILES "doc/multicraftserver.init" DESTINATION "${CMAKE_INSTALL_PREFIX}/etc/init.d" RENAME "${PROJECT_NAME}server")
install(FILES "doc/multicraftserver.initd" DESTINATION "${CMAKE_INSTALL_PREFIX}/etc/init.d" RENAME "${PROJECT_NAME}server")
install(FILES "doc/multicraftserver.service" DESTINATION "${CMAKE_INSTALL_PREFIX}/usr/lib/systemd/system")
install(FILES "doc/multicraftserver@.service" DESTINATION "${CMAKE_INSTALL_PREFIX}/usr/lib/systemd/system")
install(FILES "doc/multicraftserver.logrotate" DESTINATION "${CMAKE_INSTALL_PREFIX}/etc/logrotate.d/" RENAME "${PROJECT_NAME}server")
endif()
endif()
if(APPLE)

View File

@ -1,4 +1,5 @@
# DEB/RPM based server default distro config file
# for apk place as /etc/conf.d/multicraftserver
# for deb place as /etc/defaults/multicraftserver
# for rpm place as /etc/sysconfig/multicraftserver
USER="multicraft"