23dea7f
# Bootstrap option, we have to build astrometry before we can generate index
23dea7f
# files, but later package will require them for tests at build time
23dea7f
%global bootstrap 1
23dea7f
1a0dd30
# Parallel make flags on break build
1a0dd30
%global _smp_build_ncpus 1
1a0dd30
23dea7f
23dea7f
Name:           astrometry
ea1160f
Version:        0.94
ea1160f
Release:        1%{?dist}
23dea7f
Summary:        Blind astrometric calibration of arbitrary astronomical images
23dea7f
23dea7f
# Software is BSD with some GPL code
23dea7f
# https://groups.google.com/forum/#!topic/astrometry/9GgP7rj4Y-g
23dea7f
# Here we asked to fix source headers:
23dea7f
# https://groups.google.com/forum/#!topic/astrometry/mCuyze3TOeM
23dea7f
# 
23dea7f
# Licensing breakdown
23dea7f
# ===================
23dea7f
#
23dea7f
# See also: file CREDITS in source folder
23dea7f
#
23dea7f
# General license for astrometry code: 3-clause BSD
23dea7f
#
23dea7f
# GPLv2+:
23dea7f
#    qfits-an/*
23dea7f
#    include/astrometry/qfits*
23dea7f
#    catalogs/ucac4-fits.h
23dea7f
#    util/makefile.jpeg
23dea7f
#    util/md5.c
23dea7f
#    Makefile
23dea7f
#    doc/UCAC3_guide/* (not used for build and not shipped)
23dea7f
#    doc/UCAC4_guide/* (not used for build and not shipped)
f629677
#    
f629677
#    2MASS data files index-42xx.fits
23dea7f
#
23dea7f
# GPLv3+:
23dea7f
#    blind/an_mm_malloc.h
23dea7f
#    util/ctmf.c
23dea7f
#
ea1160f
License:        BSD-3-Clause and GPL-2.0-or-later and GPL-3.0-or-later
23dea7f
URL:            http://www.astrometry.net
23dea7f
23dea7f
# Upstream sources contains nonfree stuff so we must clean them
23dea7f
# Download original sources from:
ea1160f
# Source0:        https://github.com/dstndstn/%%{name}.net/releases/download/%%{version}/%%{name}.net-%%{version}.tar.gz
23dea7f
# Then use the provided script to clean them with
426655e
# ./astrometry-generate-tarball %%{version}
23dea7f
Source0:        %{name}.net-%{version}-clean.tar.xz
23dea7f
Source1:        %{name}-generate-tarball.sh
23dea7f
7e2ef85
# 2MASS data files, ./astrometry-get-data.sh
7e2ef85
Source2:        astrometry-data-4204.tar.xz
7e2ef85
Source3:        astrometry-data-4205.tar.xz
7e2ef85
Source4:        astrometry-data-4206.tar.xz
7e2ef85
Source5:        astrometry-data-4207.tar.xz
7e2ef85
Source6:        astrometry-data-4208-4219.tar.xz
7e2ef85
Source7:        astrometry-get-data.sh
f629677
426655e
# Patches from Ole Streicher <olebole@debian.org> used on Debian
d55c552
Patch:          %{name}-0.89_Add-SONAME-to-libastrometry.so.patch
d55c552
Patch:          %{name}-0.89_Dynamically-link-to-libastrometry.so-when-possible.patch
d55c552
Patch:          %{name}-0.89_Fix-issues-when-using-Debian-libs-instead-of-convienience.patch
d55c552
Patch:          %{name}-0.91_Fix-shared-lib-flags-so-that-the-package-can-be-built-on-.patch
d55c552
Patch:          %{name}-0.89_Don-t-copy-demo-files-to-examples.patch
d55c552
Patch:          %{name}-0.89_Remove-errornous-generation-of-net-client.py.patch
23dea7f
071670c
BuildRequires:  gcc
426655e
BuildRequires:  make
23dea7f
BuildRequires:  netpbm-devel
3009c0e
BuildRequires:  python3-numpy
3009c0e
BuildRequires:  python3-astropy
3009c0e
BuildRequires:  python3-devel
23dea7f
BuildRequires:  swig
23dea7f
BuildRequires:  xorg-x11-proto-devel
23dea7f
23dea7f
BuildRequires:  pkgconfig
23dea7f
BuildRequires:  pkgconfig(cairo)
23dea7f
BuildRequires:  pkgconfig(cfitsio)
23dea7f
BuildRequires:  pkgconfig(fontconfig)
23dea7f
BuildRequires:  pkgconfig(gsl)
23dea7f
BuildRequires:  pkgconfig(libjpeg)
23dea7f
BuildRequires:  pkgconfig(libpng)
23dea7f
BuildRequires:  pkgconfig(wcslib)
23dea7f
BuildRequires:  pkgconfig(xrender)
23dea7f
BuildRequires:  pkgconfig(zlib)
23dea7f
23dea7f
%if ! 0%{?bootstrap}
23dea7f
BuildRequires:  astrometry-tycho2
23dea7f
%endif
23dea7f
f629677
Requires:       %{name}-data = %{version}-%{release}
3d047f1
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
23dea7f
Requires:       netpbm-progs
9cffeba
Requires:       python3-%{name} = %{version}-%{release}
23dea7f
8f9f443
# User could use own set of index files or another set from upstream.
f629677
# Therefore we suggest and not require astrometry-tycho2 here
426655e
Suggests:       astrometry-tycho2
426655e
426655e
Provides:       bundled(libkd)
426655e
Provides:       bundled(qfits)
23dea7f
2778f1a
# FIXME
2778f1a
# Kill s390x build for now, s390x build seems unknown
2778f1a
# "cpio: read failed - Inappropriate ioctl for device" error
2778f1a
# when unpacking srpm
426655e
# ExcludeArch:	s390x
2778f1a
23dea7f
%description
23dea7f
The astrometry engine will take any image and return the astrometry
23dea7f
world coordinate system (WCS), a standards-based description of the
23dea7f
transformation between image coordinates and sky coordinates.
23dea7f
23dea7f
Other tools included in the astrometry package can do much more, like
23dea7f
plotting astronomic information over solved images, convertion utilities
23dea7f
or generate statistics from FITS images.
23dea7f
7e2ef85
f629677
%package data
7e2ef85
Summary:        2MASS catalog index files for astrometry (4208-4129, wide-field)
f629677
License:        GPLv2+
f629677
BuildArch:      noarch
f629677
Requires:       %{name} = %{version}-%{release}
7e2ef85
Provides:       %{name}-data-4208-4219 = %{version}-%{release}
f629677
f629677
%description data
7e2ef85
2MASS index files 4208-4219 (wide-field, 30-2000 arcminutes) for astrometry.
7e2ef85
7e2ef85
7e2ef85
%package data-4204
7e2ef85
Summary:        2MASS catalog index files (4204 series) for astrometry
7e2ef85
License:        GPLv2+
7e2ef85
BuildArch:      noarch
7e2ef85
Requires:       %{name} = %{version}-%{release}
7e2ef85
Enhances:       %{name}
7e2ef85
7e2ef85
%description data-4204
7e2ef85
2MASS index files (4204 series) with 8-11 arcminutes skymarks for astrometry.
7e2ef85
7e2ef85
7e2ef85
%package data-4205
7e2ef85
Summary:        2MASS catalog index files (4205 series) for astrometry
7e2ef85
License:        GPLv2+
7e2ef85
BuildArch:      noarch
7e2ef85
Requires:       %{name} = %{version}-%{release}
7e2ef85
Enhances:       %{name}
7e2ef85
7e2ef85
%description data-4205
7e2ef85
2MASS index files (4205 series) with 11-16 arcminutes skymarks for astrometry.
7e2ef85
7e2ef85
7e2ef85
%package data-4206
7e2ef85
Summary:        2MASS catalog index files (4206 series) for astrometry
7e2ef85
License:        GPLv2+
7e2ef85
BuildArch:      noarch
7e2ef85
Requires:       %{name} = %{version}-%{release}
7e2ef85
Enhances:       %{name}
7e2ef85
7e2ef85
%description data-4206
7e2ef85
2MASS index files (4206 series) with 16-22 arcminutes skymarks for astrometry.
7e2ef85
7e2ef85
7e2ef85
%package data-4207
7e2ef85
Summary:        2MASS catalog index files (4207 series) for astrometry
7e2ef85
License:        GPLv2+
7e2ef85
BuildArch:      noarch
7e2ef85
Requires:       %{name} = %{version}-%{release}
7e2ef85
Enhances:       %{name}
7e2ef85
7e2ef85
%description data-4207
7e2ef85
2MASS index files (4207 series) with 22-30 arcminutes skymarks for astrometry.
7e2ef85
23dea7f
23dea7f
%package devel
23dea7f
Summary:        Development files for %{name}
3d047f1
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
23dea7f
23dea7f
%description devel
23dea7f
%{summary}
23dea7f
3d047f1
%package libs
3d047f1
Summary:        Libraries for %{name}
3d047f1
3d047f1
%description libs
3d047f1
Libraries for %{name}
3d047f1
3009c0e
%package -n python3-%{name}
23dea7f
Summary:        Python modules from %{name}
3009c0e
Requires:       python3-astropy
23dea7f
3009c0e
%description -n python3-%{name}
23dea7f
%{summary}
23dea7f
23dea7f
23dea7f
%prep
7e2ef85
%autosetup -p1 -n %{name}.net-%{version}
7e2ef85
%setup -T -D -a 2 -n %{name}.net-%{version}
7e2ef85
%setup -T -D -a 3 -n %{name}.net-%{version}
7e2ef85
%setup -T -D -a 4 -n %{name}.net-%{version}
7e2ef85
%setup -T -D -a 5 -n %{name}.net-%{version}
7e2ef85
%setup -T -D -a 6 -n %{name}.net-%{version}
23dea7f
23dea7f
23dea7f
%build
23dea7f
# Weird symlink required... (also in upstream git)
23dea7f
ln -sf . astrometry
23dea7f
23dea7f
# Astrometry doesn't automatically find netpbm
23dea7f
export NETPBM_INC=-I%{_includedir}/netpbm
23dea7f
export NETPBM_LIB="-L%{_libdir} -lnetpbm"
23dea7f
23dea7f
# Parallel make flags on break build
426655e
make SYSTEM_GSL=yes all py extra \
426655e
    ARCH_FLAGS="%{optflags}"
