aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-12-02 15:56:36 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-12-02 15:56:36 -0500
commit25a4a85a59802d3e437129370945d4b4a662c7b2 (patch)
treeb38201157a52dc222014ae2046461c2312f45db8
parentClarify lock permission consequences (diff)
downloadsway-25a4a85a59802d3e437129370945d4b4a662c7b2.tar.gz
sway-25a4a85a59802d3e437129370945d4b4a662c7b2.tar.zst
sway-25a4a85a59802d3e437129370945d4b4a662c7b2.zip
Run config files through sed and install to /etc
-rw-r--r--config.d/security.in8
-rw-r--r--config.in2
-rw-r--r--sway/CMakeLists.txt30
-rw-r--r--swaylock/CMakeLists.txt2
4 files changed, 31 insertions, 11 deletions
diff --git a/config.d/security.in b/config.d/security.in
index a1efb98f..b5690dc7 100644
--- a/config.d/security.in
+++ b/config.d/security.in
@@ -6,10 +6,10 @@
6# installation. 6# installation.
7 7
8# Configures which programs are allowed to use which sway features 8# Configures which programs are allowed to use which sway features
9permit __PREFIX__/swaylock lock 9permit __PREFIX__/bin/swaylock lock
10permit __PREFIX__/swaybar panel 10permit __PREFIX__/bin/swaybar panel
11permit __PREFIX__/swaybg background 11permit __PREFIX__/bin/swaybg background
12permit __PREFIX__/swaygrab screenshot 12permit __PREFIX__/bin/swaygrab screenshot
13 13
14permit * fullscreen keyboard mouse 14permit * fullscreen keyboard mouse
15 15
diff --git a/config.in b/config.in
index ddd0fec5..3cb0525e 100644
--- a/config.in
+++ b/config.in
@@ -195,4 +195,4 @@ bar {
195 } 195 }
196} 196}
197 197
198include __SYSCONFDIR__/etc/sway/config.d/* 198include __SYSCONFDIR__/sway/config.d/*
diff --git a/sway/CMakeLists.txt b/sway/CMakeLists.txt
index 89388220..15fa1720 100644
--- a/sway/CMakeLists.txt
+++ b/sway/CMakeLists.txt
@@ -63,11 +63,31 @@ install(
63 DESTINATION bin 63 DESTINATION bin
64 COMPONENT runtime 64 COMPONENT runtime
65) 65)
66install( 66
67 FILES ${PROJECT_SOURCE_DIR}/config 67add_custom_target(configs ALL)
68 DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/sway/ 68
69 COMPONENT configuration 69function(add_config name source destination)
70) 70 add_custom_command(
71 OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
72 COMMAND sed -r
73 's?__PREFIX__?${CMAKE_INSTALL_PREFIX}?g\; s?__SYSCONFDIR__?${CMAKE_INSTALL_FULL_SYSCONFDIR}?g'
74 ${PROJECT_SOURCE_DIR}/${source}.in > ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
75 DEPENDS ${PROJECT_SOURCE_DIR}/${source}.in
76 COMMENT "Generating config file ${source}"
77 )
78
79 install(
80 FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
81 DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/${destination}
82 COMPONENT configuration
83 )
84
85 add_custom_target(config-${name} DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name})
86 add_dependencies(configs config-${name})
87endfunction()
88
89add_config(config config sway)
90add_config(security config.d/security sway/config.d)
71 91
72add_manpage(sway 1) 92add_manpage(sway 1)
73add_manpage(sway 5) 93add_manpage(sway 5)
diff --git a/swaylock/CMakeLists.txt b/swaylock/CMakeLists.txt
index febbd1af..4aec6424 100644
--- a/swaylock/CMakeLists.txt
+++ b/swaylock/CMakeLists.txt
@@ -42,7 +42,7 @@ install(
42 42
43install( 43install(
44 FILES ${CMAKE_CURRENT_SOURCE_DIR}/pam/swaylock 44 FILES ${CMAKE_CURRENT_SOURCE_DIR}/pam/swaylock
45 DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/pam.d/ 45 DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d/
46 COMPONENT data 46 COMPONENT data
47) 47)
48 48