dda2d1d
%define orthancversion 1.0.0
Mario Ceresa 4735327
b178d59
5f57ee1
Name:		orthanc
b178d59
Version:	%{orthancversion}
5407aa5
Release:	2%{?dist}
5f57ee1
Summary:	RESTful DICOM server for healthcare and medical research
5f57ee1
5f57ee1
License:	GPLv3 with exceptions
dda2d1d
URL:		http://www.orthanc-server.com/
dda2d1d
Source0:	http://www.orthanc-server.com/downloads/get.php?path=/orthanc/Orthanc-%{version}.tar.gz
3343bef
Source1:	orthanc.service
3343bef
Source2:	orthanc.json
3343bef
Source3:        serve-folders.json
3343bef
Source4:        worklists.json
1d917c9
Source5:        index.html
5f57ee1
1d917c9
# This patch fixes the installation path of the 64bit version of the plugins
Björn Esser 40d69b3
Patch1:		orthanc-%{orthancversion}-lib64.patch
4ff81b7
86bbea5
# This patch properly defines system include dirs for DCMTK within
86bbea5
# CMake above version 3.5.0 (necessary since Fedora >= 24)
86bbea5
Patch2:         orthanc-1.0.0-cmake-dcmtk.patch
86bbea5
f4e7ab0
# This patch fixes unit tests against recent version of JsonCpp
f4e7ab0
Patch3:         orthanc-1.0.0-unittests.patch
f4e7ab0
5f57ee1
BuildRequires:	cmake >= 2.8.0
dda2d1d
BuildRequires:	help2man
dda2d1d
BuildRequires:	python
dda2d1d
BuildRequires:	doxygen
dda2d1d
BuildRequires:	systemd
dda2d1d
5f57ee1
BuildRequires:	boost-devel
5f57ee1
BuildRequires:	curl-devel
5f57ee1
BuildRequires:	dcmtk-devel
5f57ee1
BuildRequires:	gtest-devel
3343bef
BuildRequires:	jsoncpp-devel
Björn Esser f2624b5
BuildRequires:	libjpeg-devel
5f57ee1
BuildRequires:	libpng-devel
5f57ee1
BuildRequires:	libsqlite3x-devel
5f57ee1
BuildRequires:	libuuid-devel
3343bef
BuildRequires:	lua-devel >= 5.1.0
5f57ee1
BuildRequires:	mongoose-devel
5f57ee1
BuildRequires:	openssl-devel
9844224
BuildRequires:	pugixml-devel
5f57ee1
f7373db
%if 0%{?fedora} >= 24
c4b573e
# For linking against "libxml2.so"
c4b573e
BuildRequires:  libxml2-devel
c4b573e
# For linking against "libwrap.so"
c4b573e
BuildRequires:  tcp_wrappers-devel
f7373db
%endif
f7373db
5f57ee1
# The following line is required to add the "orthanc" user and group
e4b2267
Requires(pre):	shadow-utils
5f57ee1
5f57ee1
# The following lines are required to install the Systemd service
5f57ee1
# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets?rd=Packaging/ScriptletSnippets#Macroized_scriptlets_.28Fedora_18.2B.29
5f57ee1
Requires(post): systemd
5f57ee1
Requires(preun): systemd
5f57ee1
Requires(postun): systemd
5f57ee1
5f57ee1
5f57ee1
%description
5f57ee1
Orthanc aims at providing a simple, yet powerful standalone DICOM
5f57ee1
server. Orthanc can turn any computer running Windows or Linux into a
5f57ee1
DICOM store (in other words, a mini-PACS system). Its architecture is
5f57ee1
lightweight, meaning that no complex database administration is
5f57ee1
required, nor the installation of third-party dependencies.
5f57ee1
5f57ee1
What makes Orthanc unique is the fact that it provides a RESTful
5f57ee1
API. Thanks to this major feature, it is possible to drive Orthanc
5f57ee1
from any computer language. The DICOM tags of the stored medical
5f57ee1
images can be downloaded in the JSON file format. Furthermore,
5f57ee1
standard PNG images can be generated on-the-fly from the DICOM
5f57ee1
instances by Orthanc.
5f57ee1
5f57ee1
Orthanc lets its users focus on the content of the DICOM files,
5f57ee1
hiding the complexity of the DICOM format and of the DICOM protocol.
5f57ee1
5f57ee1
3343bef
dda2d1d
%package -n orthanc-devel
dda2d1d
Summary:        Header files for creating Orthanc plugins
b178d59
Group:          Development/Libraries/C and C++
b178d59
3343bef
# Guideline for header only libraries
3343bef
Provides:       orthanc-static = %{version}-%{release}
3343bef
dda2d1d
%description -n orthanc-devel
dda2d1d
This package includes the header files to develop C/C++ plugins
dda2d1d
for Orthanc.
b178d59
3343bef
3343bef
   
