From c33b2ed1f713651c36a5ebb9d694ba7856b3cad61d35bb36cf61686eea4895bf Mon Sep 17 00:00:00 2001 From: Axel Braun Date: Tue, 19 Aug 2025 10:21:03 +0000 Subject: [PATCH] version update OBS-URL: https://build.opensuse.org/package/show/graphics/orthanc-python?expand=0&rev=19 --- .gitattributes | 23 +++++++ .gitignore | 1 + OrthancPython-5.0.tar.gz | 3 + OrthancPython-6.0.tar.gz | 3 + orthanc-python-readme.openSUSE | 18 ++++++ orthanc-python.changes | 114 ++++++++++++++++++++++++++++++++ orthanc-python.spec | 115 +++++++++++++++++++++++++++++++++ 7 files changed, 277 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 OrthancPython-5.0.tar.gz create mode 100644 OrthancPython-6.0.tar.gz create mode 100644 orthanc-python-readme.openSUSE create mode 100644 orthanc-python.changes create mode 100644 orthanc-python.spec 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/OrthancPython-5.0.tar.gz b/OrthancPython-5.0.tar.gz new file mode 100644 index 0000000..26722c7 --- /dev/null +++ b/OrthancPython-5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0df1ba5082b0dab558b70ec9447c5954cb7d9b568bcb9e4a7a4d1b86fb103f6 +size 253949 diff --git a/OrthancPython-6.0.tar.gz b/OrthancPython-6.0.tar.gz new file mode 100644 index 0000000..8b33cc0 --- /dev/null +++ b/OrthancPython-6.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:696ce02045e886a0f3f9f60343eedecffa3c163ada98931eedcf038302f37c4b +size 366183 diff --git a/orthanc-python-readme.openSUSE b/orthanc-python-readme.openSUSE new file mode 100644 index 0000000..f33d1f2 --- /dev/null +++ b/orthanc-python-readme.openSUSE @@ -0,0 +1,18 @@ +README: Orthanc for openSUSE +============================ + +Orthanc is a RESTful DICOM server for healthcare and medical research. + +This plugin can be used to write Orthanc plugins using the Python programming language instead of the more complex C/C++ programming languages. + +Python plugins have access to more features and a more consistent SDK than Lua scripts. The Python API is automatically generated from the Orthanc plugin SDK in C using the Clang compiler front-end. + +As of release 2.0 of the plugin, the coverage of the C SDK is about 75% (119 functions are automatically wrapped in Python out of a total of 157 functions in the Orthanc SDK 1.7.2). + +Configuration files in json format should be stored in /etc/orthanc. + +Check out http://book.orthanc-server.com/plugins/python.html for additional information! + +Have fun +Axel Braun Tue Dec 22 09:16:26 UTC 2020 + diff --git a/orthanc-python.changes b/orthanc-python.changes new file mode 100644 index 0000000..d38807e --- /dev/null +++ b/orthanc-python.changes @@ -0,0 +1,114 @@ +------------------------------------------------------------------- +Mon Aug 18 14:37:28 UTC 2025 - Axel Braun + +- version 6.0 + * The auto-generation of the Python wrapper is now part of the build, + to exploit the ORTHANC_PLUGIN_SINCE_SDK macro. This provides backward + compatibility with the SDK that is actually installed on the system + * Added Windows builder for Python 3.13 + * Added Docker-based builder scripts for Debian 13 (trixie) + +------------------------------------------------------------------- +Fri Jan 24 11:32:41 UTC 2025 - Axel Braun + +- version 5.0 + * Minimum SDK version: 1.12.6 + * Added "orthanc.RestOutput.StartStreamAnswer()" and "orthanc.RestOutput.SendStreamChunk()" + * In "orthanc.pyi", enumerations are not tagged as deriving from "enum.Enum" anymore: + https://github.com/orthanc-server/orthanc-builder/issues/21 + * Docker-based builder scripts for Debian 12 (bookworm) + +------------------------------------------------------------------- +Mon Jul 8 14:30:52 UTC 2024 - Axel Braun + +- version 4.3 + * Created Python documentation for the Orthanc interface, check out "orthanc.pyi" + * Added option "AllowThreads" to release the GIL during the call to the native SDK functions + * Code model is now generated by the "orthanc-java" project + * Added Windows builder for Python 3.12 + * Licensing information is now compliant with the FSFE REUSE specification + +------------------------------------------------------------------- +Tue May 21 07:02:28 UTC 2024 - Axel Braun + +- version 4.2 + * Fix signature of "orthanc.RestOutput.SendHttpStatus()" + * Added orthanc.RegisterMoveCallback2() that takes 4 callbacks like the + original C SDK function. This allows you to implement a correct handling + of the C-Move sub-operations count in the GetMoveSize(). The ApplyMove() + must now handle a single sub-operation at a time. + The legacy orthanc.RegisterMoveCallback() always considers that there is a single + sub-operation and we have observed modalities complaining that the number of + sub-operations was not matching the number of instances sent. + +------------------------------------------------------------------- +Wed Mar 13 13:14:32 UTC 2024 - Axel Braun + +- enable gcc13 for Leap 15, %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Wed Sep 20 09:43:23 UTC 2023 - Axel Braun + +- Version 4.1 + * New function from the SDK wrapped in Python: + - orthanc.RegisterStorageCommitmentScpCallback() + * New configuration section "Python" to group settings related to the plugin: + - "Python.Path" is an alias for global option "PythonScript" + - "Python.Verbose" is an alias for global option "PythonVerbose" + * New configuration option "Python.DisplayMemoryUsage" to periodically + display memory allocations that stem from Python plugins + * Fix memory leaks when a python script calls orthanc.RestApiPost() and sibling + methods, in IncomingHttpRequestFilter and in the CMove callback. + * New builders for Windows: Supporting 32 / 64bit with Python 3.9 / 3.10 / 3.11 + +------------------------------------------------------------------- +Mon Dec 5 07:24:58 UTC 2022 - Dirk Müller + +- update to 4.0: + * New functions from the SDK wrapped in Python: + - orthanc.RegisterIncomingCStoreInstanceFilter() + - orthanc.RegisterReceivedInstanceCallback() + +------------------------------------------------------------------- +Wed Sep 1 07:49:14 UTC 2021 - Axel Braun + +- Version 3.4 +* On Orthanc stopping, wait for all the queued events to have been processed +* Docker-based builder scripts distinguishing Debian buster and bullseye + +------------------------------------------------------------------- +Sat Aug 14 12:00:27 UTC 2021 - Axel Braun + +- version 3.3 +* New Python function: "orthanc.RegisterStorageArea()" +* Custom exception "orthanc.OrthancException" is raised instead of "ValueError" + +------------------------------------------------------------------- +Sat Jun 19 13:36:54 UTC 2021 - Axel Braun + +- version 3.2 +* New functions from the SDK wrapped in Python: + - orthanc.CreateDicom() + - orthanc.CreateImageFromBuffer() + - orthanc.DicomInstance.GetInstanceData() + - orthanc.FindQuery.GetFindQueryTagElement() + - orthanc.FindQuery.GetFindQueryTagGroup() + - orthanc.Image.GetImageBuffer() + - orthanc.LookupDictionary() + - orthanc.RegisterFindCallback() + - orthanc.RegisterMoveCallback() + - orthanc.RegisterWorklistCallback() + - orthanc.WorklistAnswers.WorklistAddAnswer() + +------------------------------------------------------------------ +Mon Jan 25 14:53:58 UTC 2021 - Axel Braun + +- verion 3.1 +* Fix possible deadlock with "orthanc.RegisterOnChangeCallback()" +* During Orthanc shutdown, wait for all the pending events to have been processed + +------------------------------------------------------------------- +Tue Dec 22 09:16:26 UTC 2020 - Axel Braun + +- Version 3.0 + initial OBS build diff --git a/orthanc-python.spec b/orthanc-python.spec new file mode 100644 index 0000000..bffd0b9 --- /dev/null +++ b/orthanc-python.spec @@ -0,0 +1,115 @@ +# +# spec file for package orthanc-python +# +# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2020-2025 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/ +# + + +%{?sle15_python_module_pythons} +Name: orthanc-python +Version: 6.0 +Release: 0 +Summary: Python plugin for Orthanc +License: AGPL-3.0-or-later +Group: Productivity/Graphics/Viewers +URL: https://orthanc-server.com +Source0: https://orthanc.uclouvain.be/downloads/sources/%{name}/OrthancPython-%{version}.tar.gz +Source11: orthanc-python-readme.openSUSE +BuildRequires: cmake +%if 0%{?suse_version} == 1500 && 0%{?sle_version} > 150200 +BuildRequires: gcc13-c++ +%else +BuildRequires: gcc-c++ +%endif +BuildRequires: jsoncpp-devel +BuildRequires: libboost_atomic-devel >= 1.66 +BuildRequires: libboost_date_time-devel >= 1.66 +BuildRequires: libboost_filesystem-devel >= 1.66 +BuildRequires: libboost_iostreams-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: libuuid-devel +BuildRequires: orthanc-devel >= 1.10 +BuildRequires: orthanc-source +BuildRequires: pkgconfig +BuildRequires: python3-devel +BuildRequires: python3-pystache +BuildRequires: unzip +BuildRequires: pkgconfig(python3) +Requires: orthanc + +%description +This plugin can be used to write Orthanc plugins in Python instead of C++ +See %{_docdir}/orthanc/orthanc-python-readme.openSUSE + +%prep +%autosetup -n OrthancPython-%{version} + +echo %{python3_version} + +%build +%if 0%{?suse_version} == 1500 && 0%{?sle_version} > 150200 +export CC=gcc-13 +export CXX=g++-13 +%endif +%cmake .. \ + -DALLOW_DOWNLOADS=OFF \ + -DUSE_SYSTEM_GOOGLE_TEST=ON \ + -DUSE_SYSTEM_ORTHANC_SDK=ON \ + -DORTHANC_FRAMEWORK_SOURCE=path \ + -DBoost_NO_BOOST_CMAKE=ON \ + -DPYTHON_VERSION=%{python3_version} \ + -DORTHANC_FRAMEWORK_ROOT=%{_prefix}/src/orthanc/OrthancFramework/Sources \ + -DLIB_INSTALL_DIR=%{_libdir}/share/orthanc/plugins/ + +%cmake_build %{?_smp_mflags} + +%install +%cmake_install + +# architecture dependet files should not be in /usr/share... +# create a directory +mkdir -p -m 755 %{buildroot}%{_libdir}/share/orthanc/plugins +mkdir -p -m 755 %{buildroot}%{_docdir}/orthanc + +mv %{buildroot}%{_datadir}/orthanc/plugins/*.so* %{buildroot}%{_libdir}/share/orthanc/plugins/. + +#Link from lib64 to orthanc plugin-directory, where it is expected +ln -s ../../../..%{_libdir}/share/orthanc/plugins/libOrthancPython.so.%{version} \ + %{buildroot}%{_datadir}/orthanc/plugins/libOrthancPython.so + +rm %{buildroot}%{_libdir}/share/orthanc/plugins/*.so + +cp %{SOURCE11} %{buildroot}%{_docdir}/orthanc/. + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%license COPYING +%dir %{_docdir}/orthanc +%{_docdir}/orthanc/* +%dir %{_libdir}/share +%dir %{_libdir}/share/orthanc +%dir %{_libdir}/share/orthanc/plugins +%{_libdir}/share/orthanc/plugins/*.so* +%dir %{_datadir}/orthanc +%dir %{_datadir}/orthanc/plugins +%{_datadir}/orthanc/plugins/*.so* +/usr/orthanc.pyi + +%changelog