sci-mathematics/rstudio: install systemd service unit for rstudio-server into proper...
authorMatthew Brewer <tomboy64@sina.cn>
Fri, 29 Jan 2016 04:17:47 +0000 (05:17 +0100)
committerMatthew Brewer <tomboy64@sina.cn>
Fri, 29 Jan 2016 04:17:47 +0000 (05:17 +0100)
Package-Manager: portage-2.2.26
RepoMan-Options: --ignore-arches

sci-mathematics/rstudio/files/rstudio-0.99.486-systemd.patch [new file with mode: 0644]
sci-mathematics/rstudio/files/rstudio-server.service.in [new file with mode: 0644]
sci-mathematics/rstudio/rstudio-0.99.486-r1.ebuild [moved from sci-mathematics/rstudio/rstudio-0.99.486.ebuild with 96% similarity]

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 (file)
index 0000000..4c7eda3
--- /dev/null
@@ -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 (file)
index 0000000..fb3e373
--- /dev/null
@@ -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
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 3682c5ca0fd0b773f26bb06db465f00147bb55e6..c5b11ff7433940b2e549f806cd564b1cff9d5dfe 100644 (file)
@@ -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