Blame astrometry.spec

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
23dea7f
23dea7f
Name:           astrometry
cd26754
Version:        0.78
af47177
Release:        8%{?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
#    libkd/an-fls.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
#
23dea7f
License:        BSD and GPLv2+ and GPLv3+
23dea7f
URL:            http://www.astrometry.net
23dea7f
23dea7f
# Upstream sources contains nonfree stuff so we must clean them
23dea7f
# Download original sources from:
23dea7f
# Source0:        http://astrometry.net/downloads/%%{name}.net-%%{version}.tar.gz
23dea7f
# Then use the provided script to clean them with
23dea7f
# ./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
23dea7f
# Patches from Ole Streicher <olebole@debian.org> used on Debian to
23dea7f
#  * disable build of nonfree stuff removed from sources
23dea7f
#  * have a proper versioned soname
23dea7f
#  * use system libraries properly
23dea7f
#  * use dynamical linking
9df6897
Patch0:         %{name}-0.73-Add-SONAME-to-libastrometry.so.patch
23dea7f
Patch1:         %{name}-Dynamically-link-to-libastrometry.so-when-possible.patch
23dea7f
Patch2:         %{name}-Fix-issues-when-using-Debian-libs-instead-of-convienience.patch
23dea7f
Patch3:         %{name}-Call-python-scripts-as-modules-instead-of-executables.patch
81cd19f
Patch4:         %{name}-0.73-Don-t-install-non-free-files-images-and-NGC2000.0-catalog.patch
23dea7f
071670c
BuildRequires:  gcc
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)
426ca79
BuildRequires:  make
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
f629677
Suggests:     astrometry-tycho2
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
2778f1a
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
Provides:       %{name}-python2 = %{version}-%{release}
8f9f443
Obsoletes:      %{name}-python2 < %{version}-%{release}
3009c0e
Provides:       python2-%{name} = %{version}-%{release}
3009c0e
Obsoletes:      python2-%{name} < %{version}-%{release}
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
# Fix Wrong FSF address - reported upstream
23dea7f
# https://groups.google.com/forum/#!topic/astrometry/mCuyze3TOeM
23dea7f
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' @
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
# Apply mandatory ld flags
23dea7f
export LDFLAGS="%__global_ldflags"
23dea7f
6122a0e
# We use Python3 here
6122a0e
export PYTHON=%{__python3}
23dea7f
# Parallel make flags on break build
23dea7f
make SYSTEM_GSL=yes all py extra ARCH_FLAGS="%{optflags}"
23dea7f
23dea7f
23dea7f
%install
c082478
export PYTHON=%{__python3}
23dea7f
%{make_install} SYSTEM_GSL=yes \
23dea7f
                INSTALL_DIR=%{buildroot}%{_prefix} \
3009c0e
                PY_BASE_INSTALL_DIR=%{buildroot}%{python3_sitearch}/%{name} \
23dea7f
                INCLUDE_INSTALL_DIR=%{buildroot}%{_includedir}/%{name} \
23dea7f
                LIB_INSTALL_DIR=%{buildroot}%{_libdir} \
23dea7f
                BIN_INSTALL_DIR=%{buildroot}%{_bindir} \
23dea7f
                DATA_INSTALL_DIR=%{buildroot}%{_datadir}/%{name}/data \
3009c0e
                PY_BASE_LINK_DIR=%{python3_sitearch}/%{name} \
23dea7f
                ETC_INSTALL_DIR=%{buildroot}%{_sysconfdir} \
23dea7f
                MAN1_INSTALL_DIR=%{buildroot}%{_mandir}/man1 \
23dea7f
                DOC_INSTALL_DIR=%{buildroot}%{_docdir}/%{name} \
23dea7f
                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
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
# Fix wrong python interpreter
23dea7f
pushd %{buildroot}%{_bindir}
23dea7f
for exec in degtohms image2pnm removelines text2fits hmstodeg votabletofits uniformize merge-columns; do
3009c0e
        sed -i "s,/usr/bin/env python,%{__python3},g" $exec
23dea7f
done
23dea7f
popd
3009c0e
find %{buildroot}/%{python3_sitearch}/%{name} -name '*.py' | xargs sed -i '1s|^#!.*|#!%{__python3}|'
23dea7f
23dea7f
# LICENSE file is managed by %%license scriptlet
23dea7f
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
23dea7f
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
a3df987
%ldconfig_scriptlets libs
23dea7f
23dea7f
23dea7f
%files
23dea7f
%doc CREDITS README.md
23dea7f
%license LICENSE
23dea7f
%{_mandir}/man1/*
23dea7f
%{_bindir}/*
23dea7f
%exclude %{_bindir}/*.py
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
3d047f1
%{_libdir}/*.so.*
3d047f1
3009c0e
%files -n python3-%{name}
3009c0e
%{python3_sitearch}/*
23dea7f
%{_bindir}/*.py
23dea7f
23dea7f
%changelog
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