File ds9.spec of Package ds9
#
# spec file for package ds9
#
# Copyright (c) 2017 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 http://bugs.opensuse.org/
#
Name: ds9
Version: 8.5
Release: 0
License: GPL-3.0+
Summary: SAOImage DS9 Astronomical Imaging Application
Url: http://ds9.si.edu
Source0: http://ds9.si.edu/download/source/ds9.%{version}.tar.gz
# Two patches to allow compilation on aarch: http://savannah.gnu.org/projects/config
Source1: config.guess
Source2: config.sub
# Patch avoids errors of the "non-void function returns without value" errors
# and various failures of "security checks" of modern gcc compilers
Patch1: ds9.patch
Group: Productivity/Scientific/Astronomy
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: libX11-devel
BuildRequires: libtiff-devel
%if 0%{?fedora_version} > 31 || 0%{?is_opensuse}
BuildRequires: tkimg-devel
%endif
BuildRequires: zlib-devel
BuildRequires: zip
BuildRequires: tar
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: tcl-devel
BuildRequires: tk-devel
# Note that 8.5b1 is a pre-release of 8.5. This nomenclature is not mine and will confuse package managers.
Obsoletes: ds9 = 8.3
Obsoletes: ds9 = 8.3rc
Obsoletes: ds9 = 8.3b1
Obsoletes: ds9 <= 8.2
Obsoletes: ds9 = 8.4b1
Obsoletes: ds9 = 8.4.1
Obsoletes: ds9 = 8.5b1
# The binaries of xpa (currently 2.1.20) are also build in this package, but so far it seems
# to be easier to keep this as an extra package.
# Obsoletes: xpa <= 2.1.20
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
SAOImage DS9 is an astronomical imaging and data visualization application. DS9
supports FITS images and binary tables, multiple frame buffers, region
manipulation, and many scale algorithms and colormaps. It provides for easy
communication with external analysis tasks and is highly configurable and
extensible via XPA and SAMP.
It is a stand-alone application. It requires no installation or support files.
All versions and platforms support a consistent set of GUI and functional
capabilities.
It supports advanced features such as 2-D, 3-D and RGB frame buffers, mosaic
images, tiling, blinking, geometric markers, colormap manipulation, scaling,
arbitrary zoom, cropping, rotation, pan, and a variety of coordinate systems.
The GUI is user configurable. GUI elements such as the coordinate
display, panner, magnifier, horizontal and vertical graphs, button bar, and
color bar can be configured via menus or the command line.
# This is the subdirectory where the gunzip of the ds9 source bundle will expand
%define supdir SAOImageDS9
# avoid errors of empty %files type on Fedora...
%global debug_package %{nil}
%prep
%setup -q -n %supdir
%patch1 -p1
%ifarch aarch64
%if 0%{?centos_version}
find . -name config.guess -exec cp %{SOURCE1} {} \;
find . -name config.sub -exec cp %{SOURCE2} {} \;
%else
amdir=$(automake --print-libdir)
find . -name config.guess -exec cp ${amdir}/config.guess {} \;
find . -name config.sub -exec cp ${amdir}/config.sub {} \;
%endif
%endif
%build
%define _configure unix/configure
# also -Werror=format-security is the default on Fedora's RPM and won't compile
export CXXFLAGS=`echo %optflags | sed 's/-Werror=format-security//'`
%global ofla %(echo %optflags | sed 's/-Werror=format-security//' )
%define optflags %{expand:%ofla}
%configure --includedir=%{_builddir}/%{supdir}/include --bindir=%{_builddir}/%{supdir}/bin
# do not use bare %{?_smp_mflags} which means -j3 and leads to rat races
make %{?_smp_mflags} -j 1
%install
install -D bin/ds9 "%{buildroot}/%{_bindir}/ds9"
%files
%defattr(-,root,root)
%license LICENSE
%doc ds9/doc/*
%{_bindir}/ds9