Blame astrometry.spec

23dea7
# Bootstrap option, we have to build astrometry before we can generate index
23dea7
# files, but later package will require them for tests at build time
23dea7
%global bootstrap 1
23dea7
23dea7
23dea7
Name:           astrometry
43b7a2
Version:        0.74
071670
Release:        3%{?dist}
23dea7
Summary:        Blind astrometric calibration of arbitrary astronomical images
23dea7
23dea7
# Software is BSD with some GPL code
23dea7
# https://groups.google.com/forum/#!topic/astrometry/9GgP7rj4Y-g
23dea7
# Here we asked to fix source headers:
23dea7
# https://groups.google.com/forum/#!topic/astrometry/mCuyze3TOeM
23dea7
# 
23dea7
# Licensing breakdown
23dea7
# ===================
23dea7
#
23dea7
# See also: file CREDITS in source folder
23dea7
#
23dea7
# General license for astrometry code: 3-clause BSD
23dea7
#
23dea7
# GPLv2+:
23dea7
#    qfits-an/*
23dea7
#    include/astrometry/qfits*
23dea7
#    catalogs/ucac4-fits.h
23dea7
#    libkd/an-fls.h
23dea7
#    util/makefile.jpeg
23dea7
#    util/md5.c
23dea7
#    Makefile
23dea7
#    doc/UCAC3_guide/* (not used for build and not shipped)
23dea7
#    doc/UCAC4_guide/* (not used for build and not shipped)
f62967
#    
f62967
#    2MASS data files index-42xx.fits
23dea7
#
23dea7
# GPLv3+:
23dea7
#    blind/an_mm_malloc.h
23dea7
#    util/ctmf.c
23dea7
#
23dea7
License:        BSD and GPLv2+ and GPLv3+
23dea7
URL:            http://www.astrometry.net
23dea7
23dea7
# Upstream sources contains nonfree stuff so we must clean them
23dea7
# Download original sources from:
23dea7
# Source0:        http://astrometry.net/downloads/%%{name}.net-%%{version}.tar.gz
23dea7
# Then use the provided script to clean them with
23dea7
# ./generate-tarball %%{version}
23dea7
Source0:        %{name}.net-%{version}-clean.tar.xz
23dea7
Source1:        %{name}-generate-tarball.sh
23dea7
7e2ef8
# 2MASS data files, ./astrometry-get-data.sh
7e2ef8
Source2:        astrometry-data-4204.tar.xz
7e2ef8
Source3:        astrometry-data-4205.tar.xz
7e2ef8
Source4:        astrometry-data-4206.tar.xz
7e2ef8
Source5:        astrometry-data-4207.tar.xz
7e2ef8
Source6:        astrometry-data-4208-4219.tar.xz
7e2ef8
Source7:        astrometry-get-data.sh
f62967
23dea7
# Patches from Ole Streicher <olebole@debian.org> used on Debian to
23dea7
#  * disable build of nonfree stuff removed from sources
23dea7
#  * have a proper versioned soname
23dea7
#  * use system libraries properly
23dea7
#  * use dynamical linking
9df689
Patch0:         %{name}-0.73-Add-SONAME-to-libastrometry.so.patch
23dea7
Patch1:         %{name}-Dynamically-link-to-libastrometry.so-when-possible.patch
23dea7
Patch2:         %{name}-Fix-issues-when-using-Debian-libs-instead-of-convienience.patch
23dea7
Patch3:         %{name}-Call-python-scripts-as-modules-instead-of-executables.patch
81cd19
Patch4:         %{name}-0.73-Don-t-install-non-free-files-images-and-NGC2000.0-catalog.patch
23dea7
071670
BuildRequires:  gcc
23dea7
BuildRequires:  netpbm-devel
3009c0
BuildRequires:  python3-numpy
3009c0
BuildRequires:  python3-astropy
3009c0
BuildRequires:  python3-devel
23dea7
BuildRequires:  swig
23dea7
BuildRequires:  xorg-x11-proto-devel
23dea7
23dea7
BuildRequires:  pkgconfig
23dea7
BuildRequires:  pkgconfig(cairo)
23dea7
BuildRequires:  pkgconfig(cfitsio)
23dea7
BuildRequires:  pkgconfig(fontconfig)
23dea7
BuildRequires:  pkgconfig(gsl)
23dea7
BuildRequires:  pkgconfig(libjpeg)
23dea7
BuildRequires:  pkgconfig(libpng)
23dea7
BuildRequires:  pkgconfig(wcslib)
23dea7
BuildRequires:  pkgconfig(xrender)
23dea7
BuildRequires:  pkgconfig(zlib)
23dea7
23dea7
%if ! 0%{?bootstrap}
23dea7
BuildRequires:  astrometry-tycho2
23dea7
%endif
23dea7
f62967
Requires:       %{name}-data = %{version}-%{release}
3d047f
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
23dea7
Requires:       netpbm-progs
23dea7
Requires:       python2-%{name} = %{version}-%{release}
23dea7
8f9f44
# User could use own set of index files or another set from upstream.
f62967
# Therefore we suggest and not require astrometry-tycho2 here
f62967
Suggests:     astrometry-tycho2
23dea7
23dea7
%description
23dea7
The astrometry engine will take any image and return the astrometry
23dea7
world coordinate system (WCS), a standards-based description of the
23dea7
transformation between image coordinates and sky coordinates.
23dea7
23dea7
Other tools included in the astrometry package can do much more, like
23dea7
plotting astronomic information over solved images, convertion utilities
23dea7
or generate statistics from FITS images.
23dea7
7e2ef8
f62967
%package data
7e2ef8
Summary:        2MASS catalog index files for astrometry (4208-4129, wide-field)
f62967
License:        GPLv2+
f62967
BuildArch:      noarch
f62967
Requires:       %{name} = %{version}-%{release}
7e2ef8
Provides:       %{name}-data-4208-4219 = %{version}-%{release}
f62967
f62967
%description data
7e2ef8
2MASS index files 4208-4219 (wide-field, 30-2000 arcminutes) for astrometry.
7e2ef8
7e2ef8
7e2ef8
%package data-4204
7e2ef8
Summary:        2MASS catalog index files (4204 series) for astrometry
7e2ef8
License:        GPLv2+
7e2ef8
BuildArch:      noarch
7e2ef8
Requires:       %{name} = %{version}-%{release}
7e2ef8
Enhances:       %{name}
7e2ef8
7e2ef8
%description data-4204
7e2ef8
2MASS index files (4204 series) with 8-11 arcminutes skymarks for astrometry.
7e2ef8
7e2ef8
7e2ef8
%package data-4205
7e2ef8
Summary:        2MASS catalog index files (4205 series) for astrometry
7e2ef8
License:        GPLv2+
7e2ef8
BuildArch:      noarch
7e2ef8
Requires:       %{name} = %{version}-%{release}
7e2ef8
Enhances:       %{name}
7e2ef8
7e2ef8
%description data-4205
7e2ef8
2MASS index files (4205 series) with 11-16 arcminutes skymarks for astrometry.
7e2ef8
7e2ef8
7e2ef8
%package data-4206
7e2ef8
Summary:        2MASS catalog index files (4206 series) for astrometry
7e2ef8
License:        GPLv2+
7e2ef8
BuildArch:      noarch
7e2ef8
Requires:       %{name} = %{version}-%{release}
7e2ef8
Enhances:       %{name}
7e2ef8
7e2ef8
%description data-4206
7e2ef8
2MASS index files (4206 series) with 16-22 arcminutes skymarks for astrometry.
7e2ef8
7e2ef8
7e2ef8
%package data-4207
7e2ef8
Summary:        2MASS catalog index files (4207 series) for astrometry
7e2ef8
License:        GPLv2+
7e2ef8
BuildArch:      noarch
7e2ef8
Requires:       %{name} = %{version}-%{release}
7e2ef8
Enhances:       %{name}
7e2ef8
7e2ef8
%description data-4207
7e2ef8
2MASS index files (4207 series) with 22-30 arcminutes skymarks for astrometry.
7e2ef8
23dea7
23dea7
%package devel
23dea7
Summary:        Development files for %{name}
3d047f
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
23dea7
23dea7
%description devel
23dea7
%{summary}
23dea7
3d047f
%package libs
3d047f
Summary:        Libraries for %{name}
3d047f
3d047f
%description libs
3d047f
Libraries for %{name}
3d047f
3009c0
%package -n python3-%{name}
23dea7
Summary:        Python modules from %{name}
3009c0
Requires:       python3-astropy
23dea7
Provides:       %{name}-python2 = %{version}-%{release}
8f9f44
Obsoletes:      %{name}-python2 < %{version}-%{release}
3009c0
Provides:       python2-%{name} = %{version}-%{release}
3009c0
Obsoletes:      python2-%{name} < %{version}-%{release}
23dea7
3009c0
%description -n python3-%{name}
23dea7
%{summary}
23dea7
23dea7
23dea7
%prep
7e2ef8
%autosetup -p1 -n %{name}.net-%{version}
7e2ef8
%setup -T -D -a 2 -n %{name}.net-%{version}
7e2ef8
%setup -T -D -a 3 -n %{name}.net-%{version}
7e2ef8
%setup -T -D -a 4 -n %{name}.net-%{version}
7e2ef8
%setup -T -D -a 5 -n %{name}.net-%{version}
7e2ef8
%setup -T -D -a 6 -n %{name}.net-%{version}
23dea7
23dea7
# Fix Wrong FSF address - reported upstream
23dea7
# https://groups.google.com/forum/#!topic/astrometry/mCuyze3TOeM
23dea7
grep -rl '59 Temple Place, Suite 330, Boston, MA  02111-1307  USA' * | xargs -i@ sed -i 's/59 Temple Place, Suite 330, Boston, MA  02111-1307  USA/51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA./g' @
23dea7
5c1359
# Python3 compat fix
5c1359
sed -i "s/y = 0L/y = 0/g" util/EXIF.py
23dea7
23dea7
%build
23dea7
# Weird symlink required... (also in upstream git)
23dea7
ln -sf . astrometry
23dea7
23dea7
# Astrometry doesn't automatically find netpbm
23dea7
export NETPBM_INC=-I%{_includedir}/netpbm
23dea7
export NETPBM_LIB="-L%{_libdir} -lnetpbm"
23dea7
23dea7
# Apply mandatory ld flags
23dea7
export LDFLAGS="%__global_ldflags"
23dea7
6122a0
# We use Python3 here
6122a0
export PYTHON=%{__python3}
23dea7
# Parallel make flags on break build
23dea7
make SYSTEM_GSL=yes all py extra ARCH_FLAGS="%{optflags}"
23dea7
23dea7
23dea7
%install
23dea7
%{make_install} SYSTEM_GSL=yes \
23dea7
                INSTALL_DIR=%{buildroot}%{_prefix} \