dda2d1d
%package -n orthanc-doc
dda2d1d
Summary:        Documentation files for Orthanc
b178d59
Group:          Documentation
b178d59
BuildArch:	noarch
b178d59
dda2d1d
%description -n orthanc-doc
dda2d1d
This package includes the documentation and the sample codes
dda2d1d
available for Orthanc. It also includes the documentation
dda2d1d
to develop C/C++ plugins for Orthanc.
b178d59
b178d59
b178d59
5f57ee1
%prep
5f57ee1
%setup -q -n Orthanc-%{version}
5f57ee1
%patch1
86bbea5
%patch2 -p1
f4e7ab0
%patch3 -p1
5f57ee1
5f57ee1
# Copy the configuration file and the Systemd Service for the Orthanc server
3343bef
cp -p %SOURCE1 orthanc.service
5f57ee1
5f57ee1
5f57ee1
%build
dda2d1d
%cmake	. \
5f57ee1
	-DCMAKE_BUILD_TYPE=Release \
Jodogne 9f75528
	-DDCMTK_LIBRARIES=CharLS \
dda2d1d
	-DSTANDALONE_BUILD:BOOL=ON \
dda2d1d
	-DSTATIC_BUILD:BOOL=OFF \
f6de5db
	-DSYSTEM_MONGOOSE_USE_CALLBACKS=OFF \
dda2d1d
	-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=OFF
