aboutsummaryrefslogtreecommitdiff
path: root/science/orthanc/files
diff options
context:
space:
mode:
authorFrank Scholl <maintainer.freebsd@xpoundit.com>2021-06-08 18:15:17 +0000
committerGuangyuan Yang <ygy@FreeBSD.org>2021-06-08 18:15:17 +0000
commitd0359493ee0443e596be74b336ea12e6db936a01 (patch)
tree75bf0d8c1db8c38f12ac8515342349eb29c6755c /science/orthanc/files
parent09987004c64756fca35fa88dc6d7ea83c000f0c3 (diff)
downloadports-d0359493ee0443e596be74b336ea12e6db936a01.tar.gz
ports-d0359493ee0443e596be74b336ea12e6db936a01.zip
Diffstat (limited to 'science/orthanc/files')
-rw-r--r--science/orthanc/files/orthanc.in40
-rw-r--r--science/orthanc/files/patch-OrthancFramework_Resources_CMake_CivetwebConfiguration.cmake64
-rw-r--r--science/orthanc/files/patch-OrthancServer_Resources_Configuration.json25
3 files changed, 129 insertions, 0 deletions
diff --git a/science/orthanc/files/orthanc.in b/science/orthanc/files/orthanc.in
new file mode 100644
index 000000000000..85d6af45d8a1
--- /dev/null
+++ b/science/orthanc/files/orthanc.in
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: orthanc
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# orthanc_enable (bool): Set to NO by default.
+# Set it to YES to enable Orthanc.
+# orthanc_flags (str): Set to %%ETCDIR%%/orthanc.json
+# by default.
+
+. /etc/rc.subr
+
+name=orthanc
+rcvar=orthanc_enable
+desc="Lightweight DICOM server for healthcare and medical research"
+
+load_rc_config $name
+
+: ${orthanc_enable:=NO}
+: ${orthanc_flags="%%ETCDIR%%/orthanc.json"}
+
+start_precmd=orthanc_prestart
+pidfile=/var/run/orthanc.pid
+procname=%%PREFIX%%/sbin/Orthanc
+command=/usr/sbin/daemon
+command_args=" -f -p ${pidfile} -u orthanc ${procname} ${orthanc_flags}"
+
+orthanc_prestart()
+{
+ # Have to empty rc_flags so they don't get passed to daemon(8)
+ rc_flags=""
+}
+
+run_rc_command "$1"
diff --git a/science/orthanc/files/patch-OrthancFramework_Resources_CMake_CivetwebConfiguration.cmake b/science/orthanc/files/patch-OrthancFramework_Resources_CMake_CivetwebConfiguration.cmake
new file mode 100644
index 000000000000..b1cd8bd06165
--- /dev/null
+++ b/science/orthanc/files/patch-OrthancFramework_Resources_CMake_CivetwebConfiguration.cmake
@@ -0,0 +1,64 @@
+--- OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake.orig 2021-05-12 13:54:35 UTC
++++ OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake
+@@ -98,32 +98,38 @@ else()
+
+ cmake_reset_check_state()
+ set(CMAKE_REQUIRED_LIBRARIES dl pthread)
+- CHECK_LIBRARY_EXISTS(civetweb mg_start "" HAVE_CIVETWEB_LIB)
+- if (NOT HAVE_CIVETWEB_LIB)
+- message(FATAL_ERROR "Please install the libcivetweb-dev package")
+- endif()
+
+- link_libraries(civetweb)
++ find_library(CIVETWEB_LIB NAMES civetweb PATHS
++ /usr/lib
++ /usr/local/lib
++ )
+
+- # Check whether the system distribution of civetweb contains the
+- # patch "../Patches/civetweb-1.13.patch" that allows to disable
+- # keep-alive on selected HTTP connections. This is useful to speed
+- # up multipart transfers, as encountered in DICOMweb.
+- CHECK_LIBRARY_EXISTS(civetweb mg_disable_keep_alive "" CIVETWEB_HAS_DISABLE_KEEP_ALIVE_1) # From "../Patches/civetweb-1.13.patch"
+- CHECK_LIBRARY_EXISTS(civetweb mg_disable_connection_keep_alive "" CIVETWEB_HAS_DISABLE_KEEP_ALIVE_2) # From civetweb >= 1.14
+- if (CIVETWEB_HAS_DISABLE_KEEP_ALIVE_1 OR
+- CIVETWEB_HAS_DISABLE_KEEP_ALIVE_2)
+- add_definitions(
+- -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=1
+- -DCIVETWEB_HAS_WEBDAV_WRITING=1
+- )
+- message("Performance: Your system-wide distribution of civetweb is configured for best performance")
++ if (CIVETWEB_LIB)
++ CHECK_LIBRARY_EXISTS(${CIVETWEB_LIB} mg_start "" HAVE_CIVETWEB_LIB)
++ if (NOT HAVE_CIVETWEB_LIB)
++ message(FATAL_ERROR "Unable to use mg_start from civetweb library")
++ endif()
++
++ CHECK_LIBRARY_EXISTS(${CIVETWEB_LIB} mg_disable_keep_alive "" CIVETWEB_HAS_DISABLE_KEEP_ALIVE)
++ if (CIVETWEB_HAS_DISABLE_KEEP_ALIVE)
++ add_definitions(
++ -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=1
++ -DCIVETWEB_HAS_WEBDAV_WRITING=1
++ )
++ message("Performance: Your system-wide distribution of civetweb is configured for best performance")
++ else()
++ message(WARNING "Performance: Your system-wide distribution of civetweb does not feature the mg_disable_keep_alive() function, and WebDAV will only be available for read-only access")
++ add_definitions(
++ -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=0
++ -DCIVETWEB_HAS_WEBDAV_WRITING=0
++ )
++ endif()
++
++ get_filename_component(CIVETWEB_LIB_PATH ${CIVETWEB_LIB} DIRECTORY)
++ link_directories(${CIVETWEB_LIB_PATH})
++ link_libraries(civetweb)
+ else()
+- message(WARNING "Performance: Your system-wide distribution of civetweb does not feature the mg_disable_keep_alive() function, and WebDAV will only be available for read-only access")
+- add_definitions(
+- -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=0
+- -DCIVETWEB_HAS_WEBDAV_WRITING=0
+- )
++ message(FATAL_ERROR "Unable to find the civetweb library")
+ endif()
+
+ unset(CMAKE_REQUIRED_LIBRARIES) # This reset must be after "CHECK_LIBRARY_EXISTS"
diff --git a/science/orthanc/files/patch-OrthancServer_Resources_Configuration.json b/science/orthanc/files/patch-OrthancServer_Resources_Configuration.json
new file mode 100644
index 000000000000..91f978822db2
--- /dev/null
+++ b/science/orthanc/files/patch-OrthancServer_Resources_Configuration.json
@@ -0,0 +1,25 @@
+--- OrthancServer/Resources/Configuration.json.orig 2021-01-29 09:36:16 UTC
++++ OrthancServer/Resources/Configuration.json
+@@ -10,12 +10,12 @@
+ // Path to the directory that holds the heavyweight files (i.e. the
+ // raw DICOM instances). Backslashes must be either escaped by
+ // doubling them, or replaced by forward slashes "/".
+- "StorageDirectory" : "OrthancStorage",
++ "StorageDirectory" : "/var/db/orthanc/db-v5",
+
+ // Path to the directory that holds the SQLite index (if unset, the
+ // value of StorageDirectory is used). This index could be stored on
+ // a RAM-drive or a SSD device for performance reasons.
+- "IndexDirectory" : "OrthancStorage",
++ "IndexDirectory" : "/var/db/orthanc/db-v5",
+
+ // Path to the directory where Orthanc stores its large temporary
+ // files. The content of this folder can be safely deleted once
+@@ -53,6 +53,7 @@
+ // find shared libraries. Backslashes must be either escaped by
+ // doubling them, or replaced by forward slashes "/".
+ "Plugins" : [
++ "%%PREFIX%%/share/orthanc/plugins/"
+ ],
+
+ // Maximum number of processing jobs that are simultaneously running