3009c0
                PYTHON=%{__python3} \
3009c0
                PY_BASE_INSTALL_DIR=%{buildroot}%{python3_sitearch}/%{name} \
23dea7
                INCLUDE_INSTALL_DIR=%{buildroot}%{_includedir}/%{name} \
23dea7
                LIB_INSTALL_DIR=%{buildroot}%{_libdir} \
23dea7
                BIN_INSTALL_DIR=%{buildroot}%{_bindir} \
23dea7
                DATA_INSTALL_DIR=%{buildroot}%{_datadir}/%{name}/data \
3009c0
                PY_BASE_LINK_DIR=%{python3_sitearch}/%{name} \
23dea7
                ETC_INSTALL_DIR=%{buildroot}%{_sysconfdir} \
23dea7
                MAN1_INSTALL_DIR=%{buildroot}%{_mandir}/man1 \
23dea7
                DOC_INSTALL_DIR=%{buildroot}%{_docdir}/%{name} \
23dea7
                EXAMPLE_INSTALL_DIR=%{buildroot}%{_datadir}/%{name}/examples
23dea7
23dea7
# We need to correct the data dir link in config file
23dea7
sed -i \
23dea7
    "s:%{buildroot}%{_prefix}/data:%{_datadir}/%{name}/data:" \
