From bcb3e25912d578fb90fef30b396863a26e396a3c4ba41937310484c4c51aa444 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Thu, 31 Oct 2019 10:35:36 +0000 Subject: [PATCH] Accepting request 740978 from home:DocB:Orthanc New version and additional specfile cleanup. No info about multibuild from ML, wiki or schwab@suse.de for more than a week. I do not consider this as path forward, as it adds complexity as well, compared to modular approach. OBS-URL: https://build.opensuse.org/request/show/740978 OBS-URL: https://build.opensuse.org/package/show/graphics/orthanc?expand=0&rev=1 --- .gitattributes | 23 ++++ .gitignore | 1 + Orthanc-1.5.8.tar.gz | 3 + _service | 4 + index.html | 12 ++ orthanc-1.4.2-lib64.patch | 36 ++++++ orthanc-readme.SUSE | 32 +++++ orthanc.changes | 53 ++++++++ orthanc.service | 13 ++ orthanc.spec | 246 ++++++++++++++++++++++++++++++++++++++ serve-folders.json | 15 +++ worklists.json | 12 ++ 12 files changed, 450 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Orthanc-1.5.8.tar.gz create mode 100644 _service create mode 100644 index.html create mode 100644 orthanc-1.4.2-lib64.patch create mode 100644 orthanc-readme.SUSE create mode 100644 orthanc.changes create mode 100644 orthanc.service create mode 100644 orthanc.spec create mode 100644 serve-folders.json create mode 100644 worklists.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Orthanc-1.5.8.tar.gz b/Orthanc-1.5.8.tar.gz new file mode 100644 index 0000000..507eeb9 --- /dev/null +++ b/Orthanc-1.5.8.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da8aa4ce6e6942c8190e3910a595ee36555ed002e75c151395705bee25b73836 +size 1561300 diff --git a/_service b/_service new file mode 100644 index 0000000..dbfc161 --- /dev/null +++ b/_service @@ -0,0 +1,4 @@ + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..9b87884 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + +

Index of the Orthanc documentation