5f57ee1
5f57ee1
make %{?_smp_mflags}
5f57ee1
5f57ee1
# Generate the man page
5f57ee1
help2man ./Orthanc -N -n "Lightweight, RESTful DICOM server for healthcare and medical research" > Orthanc.1
5f57ee1
5f57ee1
5f57ee1
%check
5f57ee1
# Execute the unit tests
39d63b2
./UnitTests
5f57ee1
5f57ee1
5f57ee1
%install
5f57ee1
make install DESTDIR=%{buildroot}
5f57ee1
5f57ee1
install -m 755 -d %{buildroot}%{_mandir}/man1
5f57ee1
cp Orthanc.1 %{buildroot}%{_mandir}/man1
5f57ee1
5f57ee1
install -m 755 -d %{buildroot}%{_sysconfdir}/orthanc
3343bef
cp %SOURCE2 %{buildroot}%{_sysconfdir}/orthanc
3343bef
cp %SOURCE3 %{buildroot}%{_sysconfdir}/orthanc
3343bef
cp %SOURCE4 %{buildroot}%{_sysconfdir}/orthanc
5f57ee1
5f57ee1
install -m 755 -d %{buildroot}%{_unitdir}
5f57ee1
cp orthanc.service %{buildroot}%{_unitdir}
5f57ee1
dda2d1d
install -m 755 -d %{buildroot}%{_sharedstatedir}/orthanc/db-v6
5f57ee1
1d917c9
# Move the plugins from "/usr/lib64/" to "/usr/lib64/orthanc", and
1d917c9
# remove the symbolic links generated by CMake
1d917c9
mkdir -p %{buildroot}%{_libdir}/orthanc
1d917c9
mv %{buildroot}%{_libdir}/*.so.%{orthancversion} %{buildroot}%{_libdir}/orthanc
1d917c9
rm %{buildroot}%{_libdir}/*.so
3343bef
3343bef
# Create symbolic links to plugins in "/usr/share/orthanc/plugins"
1d917c9
# We stick to the "relative symlinks" section of the guideline
1d917c9
mkdir -p %{buildroot}%{_prefix}/share/orthanc/plugins
1d917c9
ln -s ../../../..%{_libdir}/orthanc/libServeFolders.so.%{orthancversion} \
3343bef
   %{buildroot}%{_prefix}/share/orthanc/plugins/libServeFolders.so
1d917c9
ln -s ../../../..%{_libdir}/orthanc/libModalityWorklists.so.%{orthancversion} \
3343bef
   %{buildroot}%{_prefix}/share/orthanc/plugins/libModalityWorklists.so
3343bef
1d917c9
# Prepare documentation: "index.html", Doxygen of plugin SDK, and sample codes
1d917c9
cp -r %SOURCE5 %{buildroot}%{_docdir}/orthanc/
1d917c9
cp -r Resources/Samples/ %{buildroot}%{_docdir}/orthanc/Samples
1d917c9
cp -r Plugins/Samples/ %{buildroot}%{_docdir}/orthanc/OrthancPluginSamples
b178d59
5f57ee1
5f57ee1
%files
5f57ee1
%doc NEWS README THANKS COPYING
1d917c9
%{_mandir}/man1/Orthanc.1*
3343bef
%{_sbindir}/Orthanc
5f57ee1
%{_unitdir}/orthanc.service
3343bef
%{_libdir}/orthanc/*.so.%{orthancversion}
3343bef
%{_prefix}/share/orthanc/plugins/*.so
5f57ee1
5f57ee1
%dir %{_sysconfdir}/orthanc
3343bef
%config(noreplace) %{_sysconfdir}/orthanc/*.json
5f57ee1
%dir %attr(0755, orthanc, orthanc) %{_sharedstatedir}/orthanc
dda2d1d
%dir %attr(0755, orthanc, orthanc) %{_sharedstatedir}/orthanc/db-v6
5f57ee1
dda2d1d
%files -n orthanc-devel
b178d59
%defattr(-,root,root,-)
b178d59
%{_includedir}/*
b178d59
dda2d1d
%files -n orthanc-doc
b178d59
%defattr(-,root,root,-)
1d917c9
%{_docdir}/orthanc/*
b178d59
b178d59
5f57ee1
5f57ee1
# Installation of the Systemd Orthanc service
5f57ee1
# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
5f57ee1
%post
5f57ee1
%systemd_post orthanc.service
5f57ee1
5f57ee1
%preun
5f57ee1
%systemd_preun orthanc.service
5f57ee1
5f57ee1
%postun
5f57ee1
%systemd_postun_with_restart orthanc.service
5f57ee1
5f57ee1
5f57ee1
%pre
5f57ee1
# http://fedoraproject.org/wiki/Packaging%3aUsersAndGroups
5f57ee1
# "We never remove users or groups created by packages"
5f57ee1
5f57ee1
getent group orthanc >/dev/null || groupadd -r orthanc
5f57ee1
getent passwd orthanc >/dev/null || \
5f57ee1
    useradd -r -g orthanc -G orthanc -d %{_sharedstatedir}/orthanc -s /sbin/nologin \
5f57ee1
    -c "User account that holds information for Orthanc" orthanc
5f57ee1
exit 0
5f57ee1
5f57ee1
5f57ee1
%changelog
86bbea5
* Mon Apr 11 2016 Sebastien Jodogne <s.jodogne@gmail.com> 1.0.0-2
86bbea5
- Compatibility with CMake >= 3.5.0
86bbea5
3343bef
* Fri Apr 08 2016 Sebastien Jodogne <s.jodogne@gmail.com> 1.0.0-1
dda2d1d
- New upstream version
1d917c9
- Add of "orthanc-devel" and "orthanc-doc"
1d917c9
- Removal of "orthancclient-lib/devel/doc" (now a separate project)
dda2d1d
Björn Esser ca76677
* Fri Mar 25 2016 Björn Esser <fedora@besser82.io> - 0.8.6-8
Björn Esser ca76677
- Rebuilt for libjsoncpp.so.1
Björn Esser f2624b5
- Add Patch2, properly define system include dirs within CMake
Björn Esser f2624b5
- Add explicit BuildRequires libjpeg-devel libxml2-devel tcp_wrappers-devel
Björn Esser f2624b5
969a461
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-7
969a461
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
969a461
cbe5ae9
* Thu Aug 27 2015 Jonathan Wakely <jwakely@redhat.com> - 0.8.6-6
cbe5ae9
- Rebuilt for Boost 1.59
cbe5ae9
1721e39
* Wed Jul 29 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.6-5
1721e39
- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159
1721e39
39f20d5
* Wed Jul 22 2015 David Tardon <dtardon@redhat.com> - 0.8.6-4
39f20d5
- rebuild for Boost 1.58
39f20d5
4982431
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.6-3
4982431
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
4982431
66bd9c7
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.8.6-2
66bd9c7
- Rebuilt for GCC 5 C++11 ABI change
66bd9c7
Mario Ceresa 4735327
* Wed Apr 8 2015 Mario Ceresa <mrceresa@gmail.com> 0.8.6-1
Mario Ceresa 4735327
- New upstrean version
Mario Ceresa 4735327
Petr Machata e141bea
* Mon Jan 26 2015 Petr Machata <pmachata@redhat.com> - 0.8.5-3
Petr Machata e141bea
- Rebuild for boost 1.57.0
Petr Machata e141bea
Mario Ceresa 829508c
* Tue Dec 16 2014 Mario Ceresa <mrceresa@gmail.com> 0.8.5-2
Mario Ceresa 829508c
- Rebuild for dcmtk update
Mario Ceresa 829508c
9f08028
* Tue Nov  4 2014 Sebastien Jodogne <s.jodogne@gmail.com> 0.8.5-1
9f08028
- New upstream version
9f08028
aebaeb8
* Fri Sep 12 2014 Sebastien Jodogne <s.jodogne@gmail.com> 0.8.3-1
aebaeb8
- New upstream version
aebaeb8
9e0d3ca
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.0-2
9e0d3ca
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
9e0d3ca
e88f05a
* Fri Jul 11 2014 Sebastien Jodogne <s.jodogne@gmail.com> 0.8.0-1
e88f05a
- New upstream version
e88f05a
Jodogne 9f75528
* Thu Jun 12 2014 Sebastien Jodogne <s.jodogne@gmail.com> 0.7.6-1
Jodogne 9f75528
- New upstream version
Jodogne 9f75528
84dc8df
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.5-3
84dc8df
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
84dc8df
Petr Machata 56fef7d
* Thu May 22 2014 Petr Machata <pmachata@redhat.com> - 0.7.5-2
Petr Machata 56fef7d
- Rebuild for boost 1.55.0
Petr Machata 56fef7d
Jodogne 5463031
* Fri May  9 2014 Sebastien Jodogne <s.jodogne@gmail.com> 0.7.5-1
Jodogne 5463031
- New upstream version
Jodogne 5463031
5657ba1
* Fri Feb 14 2014 Sebastien Jodogne <s.jodogne@gmail.com> 0.7.3-1
5657ba1
- New upstream version
5657ba1
6e27908
* Fri Nov  8 2013 Sebastien Jodogne <s.jodogne@gmail.com> 0.7.2-1
6e27908
- New upstream version
6e27908
39d63b2
* Wed Oct 30 2013 Sebastien Jodogne <s.jodogne@gmail.com> 0.7.1-1
b178d59
- New upstream version
39d63b2
- Fix for big endian architectures (bug #985748)
b178d59
- Packaging of the Orthanc Client library
b178d59
576bda0
* Mon Sep 16 2013 Sebastien Jodogne <s.jodogne@gmail.com> 0.6.1-1
576bda0
- New upstream version
576bda0
c96fdb3
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-3
c96fdb3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
c96fdb3
Petr Machata f77012a
* Sat Jul 27 2013 pmachata@redhat.com - 0.6.0-2
Petr Machata f77012a
- Rebuild for boost 1.54.0
Petr Machata f77012a
d82a563
* Tue Jul 16 2013 Sebastien Jodogne <s.jodogne@gmail.com> 0.6.0-1
d82a563
- New upstream version
d82a563
ad06685
* Wed May  8 2013 Sebastien Jodogne <s.jodogne@gmail.com> 0.5.2-1
ad06685
- New upstream version
ad06685
d82a563
* Wed Apr 17 2013 Sebastien Jodogne <s.jodogne@gmail.com> 0.5.1-1
d0b1c5f
- New upstream version
d0b1c5f
5f57ee1
* Thu Apr 04 2013 Sebastien Jodogne <s.jodogne@gmail.com> 0.5.0-1
5f57ee1
- New upstream version
5f57ee1
5f57ee1
* Wed Dec 19 2012 Sebastien Jodogne <s.jodogne@gmail.com> 0.4.0-5
5f57ee1
- Fixes according to reviews
5f57ee1
5f57ee1
* Wed Dec 19 2012 Sebastien Jodogne <s.jodogne@gmail.com> 0.4.0-4
5f57ee1
- Dynamic linking against mongoose-lib
5f57ee1
5f57ee1
* Wed Dec 19 2012 Sebastien Jodogne <s.jodogne@gmail.com> 0.4.0-3
5f57ee1
- Improvements to the packaging
5f57ee1
5f57ee1
* Tue Dec 18 2012 Sebastien Jodogne <s.jodogne@gmail.com> 0.4.0-2
5f57ee1
- Improvements to the packaging
5f57ee1
5f57ee1
* Mon Dec 17 2012 Sebastien Jodogne <s.jodogne@gmail.com> 0.4.0-1
5f57ee1
- Initial RPM Release