23dea7f
23dea7f
23dea7f
%install
d55c552
%make_install SYSTEM_GSL=yes \
d55c552
              INSTALL_DIR=%{buildroot}%{_prefix} \
d55c552
              PY_BASE_INSTALL_DIR=%{buildroot}%{python3_sitearch}/%{name} \
d55c552
              INCLUDE_INSTALL_DIR=%{buildroot}%{_includedir}/%{name} \
d55c552
              LIB_INSTALL_DIR=%{buildroot}%{_libdir} \
d55c552
              BIN_INSTALL_DIR=%{buildroot}%{_bindir} \
d55c552
              DATA_INSTALL_DIR=%{buildroot}%{_datadir}/%{name}/data \
d55c552
              PY_BASE_LINK_DIR=%{python3_sitearch}/%{name} \
d55c552
              ETC_INSTALL_DIR=%{buildroot}%{_sysconfdir} \
d55c552
              MAN1_INSTALL_DIR=%{buildroot}%{_mandir}/man1 \
d55c552
              DOC_INSTALL_DIR=%{buildroot}%{_docdir}/%{name} \
d55c552
              EXAMPLE_INSTALL_DIR=%{buildroot}%{_datadir}/%{name}/examples
23dea7f
23dea7f
# We need to correct the data dir link in config file
23dea7f
sed -i \
23dea7f
    "s:%{buildroot}%{_prefix}/data:%{_datadir}/%{name}/data:" \
