%global srcname pyraf # Set to 0 if you want to build without Python 2 %global with_python2 1 Name: python-%{srcname} Version: 2.1.15 Release: 3%{?dist} Summary: Python Interface to IRAF License: BSD URL: https://pypi.python.org/pypi/%{srcname} Source0: https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz Patch0: python-pyraf-Use-system-provided-iraf-by-default.patch #Patch1: python-pyraf-Remove-module-name-extension-from-extension-modules.patch Patch2: python-pyraf-Fix-irafgwcs-bitness.patch BuildRequires: gcc BuildRequires: libX11-devel # Python 2 %if 0%{?with_python2} BuildRequires: python2-devel BuildRequires: python2-d2to1 BuildRequires: python2-setuptools BuildRequires: python2-stsci-distutils BuildRequires: python2-stsci-tools BuildRequires: python2-tkinter %endif # with_python2 # Python3 BuildRequires: python3-devel BuildRequires: python3-d2to1 BuildRequires: python3-setuptools BuildRequires: python3-stsci-distutils BuildRequires: python3-stsci-tools BuildRequires: python3-tkinter %description PyRAF is a command language for running IRAF tasks that is based on the Python scripting language. It gives users the ability to run IRAF tasks in an environment that has all the power and flexibility of Python. PyRAF can be installed along with an existing IRAF installation; users can then choose to run either PyRAF or the IRAF CL. PyRAF is part of the stsci_python package of astronomical data analysis tools, and is a product of the Science Software Branch at the Space Telescope Science Institute. %if 0%{?with_python2} %package -n python2-%{srcname} Summary: Python 2 interface to IRAF %{?python_provide:%python_provide python2-%{srcname}} Provides: pyraf = %{version}-%{release} Obsoletes: pyraf = %{version}-%{release} Requires: iraf Requires: python2-d2to1 Requires: python2-matplotlib Requires: python2-setuptools Requires: python2-stsci-tools Requires: python2-tkinter Requires: python2-urwid Recommends: python2-ipython %description -n python2-%{srcname} PyRAF is a command language for running IRAF tasks that is based on the Python scripting language. It gives users the ability to run IRAF tasks in an environment that has all the power and flexibility of Python. PyRAF can be installed along with an existing IRAF installation; users can then choose to run either PyRAF or the IRAF CL. PyRAF is part of the stsci_python package of astronomical data analysis tools, and is a product of the Science Software Branch at the Space Telescope Science Institute. This is the Python 2 version. %endif # with_python2 %package -n python3-%{srcname} Summary: Python 3 interface to IRAF %{?python_provide:%python_provide python3-%{srcname}} Requires: iraf Requires: python3-d2to1 Requires: python3-matplotlib Requires: python3-setuptools Requires: python3-stsci-tools Requires: python3-tkinter Requires: python3-urwid Recommends: python3-ipython %description -n python3-%{srcname} This package contains utilities used to package some of STScI's Python projects; specifically those projects that comprise stsci_python and Astrolib. It currently consists mostly of some setup_hook scripts meant for use with distutils2 and/or d2to1, and a customized easy_install command meant for use with distribute. This is the Python 3 version. %prep %setup -qc pushd %{srcname}-%{version} %patch0 -p1 #%%patch1 -p1 %patch2 -p1 sed -i "s,__LIBDIR__,%{_libdir},g" lib/pyraf/iraffunctions.py cp README.rst .. popd mv %{srcname}-%{version} python3 %if 0%{?with_python2} cp -r python3 python2 %endif # with_python2 %build pushd python3 %py3_build popd %if 0%{?with_python2} pushd python2 %py2_build popd %endif # with_python2 %install pushd python3 %py3_install popd %if 0%{?with_python2} pushd python2 %py2_install popd %endif # with_python2 %files -n python3-%{srcname} %doc README.rst %{python3_sitearch}/* %if 0%{?with_python2} %files -n python2-%{srcname} %{_bindir}/pyraf %doc README.rst %{python2_sitearch}/* %endif # with_python2 %changelog * Wed Sep 05 2018 Christian Dersch - 2.1.15-3 - rebuild * Wed Sep 05 2018 Christian Dersch - 2.1.15-2 - rebuild * Wed May 16 2018 Christian Dersch - 2.1.15-1 - initial package