From d9d3a82adae632006b6320d716f98f744fa9a481 Mon Sep 17 00:00:00 2001
From: Petr Cerny
Date: Tue, 19 Jan 2016 00:34:20 +0100
Subject: [PATCH 1/4] Conditional build of slimlock and installation of
slimlock.1 man page.
Do not try to build slimlock and install its manual page
if it has been decided earlier not to. Typically this is
the case when PAM is not used.
---
CMakeLists.txt | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f7256bf..02c000b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -221,7 +221,9 @@ endif(BUILD_SLIMLOCK)
####### install
# slim
install(TARGETS slim RUNTIME DESTINATION bin)
-install(TARGETS slimlock RUNTIME DESTINATION bin)
+if(BUILD_SLIMLOCK)
+ install(TARGETS slimlock RUNTIME DESTINATION bin)
+endif(BUILD_SLIMLOCK)
if (BUILD_SHARED_LIBS)
set_target_properties(libslim PROPERTIES
@@ -236,7 +238,9 @@ endif (BUILD_SHARED_LIBS)
# man file
install(FILES slim.1 DESTINATION ${MANDIR}/man1/)
-install(FILES slimlock.1 DESTINATION ${MANDIR}/man1/)
+if(BUILD_SLIMLOCK)
+ install(FILES slimlock.1 DESTINATION ${MANDIR}/man1/)
+endif(BUILD_SLIMLOCK)
# configure
install(FILES slim.conf DESTINATION ${SYSCONFDIR})
# systemd service file
From b12df20a6e07a2128963e19fcff40e43ae3a1f7b Mon Sep 17 00:00:00 2001
From: Petr Cerny
Date: Thu, 21 Jan 2016 00:30:26 +0100
Subject: [PATCH 2/4] New option disabling installation of systemd stuff
Allow not to install systemd related stuff (unit file) on Linux by
setting HAVE_SYSTEMD=no during configuration time.
---
CMakeLists.txt | 10 ++++++++--
INSTALL | 2 ++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02c000b..2472900 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,6 +47,12 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g -O2")
set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -Wall -g -O2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -O2")
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(HAVE_SYSTEMD yes CACHE BOOL "Install systemd related files")
+else()
+ set(HAVE_SYSTEMD no CACHE BOOL "Install systemd related files")
+endif()
+
# source
set(slim_srcs
main.cpp
@@ -244,8 +250,8 @@ endif(BUILD_SLIMLOCK)
# configure
install(FILES slim.conf DESTINATION ${SYSCONFDIR})
# systemd service file
-if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+if(HAVE_SYSTEMD)
install(FILES slim.service DESTINATION ${LIBDIR}/systemd/system)
-endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+endif(HAVE_SYSTEMD)
# themes directory
subdirs(themes)
diff --git a/INSTALL b/INSTALL
index 0196c74..ed659cd 100644
--- a/INSTALL
+++ b/INSTALL
@@ -15,6 +15,8 @@ INSTALL file for SLiM
or
- mkdir build ; cd build ; cmake .. -DUSE_CONSOLEKIT=yes
to enable CONSOLEKIT support
+ - mkdir build ; cd build ; cmake .. -DHAVE_SYSTEMD=no
+ to prevent installation of systemd related stuff (unit file)
- make && make install
2. automatic startup
From d8f98a81116f0572d210ed5dcf5a856b63c8da58 Mon Sep 17 00:00:00 2001
From: Petr Cerny
Date: Fri, 22 Jan 2016 00:47:19 +0100
Subject: [PATCH 3/4] Better systemd variable description
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2472900..0d8d3cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,7 +50,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -O2")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(HAVE_SYSTEMD yes CACHE BOOL "Install systemd related files")
else()
- set(HAVE_SYSTEMD no CACHE BOOL "Install systemd related files")
+ set(HAVE_SYSTEMD no CACHE BOOL "Do not install systemd related files")
endif()
# source
From 8400244e2fd92a1257dcd02e82617a24ef4037be Mon Sep 17 00:00:00 2001
From: Petr Cerny
Date: Fri, 22 Jan 2016 00:48:10 +0100
Subject: [PATCH 4/4] Report whether systemd files will be installed
---
CMakeLists.txt | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0d8d3cb..d6ca9d4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -162,6 +162,13 @@ else(USE_CONSOLEKIT)
message("\tConsoleKit disabled")
endif(USE_CONSOLEKIT)
+# systemd
+if(HAVE_SYSTEMD)
+ message("\tInstall systemd files")
+else(HAVE_SYSTEMD)
+ message("\tDo not install systemd files")
+endif(HAVE_SYSTEMD)
+
# system librarys
find_library(M_LIB m)
find_library(RT_LIB rt)