From bfac7bc397e2636201aa0fd2ec4c3862ecfb0a6c Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Mon, 14 May 2018 21:09:23 +0300 Subject: [PATCH] CMakeLists: Allow passing in the systemd unit dir This is now necessary on centos, where /lib is a symlink to /usr/lib --- CMakeLists.txt | 3 ++- docker-build-centos.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27582dd..64f2d59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,7 @@ if(BUILD_TESTS) target_link_libraries(laminar-tests ${GTEST_BOTH_LIBRARIES} gmock capnp-rpc capnp kj-async kj pthread boost_filesystem boost_system sqlite3 z) endif() +set(SYSTEMD_UNITDIR /lib/systemd/system CACHE PATH "Path to systemd unit files") install(TARGETS laminard laminarc RUNTIME DESTINATION usr/bin) -install(FILES laminar.service DESTINATION lib/systemd/system) +install(FILES laminar.service DESTINATION ${SYSTEMD_UNITDIR}) install(FILES laminar.conf DESTINATION etc) diff --git a/docker-build-centos.sh b/docker-build-centos.sh index cc59415..e782a51 100755 --- a/docker-build-centos.sh +++ b/docker-build-centos.sh @@ -56,7 +56,7 @@ Lightweight Continuous Integration Service %prep %build -cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ %{_sourcedir}/laminar-$VERSION +cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ -DSYSTEMD_UNITDIR=%{_unitdir} %{_sourcedir}/laminar-$VERSION pwd make