23dea7f
    %{buildroot}/etc/astrometry.cfg
23dea7f
23dea7f
# Rename generic named executables with known conflict
23dea7f
pushd %{buildroot}%{_bindir}
23dea7f
for exec in tabmerge tablist; do
23dea7f
        mv $exec astrometry-$exec
23dea7f
done
23dea7f
popd
23dea7f
426655e
# Fix python shebangs
d55c552
%py3_shebang_fix %{buildroot}%{_bindir}/degtohms \
d55c552
                 %{buildroot}%{_bindir}/hmstodeg \
d55c552
                 %{buildroot}%{_bindir}/image2pnm \
d55c552
                 %{buildroot}%{_bindir}/merge-columns \
d55c552
                 %{buildroot}%{_bindir}/removelines \
d55c552
                 %{buildroot}%{_bindir}/text2fits \
d55c552
                 %{buildroot}%{_bindir}/uniformize \
d55c552
                 %{buildroot}%{_bindir}/votabletofits
426655e
23dea7f
# Remove unuseful file
23dea7f
rm -f %{buildroot}%{_docdir}/%{name}/report.txt
23dea7f
23dea7f
# We don't ship static libraries so we remove them
23dea7f
rm -f %{buildroot}%{_libdir}/*.a
23dea7f
23dea7f
# LICENSE file is managed by %%license scriptlet
23dea7f
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
23dea7f
d55c552
# Remove symlink in bin to python script
d55c552
rm -f %{buildroot}%{_bindir}/plotann.py
d55c552
7e2ef85
# Install data files
7e2ef85
install -m0644 astrometry-data*/*.fits %{buildroot}%{_datadir}/%{name}/data
23dea7f
23dea7f
%check
c082478
export PYTHON=%{__python3}
23dea7f
make test ARCH_FLAGS="%{optflags}"
23dea7f
23dea7f
23dea7f
%files
23dea7f
%doc CREDITS README.md
23dea7f
%license LICENSE
23dea7f
%{_mandir}/man1/*
23dea7f
%{_bindir}/*
426655e
# Exclude python scripts
426655e
%exclude %{_bindir}/degtohms
426655e
%exclude %{_bindir}/hmstodeg
426655e
%exclude %{_bindir}/image2pnm
426655e
%exclude %{_bindir}/merge-columns
426655e
%exclude %{_bindir}/removelines
426655e
%exclude %{_bindir}/text2fits
426655e
%exclude %{_bindir}/uniformize
426655e
%exclude %{_bindir}/votabletofits
23dea7f
%dir %{_datadir}/astrometry
23dea7f
%dir %{_datadir}/astrometry/data
23dea7f
%{_datadir}/astrometry/examples
23dea7f
%config(noreplace) %{_sysconfdir}/astrometry.cfg
23dea7f
f629677
%files data
7e2ef85
%license astrometry-data-4208-4219/LICENSE
7e2ef85
%{_datadir}/astrometry/data/index-4208.fits
7e2ef85
%{_datadir}/astrometry/data/index-4209.fits
7e2ef85
%{_datadir}/astrometry/data/index-421*.fits
7e2ef85
7e2ef85
%files data-4204
7e2ef85
%license astrometry-data-4204/LICENSE
7e2ef85
%{_datadir}/astrometry/data/index-4204*.fits
7e2ef85
7e2ef85
%files data-4205
7e2ef85
%license astrometry-data-4205/LICENSE
7e2ef85
%{_datadir}/astrometry/data/index-4205*.fits
7e2ef85
7e2ef85
%files data-4206
7e2ef85
%license astrometry-data-4206/LICENSE
7e2ef85
%{_datadir}/astrometry/data/index-4206*.fits
7e2ef85
7e2ef85
%files data-4207
7e2ef85
%license astrometry-data-4207/LICENSE
7e2ef85
%{_datadir}/astrometry/data/index-4207*.fits
f629677
23dea7f
%files devel
23dea7f
%{_includedir}/*
23dea7f
%{_libdir}/*.so
23dea7f
3d047f1
%files libs
3d047f1
%license LICENSE
426655e
%{_libdir}/*.so.0*
3d047f1
3009c0e
%files -n python3-%{name}
426655e
%{python3_sitearch}/%{name}
426655e
%{_bindir}/degtohms
426655e
%{_bindir}/hmstodeg
426655e
%{_bindir}/image2pnm
426655e
%{_bindir}/merge-columns
426655e
%{_bindir}/removelines
426655e
%{_bindir}/text2fits
426655e
%{_bindir}/uniformize
426655e
%{_bindir}/votabletofits
23dea7f
23dea7f
%changelog
ea1160f
* Sun Sep 17 2023 Mattia Verga <mattia.verga@protonmail.com> - 0.94-1
ea1160f
- Update to 0.94 (fedora#2148995)
ea1160f
- Migrate license to SPDX
ea1160f
c27927e
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.91-5
c27927e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
c27927e
0e7c694
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 0.91-4
0e7c694
- Rebuilt for Python 3.12
0e7c694
cfd2563
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.91-3
cfd2563
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
cfd2563
cc837aa
* Thu Dec 29 2022 Maxwell G <gotmax@e.email> - 0.91-2
cc837aa
- Rebuild for cfitsio 4.2
cc837aa
1a0dd30
* Tue Nov 01 2022 Mattia Verga <mattia.verga@proton.me> - 0.91-1
1a0dd30
- Update to 0.91 (fedora#2078037)
1a0dd30
693207b
* Tue Aug 23 2022 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.89-4
693207b
- Rebuild for gsl-2.7.1
693207b
d533b98
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.89-3
d533b98
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
d533b98
2603669
* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 0.89-2
2603669
- Rebuilt for Python 3.11
2603669
426655e
* Sun Feb 06 2022 Mattia Verga <mattia.verga@protonmail.com> - 0.89-1
426655e
- Update to 0.89 (fedora#1828169)
426655e
7f2e808
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.78-13
7f2e808
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
7f2e808
2d8a41d
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.78-12
2d8a41d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
2d8a41d
18fd1bd
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.78-11
18fd1bd
- Rebuilt for Python 3.10
18fd1bd
12b552b
* Tue Feb 02 2021 Christian Dersch <lupinix@mailbox.org> - 0.78-10
12b552b
- Rebuilt for libcfitsio.so.7
12b552b
c2d79c9
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.78-9
c2d79c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
c2d79c9
af47177
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.78-8
af47177
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
af47177
d0f816b
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.78-7
d0f816b
- Rebuilt for Python 3.9
d0f816b
238634b
* Wed Mar 25 2020 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.78-6
238634b
- Rebuild for new wcslib
238634b
438692c
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.78-6
438692c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
438692c
22433d3
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.78-5
22433d3
- Rebuilt for Python 3.8.0rc1 (#1748018)
22433d3
39cdc6d
* Tue Aug 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 0.78-4
39cdc6d
- Rebuilt for GSL 2.6.
39cdc6d
a43935a
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.78-3
a43935a
- Rebuilt for Python 3.8
a43935a
5a3137b
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.78-2
5a3137b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
5a3137b
cd26754
* Sun Apr 28 2019 Christian Dersch <lupinix@mailbox.org> - 0.78-1
cd26754
- new version
cd26754
1e4cb02
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.76-2
1e4cb02
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
1e4cb02
f2392e4
* Wed Oct 10 2018 Christian Dersch <lupinix.fedora@gmail.com> - 0.76-1
f2392e4
- new version
f2392e4
9cffeba
* Mon Jul 16 2018 Christian Dersch <lupinix.fedora@gmail.com> - 0.75-2
9cffeba
- Dependency fix, require python3-astrometry, not python2-astrometry
9cffeba
2a3c8fd
* Sat Jul 14 2018 Christian Dersch <lupinix@fedoraproject.org> - 0.75-1
2a3c8fd
- new version
2a3c8fd
071670c
* Sat Jul 14 2018 Christian Dersch <lupinix@fedoraproject.org> - 0.74-3
3009c0e
- Switch to Python 3
071670c
- BuildRequires: gcc
071670c
3e0a28a
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.74-2
3e0a28a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
3e0a28a
43b7a2a
* Sat May 26 2018 Christian Dersch <lupinix@mailbox.org> - 0.74-1
43b7a2a
- new version
43b7a2a
8e85c14
* Sat May 26 2018 Christian Dersch <lupinix@mailbox.org> - 0.73-5
8e85c14
- rebuilt for cfitsio 3.450
8e85c14
83b02ae
* Sat Feb 24 2018 Christian Dersch <lupinix@mailbox.org> - 0.73-4
83b02ae
- rebuilt for cfitsio 3.420 (so version bump)
83b02ae
364fc67
* Wed Feb 14 2018 Christian Dersch <lupinix@mailbox.org> - 0.73-3
364fc67
- rebuilt
364fc67
f8bea85
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.73-2
f8bea85
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
f8bea85
dfec9bc
* Fri Nov 17 2017 Christian Dersch <lupinix@mailbox.org> - 0.73-1
dfec9bc
- new version
dfec9bc
7e2ef85
* Tue Oct 17 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-4
7e2ef85
- Added subpackages for 4204-4207 index files
7e2ef85
f629677
* Mon Oct 16 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-3
f629677
- Added data subpackage containing the wide-field 2MASS indices
f629677
3d047f1
* Mon Sep 25 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-2
3d047f1
- Move libs to subpackage to be multiarch compatible
3d047f1
8f9f443
* Tue Sep 12 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-1
8f9f443
- Initial SCM import (#1470436)
8f9f443
23dea7f
* Wed Jul 12 2017 Christian Dersch <lupinix@mailbox.org> - 0.72-0.1
23dea7f
- initial spec (using the packaging effort from Mattia Verga, RHBZ  #1299139)
23dea7f