23dea7
    %{buildroot}/etc/astrometry.cfg
23dea7
23dea7
# Rename generic named executables with known conflict
23dea7
pushd %{buildroot}%{_bindir}
23dea7
for exec in tabmerge tablist; do
23dea7
        mv $exec astrometry-$exec
23dea7
done
23dea7
popd
23dea7
23dea7
# Remove unuseful file
23dea7
rm -f %{buildroot}%{_docdir}/%{name}/report.txt
23dea7
23dea7
# We don't ship static libraries so we remove them
23dea7
rm -f %{buildroot}%{_libdir}/*.a
23dea7
23dea7
# Fix wrong python interpreter
23dea7
pushd %{buildroot}%{_bindir}
23dea7
for exec in degtohms image2pnm removelines text2fits hmstodeg votabletofits uniformize merge-columns; do
3009c0
        sed -i "s,/usr/bin/env python,%{__python3},g" $exec
23dea7
done
23dea7
popd
3009c0
find %{buildroot}/%{python3_sitearch}/%{name} -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'
23dea7
23dea7
# LICENSE file is managed by %%license scriptlet
23dea7
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
23dea7
7e2ef8
# Install data files
7e2ef8
install -m0644 astrometry-data*/*.fits %{buildroot}%{_datadir}/%{name}/data
23dea7
23dea7
%check
23dea7
make test ARCH_FLAGS="%{optflags}"
23dea7
23dea7
3d047f
%post libs -p /sbin/ldconfig
3d047f
%postun libs -p /sbin/ldconfig
23dea7
23dea7
23dea7
%files
23dea7
%doc CREDITS README.md
23dea7
%license LICENSE
23dea7
%{_mandir}/man1/*
23dea7
%{_bindir}/*
23dea7
%exclude %{_bindir}/*.py
23dea7
%dir %{_datadir}/astrometry
23dea7
%dir %{_datadir}/astrometry/data
23dea7
%{_datadir}/astrometry/examples
23dea7
%config(noreplace) %{_sysconfdir}/astrometry.cfg
23dea7
f62967
%files data
7e2ef8
%license astrometry-data-4208-4219/LICENSE
7e2ef8
%{_datadir}/astrometry/data/index-4208.fits
7e2ef8
%{_datadir}/astrometry/data/index-4209.fits
7e2ef8
%{_datadir}/astrometry/data/index-421*.fits
7e2ef8
7e2ef8
%files data-4204
7e2ef8
%license astrometry-data-4204/LICENSE
7e2ef8
%{_datadir}/astrometry/data/index-4204*.fits
7e2ef8
7e2ef8
%files data-4205
7e2ef8
%license astrometry-data-4205/LICENSE
7e2ef8
%{_datadir}/astrometry/data/index-4205*.fits
7e2ef8
7e2ef8
%files data-4206
7e2ef8
%license astrometry-data-4206/LICENSE
7e2ef8
%{_datadir}/astrometry/data/index-4206*.fits
7e2ef8
7e2ef8
%files data-4207
7e2ef8
%license astrometry-data-4207/LICENSE
7e2ef8
%{_datadir}/astrometry/data/index-4207*.fits
f62967
23dea7
%files devel
23dea7
%{_includedir}/*
23dea7
%{_libdir}/*.so
23dea7
3d047f
%files libs
3d047f
%license LICENSE
3d047f
%{_libdir}/*.so.*
3d047f
3009c0
%files -n python3-%{name}
3009c0
%{python3_sitearch}/*
23dea7
%{_bindir}/*.py
23dea7
23dea7
%changelog
071670
* Sat Jul 14 2018 Christian Dersch <lupinix@fedoraproject.org> - 0.74-3
3009c0
- Switch to Python 3
071670
- BuildRequires: gcc
071670
3e0a28
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.74-2
3e0a28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
3e0a28
43b7a2
* Sat May 26 2018 Christian Dersch <lupinix@mailbox.org> - 0.74-1
43b7a2
- new version
43b7a2
8e85c1
* Sat May 26 2018 Christian Dersch <lupinix@mailbox.org> - 0.73-5
8e85c1
- rebuilt for cfitsio 3.450
8e85c1
83b02a
* Sat Feb 24 2018 Christian Dersch <lupinix@mailbox.org> - 0.73-4
83b02a
- rebuilt for cfitsio 3.420 (so version bump)
83b02a
364fc6
* Wed Feb 14 2018 Christian Dersch <lupinix@mailbox.org> - 0.73-3
364fc6
- rebuilt
364fc6
f8bea8
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.73-2
f8bea8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
f8bea8
dfec9b
* Fri Nov 17 2017 Christian Dersch <lupinix@mailbox.org> - 0.73-1
dfec9b
- new version
dfec9b
7e2ef8
* Tue Oct 17 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-4
7e2ef8
- Added subpackages for 4204-4207 index files
7e2ef8
f62967
* Mon Oct 16 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-3
f62967
- Added data subpackage containing the wide-field 2MASS indices
f62967
3d047f
* Mon Sep 25 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-2
3d047f
- Move libs to subpackage to be multiarch compatible
3d047f
8f9f44
* Tue Sep 12 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-1
8f9f44
- Initial SCM import (#1470436)
8f9f44
23dea7
* Wed Jul 12 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-0.1
23dea7
- initial spec (using the packaging effort from Mattia Verga, RHBZ  #1299139)
23dea7