File DisplayCluster.spec of Package DisplayCluster

#
# spec file for package DisplayCluster
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.links2linux.org/
#


%define soname  0
%define commit  git20150515
%if 0%{?suse_version} == 1315
%bcond_without unr_pkg
%endif
Name:           DisplayCluster
Version:        0.4.0
Release:        0
Summary:        A collaborative software for driving large display walls
License: GPL-2.0
Group:          Productivity/Multimedia/Other
Url:            https://github.com/TACC/DisplayCluster        
ExclusiveArch:  x86_64
# Forking Project: http://bluebrain.github.io/
Source0:        https://github.com/BlueBrain/DisplayCluster/archive/0.4.0.tar.gz#/%{name}-%{version}.tar.bz2
Source1:        https://github.com/Eyescale/CMake/archive/master.tar.gz#/CMake-common_%{commit}.tar.bz2
# PATCH-FIX-UPSTREAM build.diff avvissu@yandex.ru -- Changed the paths install files and fix for 64-bit build
Patch0:         DisplayCluster-0.4.0_build.patch
# PATCH-FIX-UPSTREAM link_libraries.patch avvissu@yandex.ru -- Add link to library
Patch1:         DisplayCluster-0.4.0_link_libraries.patch
# PATCH-FIX-UPSTREAM doxygen.patch avvissu@yandex.ru --  Fix build error: need administrative privileges
Patch2:         CMake_doxygen.patch
# PATCH-FIX-UPSTREAM boost.patch avvissu@yandex.ru --  Fix build with boost >= 1.58.0
Patch3:         DisplayCluster-0.4.0_boost.patch
# PATCH-FIX-UPSTREAM boost.patch avvissu@yandex.ru --  Fix build with boost >= 1.59.0
Patch4:         DisplayCluster-0.4.0_boost-1.59.patch
BuildRequires:  ImageMagick
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  libboost_date_time-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_regex-devel
BuildRequires:  libboost_serialization-devel
BuildRequires:  libboost_system-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  libboost_test-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(QtCore)
BuildRequires:  pkgconfig(QtGui)
BuildRequires:  pkgconfig(QtNetwork)
BuildRequires:  pkgconfig(QtOpenGL)
BuildRequires:  pkgconfig(QtSvg)
BuildRequires:  pkgconfig(QtWebKit)
BuildRequires:  pkgconfig(QtXml)
BuildRequires:  pkgconfig(QtXmlPatterns)
BuildRequires:  libjpeg8-devel
###########Recommends###########
BuildRequires:  FastCGI-devel
BuildRequires:  freeglut-devel
BuildRequires:  openmpi-devel
BuildRequires:  pkg-config
BuildRequires:  python-devel
BuildRequires:  python-qt4
BuildRequires:  python-qt4-devel
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(libavcodec) = 56.60.100
BuildRequires:  pkgconfig(libavformat) = 56.40.101
BuildRequires:  pkgconfig(libavutil) = 54.31.100
BuildRequires:  pkgconfig(libdts)
BuildRequires:  pkgconfig(libswscale) = 3.1.101
BuildRequires:  pkgconfig(python)
BuildRequires:  pkgconfig(xmu)
#Error: opal_init failed
Requires:       openmpi-devel

%description
DisplayCluster is a software environment for interactively driving
large-scale tiled displays. The software allows users to interactively view
media such as high-resolution imagery and video, as well as stream content
from remote sources such as laptops / desktops or high-performance remote
visualization machines.

%package -n     libdccore%{soname}
Summary:        The core library for %{name}
License: GPL-2.0
Group:          System/Libraries
Provides:       lib%{name}%{soname} = %{version}
Obsoletes:      lib%{name}%{soname} < %{version}

%description -n libdccore%{soname}
DisplayCluster is a software environment for interactively driving
large-scale tiled displays. The software allows users to interactively view
media such as high-resolution imagery and video, as well as stream content
from remote sources such as laptops / desktops or high-performance remote
visualization machines.

%package -n     libdcwebservice%{soname}
Summary:        Accepts external commands through the FastCGI protocol
License: GPL-2.0
Group:          System/Libraries

%description -n libdcwebservice%{soname}
DisplayCluster is a software environment for interactively driving
large-scale tiled displays. The software allows users to interactively view
media such as high-resolution imagery and video, as well as stream content
from remote sources such as laptops / desktops or high-performance remote
visualization machines.

%package 		devel
Summary:        Development files for %{name}
License: GPL-2.0
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{soname} = %{version}
Requires:       pkgconfig(libavcodec)
Requires:       pkgconfig(libavformat)
Requires:       pkgconfig(libavutil)
Requires:       pkgconfig(libswscale)
Requires:       FastCGI-devel

%description 	devel
A collaborative software for driving large display walls.

This package contains header files and libraries needed to develop
application that use %{name}.

%package        doc
Summary:        Documentation for %{name}
Group:          Documentation/Other
BuildArch:      noarch

%description    doc
A collaborative software for driving large display walls.

This document describes the basic structure and provides information on
usage of %{name}.

%prep
%setup -q -a1
mv CMake-common* CMake/common
%patch0 -p1
%patch1 -p1
%patch3 -p1
%patch4 -p1
pushd CMake/common
%patch2 -p1
popd

# Do not compile in DATE and TIME
sed -i '/^HTML_TIMESTAMP/s/YES/NO/' $(grep -rl 'HTML_TIMESTAMP')
# Fix incorrect sRGB profile (run desktopstreamer)
for f in $(find . -type f -name \*.png); do
convert $f -strip $f
done

%build
%cmake \
	-DCMAKE_BUILD_TYPE=Release \
	-DFORCE_BUILD_DCCORE=ON \
	-DCMAKE_SKIP_RPATH:BOOL=OFF \
	-DFCGI_INCLUDE_DIR:PATH="%{_includedir}/fastcgi"

make %{?_smp_mflags}
make %{?_smp_mflags} doxygen

%install
%make_install -C build

mkdir -p %{buildroot}%{_docdir}
mv %{buildroot}{%{_datadir}/%{name}/doc,%{_docdir}/%{name}}

%fdupes -s %{buildroot}%{_datadir}

%check
#sed -i '/ctest/s|\(bin/ctest\)|\1 -V|' build/Makefile
#make test -C build

%post -n libdccore%{soname} -p /sbin/ldconfig

%postun -n libdccore%{soname} -p /sbin/ldconfig

%post -n libdcwebservice%{soname} -p /sbin/ldconfig

%postun -n libdcwebservice%{soname} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%{_docdir}/%{name}
%{_bindir}/desktopstreamer
%{_bindir}/displaycluster
%{_bindir}/localstreamer
%{_bindir}/simplestreamer
%exclude %{_docdir}/%{name}/manual.pdf
%exclude %{_docdir}/%{name}/API

%files -n libdccore%{soname}
%defattr(-,root,root)
%{_libdir}/libdccore.so.*
%{_libdir}/libdcstream.so.*

%files -n libdcwebservice%{soname}
%defattr(-,root,root)
%{_libdir}/libdcwebservice.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/dc
%{_libdir}/libdccore.so
%{_libdir}/libdcstream.so
%{_libdir}/libdcwebservice.so
%{_libdir}/pkgconfig/%{name}.pc
%{_bindir}/startdisplaycluster
%{_datadir}/%{name}

%files doc
%defattr(-,root,root)
%{_docdir}/%{name}/manual.pdf
%{_docdir}/%{name}/API

%changelog