+ + + + diff --git a/orthanc-1.4.2-lib64.patch b/orthanc-1.4.2-lib64.patch new file mode 100644 index 0000000..1a4fddd --- /dev/null +++ b/orthanc-1.4.2-lib64.patch @@ -0,0 +1,36 @@ +--- CMakeLists.txt.orig 2018-09-20 17:32:11.538015844 +0200 ++++ CMakeLists.txt 2018-09-20 17:33:08.413928827 +0200 +@@ -361,11 +361,11 @@ + SOVERSION ${ORTHANC_VERSION} + ) + +- install( +- TARGETS ServeFolders +- RUNTIME DESTINATION lib # Destination for Windows +- LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux +- ) ++ if (${CMAKE_SIZEOF_VOID_P} EQUAL 4) ++ install(TARGETS ServeFolders LIBRARY DESTINATION lib) ++ else() ++ install(TARGETS ServeFolders LIBRARY DESTINATION lib64) ++ endif() + endif() + + +@@ -406,11 +406,11 @@ + SOVERSION ${ORTHANC_VERSION} + ) + +- install( +- TARGETS ModalityWorklists +- RUNTIME DESTINATION lib # Destination for Windows +- LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux +- ) ++ if (${CMAKE_SIZEOF_VOID_P} EQUAL 4) ++ install(TARGETS ModalityWorklists LIBRARY DESTINATION lib) ++ else() ++ install(TARGETS ModalityWorklists LIBRARY DESTINATION lib64) ++ endif() + endif() + + diff --git a/orthanc-readme.SUSE b/orthanc-readme.SUSE new file mode 100644 index 0000000..433d49c --- /dev/null +++ b/orthanc-readme.SUSE @@ -0,0 +1,32 @@ +README: Orthanc for openSUSE +============================ + +Orthanc is a RESTful DICOM server for healthcare and medical research. +This package provides the server for Orthanc (you may want to check for plugins as well) + +Configuration files for Orthanc are in +/etc/orthanc +Configuration files are in JSON format. Orthanc reads all files in the configuration folder to build up its internal setup. + +Starting/stopping Orthanc +Orthanc comes as systemd-service. so you can start it with: +systemctl start orthanc +To stop it: +systemctl stop orthanc +To check it: +systemctl status orthanc + +To enable it at system start: +systemctl enable orthanc + +Once orthanc is running, you can use +http://localhost:8042 +to connect. + +For any 'outside connection', the use of SSL certificates is recommended! + +Further documentation: +https://book.orthanc-server.com/ + +Have fun +Axel Braun Tue Aug 13 08:06:42 UTC 2019 diff --git a/orthanc.changes b/orthanc.changes new file mode 100644 index 0000000..e38df20 --- /dev/null +++ b/orthanc.changes @@ -0,0 +1,53 @@ +------------------------------------------------------------------- +Thu Oct 17 00:02:56 UTC 2019 - Axel Braun + +- version 1.5.8 + * various bugfixes, see NEWS for details + +------------------------------------------------------------------- +Tue Aug 13 08:06:42 UTC 2019 - Axel Braun + +- version 1.5.7 + * Documentation added + +------------------------------------------------------------------- +Mon Feb 25 17:30:32 UTC 2019 - Axel Braun + +- version 1.5.5 + +------------------------------------------------------------------- +Fri Feb 8 16:17:54 UTC 2019 - Axel Braun + +- version 1.5.4 + civetweb.patch removed + various bugfixes + +------------------------------------------------------------------- +Wed Jan 30 15:55:39 UTC 2019 - axel.braun@gmx.de + +- civetweb.patch added + +------------------------------------------------------------------- +Tue Jan 29 19:35:06 UTC 2019 - Axel Braun + +- version 1.5.3 + * New configuration option: "SaveJobs" to specify whether jobs are stored in the database + * Don't return tags whose group is below 0x0008 in C-FIND SCP answers + * Fix compatibility with DICOMweb plugin (allow multipart answers over HTTP Keep-Alive) + * Fix issue #73 (/modalities/{modalityId}/store raises 500 errors instead of 404) + * Fix issue #90 (C-Find shall match missing tags to null/empty string) + * Fix issue #119 (/patients/.../archive returns a 500 when JobsHistorySize is 0) + * Fix issue #128 (Asynchronous C-MOVE: invalid number of remaining sub-operations) + +------------------------------------------------------------------- +Tue Jan 22 12:36:58 UTC 2019 - Axel Braun + +- version 1.5.2 + temporary fixes for civetweb 1.11 removed + +------------------------------------------------------------------- +Sat Dec 22 16:41:25 UTC 2018 - Axel Braun + +- Version 1.5.1 + Initial OBS build + spec file adapted from Fedora project diff --git a/orthanc.service b/orthanc.service new file mode 100644 index 0000000..eec864b --- /dev/null +++ b/orthanc.service @@ -0,0 +1,13 @@ +[Unit] +Description=Orthanc DICOM server +Documentation=man:orthanc(1) http://www.orthanc-server.com/ +After=syslog.target network.target + +[Service] +Type=simple +User=orthanc +Group=orthanc +ExecStart=/usr/sbin/orthanc /etc/orthanc/ + +[Install] +WantedBy=multi-user.target diff --git a/orthanc.spec b/orthanc.spec new file mode 100644 index 0000000..9fc28bd --- /dev/null +++ b/orthanc.spec @@ -0,0 +1,246 @@ +# +# spec file for package orthanc +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 Dr. Axel Braun +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + +Name: orthanc +Version: 1.5.8 +Release: 0 +Summary: RESTful DICOM server for healthcare and medical research +Group: Productivity/Graphics/Visualization/Other +License: GPL-3.0-or-later-with-openvpn-openssl-exception +URL: http://www.orthanc-server.com/ +Source0: http://www.orthanc-server.com/downloads/get.php?path=/orthanc/Orthanc-%{version}.tar.gz +Source1: orthanc.service +Source2: orthanc-readme.SUSE +Source3: serve-folders.json +Source4: worklists.json +Source5: index.html + +BuildRequires: civetweb-devel +BuildRequires: cmake >= 2.8.0 +BuildRequires: curl-devel +BuildRequires: dcmtk +BuildRequires: dcmtk-devel +BuildRequires: doxygen +BuildRequires: gcc-c++ +BuildRequires: googletest-devel +BuildRequires: help2man +BuildRequires: jsoncpp-devel +BuildRequires: libboost_date_time-devel >= 1.66 +BuildRequires: libboost_filesystem-devel >= 1.66 +BuildRequires: libboost_locale-devel >= 1.66 +BuildRequires: libboost_regex-devel >= 1.66 +BuildRequires: libboost_system-devel >= 1.66 +BuildRequires: libboost_thread-devel >= 1.66 +BuildRequires: libjpeg-devel +BuildRequires: libpng-devel +BuildRequires: libtiff-devel +BuildRequires: libuuid-devel +BuildRequires: libwrap0 +BuildRequires: libxml2-devel +BuildRequires: openssl-devel +BuildRequires: pkgconfig(icu-uc) +BuildRequires: pkgconfig(lua5.1) +BuildRequires: pugixml-devel +BuildRequires: sqlite3-devel +BuildRequires: systemd +BuildRequires: tcpd-devel +BuildRequires: unzip + +Requires: dcmtk + +%{?systemd_requires} + +%description +Orthanc aims at providing a simple, yet powerful standalone DICOM server. +Orthanc can turn any computer running Windows or Linux into a DICOM store +(in other words, a mini-PACS system). Its architecture is lightweight, +meaning that no complex database administration is required, nor the +installation of third-party dependencies. What makes Orthanc unique +is the fact that it provides a RESTful API. Thanks to this major +feature, it is possible to drive Orthanc from any computer language. + +The DICOM tags of the stored medical images can be downloaded in the +JSON file format. Furthermore, standard PNG images can be generated +on-the-fly from the DICOM instances by Orthanc. Orthanc lets its +users focus on the content of the DICOM files, hiding the complexity +of the DICOM format and of the DICOM protocol. + +%package -n %{name}-devel +Summary: Header and source files for creating Orthanc plugins +Group: Development/Libraries/C and C++ +Provides: orthanc-static = %{version}-%{release} + +%description -n %{name}-devel +This package includes the header files to develop C/C++ plugins for Orthanc. + +%package -n %{name}-doc +Summary: Documentation files for Orthanc +Group: Productivity/Graphics/Visualization/Other +BuildArch: noarch + +%description -n %{name}-doc +This package includes the documentation and the sample codes available +for Orthanc. +It also includes the documentation to develop C/C++ plugins for Orthanc. + +%package source +Summary: This package includes the source files for Orthanc +Group: Development/Sources + +%description source +This package includes the source files for Orthanc + +%prep +%setup -q -n Orthanc-%{version} + +cp %{S:1} %{S:2} . + +%build +%cmake .. \ + -DSTANDALONE_BUILD:BOOL=ON \ + -DSTATIC_BUILD:BOOL=OFF \ + -DENABLE_CIVETWEB=ON \ + -DUSE_SYSTEM_MONGOOSE=OFF \ + -DSYSTEM_MONGOOSE_USE_CALLBACKS=OFF \ + -DUNIT_TESTS_WITH_HTTP_CONNEXIONS=OFF \ + -DBoost_NO_BOOST_CMAKE=ON + +%cmake_build %{?_smp_mflags} + +# Generate the man page +help2man ./Orthanc -N -n "Lightweight, RESTful DICOM server for healthcare and medical research" > %{name}.1 + +%check +# but only with architecture "aarch64" +build/UnitTests --gtest_filter=-PngWriter.ColorPattern + +%install +# install: make some dirs... +mkdir -p -m 755 %{buildroot} +mkdir -p -m 755 %{buildroot}%{_sysconfdir}/%{name} +mkdir -p -m 755 %{buildroot}%{_unitdir} +mkdir -p -m 755 %{buildroot}%{_initddir} +mkdir -p -m 755 %{buildroot}%{_bindir} +mkdir -p -m 755 %{buildroot}%{_sbindir} +mkdir -p -m 755 %{buildroot}%{_libdir} +mkdir -p -m 755 %{buildroot}%{_mandir} +mkdir -p -m 755 %{buildroot}%{_docdir}/%{name} + +##setup source directory +mkdir -p -m 755 %{buildroot}/usr/src/%{name} +# Copy sources +tar --strip-components 1 -xzf %{S:0} -C %{buildroot}/usr/src/%{name}/ +#...and delete dot files +rm %{buildroot}/usr/src/%{name}/.hg* +rm %{buildroot}/usr/src/%{name}/.travis* + +%cmake_install + +##move the doc into +cp -r %{buildroot}/usr/share/doc/%{name}/* %{buildroot}%{_docdir}/%{name}/. +rm -rf %{buildroot}/usr/share/doc/%{name} + +install -m 755 -d %{buildroot}%{_mandir}/man1 +cp build/%{name}.1 %{buildroot}%{_mandir}/man1 + +install -m 755 -d %{buildroot}%{_sysconfdir}/%{name} +cp %{S:3} %{buildroot}%{_sysconfdir}/%{name} +cp %{S:4} %{buildroot}%{_sysconfdir}/%{name} + +install -m 755 -d %{buildroot}%{_unitdir} +cp orthanc.service %{buildroot}%{_unitdir} + +install -m 755 -d %{buildroot}%{_sharedstatedir}/%{name}/db-v6 + +# Move the plugins from "/usr/lib64/" to "/usr/lib64/orthanc", and +# remove the symbolic links generated by CMake +mkdir -p %{buildroot}%{_libdir}/%{name} +mv build/*.so.%{version} %{buildroot}%{_libdir}/%{name} +rm build/*.so + +# move the executables to stay consistent +mv %{buildroot}%{_bindir}/OrthancRecoverCompressedFile %{buildroot}%{_bindir}/orthancRecoverCompressedFile +mv %{buildroot}%{_sbindir}/Orthanc %{buildroot}%{_sbindir}/orthanc + +# Create symbolic links to plugins in "/usr/share/orthanc/plugins" +# We stick to the "relative symlinks" section of the guideline + +rm %{buildroot}%{_prefix}/share/%{name}/plugins/*.so* + +ln -s ../../../..%{_libdir}/%{name}/libServeFolders.so.%{version} \ + %{buildroot}%{_prefix}/share/%{name}/plugins/libServeFolders.so +ln -s ../../../..%{_libdir}/%{name}/libModalityWorklists.so.%{version} \ + %{buildroot}%{_prefix}/share/%{name}/plugins/libModalityWorklists.so + +# Prepare documentation: "index.html", Doxygen of plugin SDK, and sample codes +cp -r %{S:5} %{buildroot}%{_docdir}/%{name}/ +cp -r Resources/Samples/ %{buildroot}%{_docdir}/%{name}/Samples +cp -r Plugins/Samples/ %{buildroot}%{_docdir}/%{name}/OrthancPluginSamples + +%pre +getent group orthanc >/dev/null || groupadd -r orthanc +getent passwd orthanc >/dev/null || \ + useradd -r -g orthanc -G orthanc -d %{_sharedstatedir}/orthanc -s /sbin/nologin \ + -c "User account that holds information for Orthanc" orthanc + +%service_add_pre orthanc.service + +%preun +%service_del_preun orthanc.service + +%post +/sbin/ldconfig +%service_add_post orthanc.service + +%postun +/sbin/ldconfig +%service_del_postun orthanc.service + +%files +%doc AUTHORS NEWS README TODO orthanc-readme.SUSE +%license COPYING +%{_mandir}/man1/orthanc.1* +%{_bindir}/orthancRecoverCompressedFile +%{_sbindir}/orthanc +%{_unitdir}/orthanc.service +%{_libdir}/orthanc/*.so.%{version} +%{_prefix}/share/orthanc/plugins/*.so* +%dir %{_sysconfdir}/orthanc +%dir %{_libdir}/orthanc +%dir %{_prefix}/share/orthanc +%dir %{_prefix}/share/orthanc/plugins +%config(noreplace) %{_sysconfdir}/orthanc/*.json +%dir %attr(0755, orthanc, orthanc) %{_sharedstatedir}/orthanc +%dir %attr(0755, orthanc, orthanc) %{_sharedstatedir}/orthanc/db-v6 + +%files -n orthanc-devel +%dir %{_includedir}/orthanc +%{_includedir}/orthanc/* +%dir /usr/src/%{name} + +%files -n orthanc-doc +%{_docdir}/orthanc/index.html +%{_docdir}/orthanc/Orthanc* +%{_docdir}/orthanc/Samples/* +%dir %attr(0755, orthanc, orthanc) %{_docdir}/orthanc/Samples + +%files source +%defattr(-,root,root) +/usr/src/%{name}/* + +%changelog diff --git a/serve-folders.json b/serve-folders.json new file mode 100644 index 0000000..ec5e285 --- /dev/null +++ b/serve-folders.json @@ -0,0 +1,15 @@ +{ + /** + * Configuration of the ServeFolders plugin, that can be used to + * serve additional folders through the embedded Web server of + * Orthanc. This is especially useful to avoid problems related to + * the same-origin policy when developing Web applications in + * JavaScript on the top of the REST API of Orthanc. + * + * The commented example would serve the documentation of the plugin + * SDK at the URL http://localhost:8042/doc/index.html + **/ + "ServeFolders" : { + // "/doc" : "/usr/share/doc/orthanc/" + } +} diff --git a/worklists.json b/worklists.json new file mode 100644 index 0000000..7ad42a2 --- /dev/null +++ b/worklists.json @@ -0,0 +1,12 @@ +{ + /** + * Configuration of the ModalityWorklists plugin, that can be used + * to serve DICOM modality worklists. More information about this + * plugin is available in the source distribution at: + * https://bitbucket.org/sjodogne/orthanc/src/default/Plugins/Samples/ModalityWorklists/README + **/ + "Worklists" : { + "Enable": false, + "Database": "/var/lib/orthanc/worklists" + } +}