File tree Expand file tree Collapse file tree 7 files changed +44
-17
lines changed Expand file tree Collapse file tree 7 files changed +44
-17
lines changed Original file line number Diff line number Diff line change 4848 run : |
4949 mv ${{github.workspace}}/build/ydotool ${{github.workspace}}/build/ydotool-${{matrix.os}}
5050 mv ${{github.workspace}}/build/ydotoold ${{github.workspace}}/build/ydotoold-${{matrix.os}}
51+ mv ${{github.workspace}}/build/ydotoold.service ${{github.workspace}}/build/ydotoold-${{matrix.os}}.service
5152
5253 - name : Archive production artifacts
5354 uses : actions/upload-artifact@v4
5657 path : |
5758 ${{github.workspace}}/build/ydotool-${{matrix.os}}
5859 ${{github.workspace}}/build/ydotoold-${{matrix.os}}
60+ ${{github.workspace}}/build/ydotoold-${{matrix.os}}.service
5961
Original file line number Diff line number Diff line change @@ -6,16 +6,6 @@ set(CMAKE_C_STANDARD 11)
66# Include GNU install directory module to detect where to install
77# files on Linux/Unix systems (e.g., lib vs lib64)
88include (GNUInstallDirs)
9- find_package (PkgConfig)
10-
11- # Try to get the systemd directory for user units from the package
12- # and fall back on upstream default without the '/usr' prefix
13- pkg_check_modules(SYSTEMD systemd)
14- if (SYSTEMD_FOUND)
15- pkg_get_variable(SD_UNITDIR systemd systemduserunitdir)
16- else ()
17- set (SD_UNITDIR "lib/systemd/user" )
18- endif ()
199
2010execute_process (COMMAND git describe --tags --long --always RESULT_VARIABLE RC_GIT_VER OUTPUT_VARIABLE GIT_VERSION)
2111
Original file line number Diff line number Diff line change 1- configure_file (
2- "${CMAKE_CURRENT_SOURCE_DIR} /ydotoold.service.in"
3- "${PROJECT_BINARY_DIR} /ydotoold.service"
4- @ONLY)
5- install (FILES "${PROJECT_BINARY_DIR} /ydotoold.service" DESTINATION ${SD_UNITDIR} )
1+ option (SYSTEMD_USER_SERVICE "Install systemd user service file" ON )
2+ option (SYSTEMD_SYSTEM_SERVICE "Install systemd system service file" OFF )
3+ option (OPENRC "Install OpenRC service file" OFF ) # To be implemented
4+
5+ if (SYSTEMD_USER_SERVICE AND SYSTEMD_SYSTEM_SERVICE)
6+ message (FATAL_ERROR "Both system and user services are enabled. Choose one." )
7+ endif ()
8+
9+ if (SYSTEMD_USER_SERVICE OR SYSTEMD_SYSTEM_SERVICE)
10+ add_subdirectory (systemd)
11+ endif ()
12+
13+ if (OPENRC)
14+ add_subdirectory (openrc)
15+ endif ()
Original file line number Diff line number Diff line change 1+ # TBD
File renamed without changes.
Original file line number Diff line number Diff line change 1+ find_package (PkgConfig)
2+
3+ # Try to get the systemd directory for system/user units from the package
4+ # and fall back on upstream default without the '/usr' prefix if not forced by
5+ # command line.
6+ pkg_check_modules(SYSTEMD systemd)
7+ if (SYSTEMD_FOUND)
8+ if (SYSTEMD_USER_SERVICE)
9+ pkg_get_variable(SD_UNITDIR systemd systemduserunitdir)
10+ elseif (SYSTEMD_SYSTEM_SERVICE)
11+ pkg_get_variable(SD_UNITDIR systemd systemdsystemunitdir)
12+ endif ()
13+ endif ()
14+
15+ if (NOT DEFINED SD_UNITDIR)
16+ set (SD_UNITDIR "lib/systemd/user" )
17+ endif ()
18+
19+ message ("Systemd service file is going to be installed at ${SD_UNITDIR} " )
20+
21+ configure_file (
22+ "${CMAKE_CURRENT_SOURCE_DIR} /ydotoold.service.in"
23+ "${PROJECT_BINARY_DIR} /ydotoold.service"
24+ @ONLY)
25+ install (FILES "${PROJECT_BINARY_DIR} /ydotoold.service" DESTINATION ${SD_UNITDIR} )
Original file line number Diff line number Diff line change 11[Unit]
2- Description=Starts ydotoold user service
2+ Description=Starts ydotoold Daemon
33
44[Service]
55Type=simple
@@ -13,4 +13,3 @@ TimeoutSec=180
1313
1414[Install]
1515WantedBy=basic.target
16-
You can’t perform that action at this time.
0 commit comments