commit:     53d873715b54186cbcced5c32bfdd8380a4a1508
Author:     Matthew Brewer <tomboy64 <AT> sina <DOT> cn>
AuthorDate: Fri Jan 29 04:17:47 2016 +0000
Commit:     Mark Wright <gienah <AT> gentoo <DOT> org>
CommitDate: Fri Jan 29 04:17:47 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53d87371

sci-mathematics/rstudio: install systemd service unit for rstudio-server into 
proper directory (bug #534152)

Package-Manager: portage-2.2.26
RepoMan-Options: --ignore-arches

 .../rstudio/files/rstudio-0.99.486-systemd.patch   | 22 ++++++++++++++++++++++
 .../rstudio/files/rstudio-server.service.in        | 10 ++++++++++
 ...-0.99.486.ebuild => rstudio-0.99.486-r1.ebuild} |  7 ++++++-
 3 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/sci-mathematics/rstudio/files/rstudio-0.99.486-systemd.patch 
b/sci-mathematics/rstudio/files/rstudio-0.99.486-systemd.patch
new file mode 100644
index 0000000..4c7eda3
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-0.99.486-systemd.patch
@@ -0,0 +1,22 @@
+diff -Naur 
/tmp/rstudio.org/work/rstudio-0.99.486/src/cpp/server/CMakeLists.txt 
./work/rstudio-0.99.486/src/cpp/server/CMakeLists.txt
+--- /tmp/rstudio.org/work/rstudio-0.99.486/src/cpp/server/CMakeLists.txt       
2015-12-10 19:29:24.408267862 +0100
++++ ./work/rstudio-0.99.486/src/cpp/server/CMakeLists.txt      2015-12-10 
19:35:24.660194216 +0100
+@@ -208,17 +208,12 @@
+            DESTINATION ${DISTRO_SHARE}/${RSERVER_UPSTART_DIR})
+            
+     # install configured systemd profile
+-   set(RSERVER_SYSTEMD_DIR "extras/systemd")
++   set(RSERVER_SYSTEMD_DIR "lib/systemd/system")
+    set(RSERVER_SYSTEMD_PROFILE 
"${RSERVER_SYSTEMD_DIR}/rstudio-server.service")
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_SYSTEMD_PROFILE}.in
+                   ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_SYSTEMD_PROFILE})
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_SYSTEMD_PROFILE}
+            DESTINATION ${RSERVER_SYSTEMD_DIR})
+-   set(RSERVER_SYSTEMD_PROFILE_REDHAT 
"${RSERVER_SYSTEMD_DIR}/rstudio-server.redhat.service")
+-   
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_SYSTEMD_PROFILE_REDHAT}.in
+-                  
${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_SYSTEMD_PROFILE_REDHAT})
+-   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_SYSTEMD_PROFILE_REDHAT}
+-           DESTINATION ${RSERVER_SYSTEMD_DIR})
+ 
+ endif()
+ 

diff --git a/sci-mathematics/rstudio/files/rstudio-server.service.in 
b/sci-mathematics/rstudio/files/rstudio-server.service.in
new file mode 100644
index 0000000..fb3e373
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-server.service.in
@@ -0,0 +1,10 @@
+[Unit]
+Description=RStudio Server
+
+[Service]
+Type=forking
+ExecStart=${CMAKE_INSTALL_PREFIX}/bin/rserver
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target

diff --git a/sci-mathematics/rstudio/rstudio-0.99.486.ebuild 
b/sci-mathematics/rstudio/rstudio-0.99.486-r1.ebuild
similarity index 96%
rename from sci-mathematics/rstudio/rstudio-0.99.486.ebuild
rename to sci-mathematics/rstudio/rstudio-0.99.486-r1.ebuild
index 3682c5c..c5b11ff 100644
--- a/sci-mathematics/rstudio/rstudio-0.99.486.ebuild
+++ b/sci-mathematics/rstudio/rstudio-0.99.486-r1.ebuild
@@ -130,7 +130,12 @@ src_prepare() {
                "${FILESDIR}"/${PN}-0.99.473-clang-pandoc.patch \
                "${FILESDIR}"/${PN}-0.98.490-linker_flags.patch \
                "${FILESDIR}"/${PN}-0.98.1091-boost-1.57.patch \
-               "${FILESDIR}"/${PN}-0.99.473-qtsingleapplication.patch
+               "${FILESDIR}"/${PN}-0.99.473-qtsingleapplication.patch \
+               "${FILESDIR}"/${PN}-0.99.486-systemd.patch
+
+       # Enable CMake to install our .service file for systemd usage
+       mkdir -vp "${S}/src/cpp/server/lib/systemd/system" || die
+       cp -v "${FILESDIR}/rstudio-server.service.in" 
"${S}/src/cpp/server/lib/systemd/system/" || die
 
        # Adding -DDISTRO_SHARE=... to append-flags breaks cmake so using
        # this sed hack for now. ~RMH

Reply via email to