Mattia Verga 4f66b0e
Name:           phd2
Mattia Verga 4f66b0e
Version:        2.6.4
Mattia Verga 4f66b0e
Release:        3%{?dist}
Mattia Verga 4f66b0e
Summary:        Telescope guiding software
Mattia Verga 4f66b0e
# Main program files are BSD licensed
Mattia Verga 4f66b0e
# Some components have different licenses:
Mattia Verga 4f66b0e
# QHY camera headers are GPLv2+
Mattia Verga 4f66b0e
# SX camera headers are ICU
Mattia Verga 4f66b0e
# INDI GUI is LGPLv2+
Mattia Verga 4f66b0e
License:        BSD and (GPLv2+ and MIT and LGPLv2+)
Mattia Verga 4f66b0e
URL:            http://openphdguiding.org/
Mattia Verga 4f66b0e
# Download upstream tarball from
Mattia Verga 4f66b0e
# https://github.com/OpenPHDGuiding/%%{name}/archive/v%%{version}.tar.gz
Mattia Verga 4f66b0e
# and then run ./generate-tarball.sh %%{version}
Mattia Verga 4f66b0e
Source0:        %{name}-%{version}-purged.tar.xz
Mattia Verga 4f66b0e
# Script to purge binaries and unneeded files from downloaded sources
Mattia Verga 4f66b0e
Source1:        generate-tarball.sh
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
# Correct appdata files location
Mattia Verga 4f66b0e
# https://github.com/OpenPHDGuiding/phd2/pull/658
Mattia Verga 4f66b0e
Patch1:         phd2_appdata_location_change.patch
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
# Use C++14 flag
Mattia Verga 4f66b0e
Patch99:        phd2_cflags.patch
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
# We need to disable camera firmwares we removed from sources
Mattia Verga 4f66b0e
# This is Fedora specific and not reported upstream
Mattia Verga 4f66b0e
Patch100:       phd2_disable_cams.patch
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
BuildRequires:  cmake
Mattia Verga 4f66b0e
BuildRequires:  desktop-file-utils
Mattia Verga 4f66b0e
BuildRequires:  dos2unix
Mattia Verga 4f66b0e
BuildRequires:  extra-cmake-modules
Mattia Verga 4f66b0e
BuildRequires:  gettext
Mattia Verga 4f66b0e
BuildRequires:  gtest-devel
Mattia Verga 4f66b0e
BuildRequires:  libappstream-glib
Mattia Verga 4f66b0e
BuildRequires:  libindi-static
Mattia Verga 4f66b0e
BuildRequires:  libnova-devel
Mattia Verga 4f66b0e
BuildRequires:  wxGTK3-devel
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
BuildRequires:  pkgconfig(cfitsio)
Mattia Verga 4f66b0e
BuildRequires:  pkgconfig(eigen3)
Mattia Verga 4f66b0e
BuildRequires:  pkgconfig(libcurl)
Mattia Verga 4f66b0e
BuildRequires:  pkgconfig(libindi)
Mattia Verga 4f66b0e
BuildRequires:  pkgconfig(libusb-1.0)
Mattia Verga 4f66b0e
BuildRequires:  pkgconfig(zlib)
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
Recommends:     libindi
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%description
Mattia Verga 4f66b0e
PHD2 is telescope guiding software that simplifies the process of tracking
Mattia Verga 4f66b0e
a guide star, letting you concentrate on other aspects of deep-sky imaging
Mattia Verga 4f66b0e
or spectroscopy.
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%prep
Mattia Verga 4f66b0e
%autosetup -p1
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
# Remove spurious executable bit set on icons and docs
Mattia Verga 4f66b0e
find icons -type f -print0 |xargs -0 chmod -x
Mattia Verga 4f66b0e
chmod -x PHD_2.0_Architecture.docx
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
# Fix line ending
Mattia Verga 4f66b0e
dos2unix README-PHD2.txt
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%build
Mattia Verga 4f66b0e
mkdir -p %{_target_platform}
Mattia Verga 4f66b0e
pushd %{_target_platform}
Mattia Verga 4f66b0e
%{cmake} -DUSE_SYSTEM_CFITSIO=ON \
Mattia Verga 4f66b0e
            -DUSE_SYSTEM_LIBUSB=ON \
Mattia Verga 4f66b0e
            -DUSE_SYSTEM_EIGEN3=ON \
Mattia Verga 4f66b0e
            -DUSE_SYSTEM_GTEST=ON ..
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%make_build
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%install
Mattia Verga 4f66b0e
pushd %{_target_platform}
Mattia Verga 4f66b0e
%make_install
Mattia Verga 4f66b0e
popd
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%find_lang %{name}
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%check
Mattia Verga 4f66b0e
# Tests are failing on x86 with GCC7
Mattia Verga 4f66b0e
# https://github.com/OpenPHDGuiding/phd2/issues/608
Mattia Verga 4f66b0e
%ifnarch %{ix86}
Mattia Verga 4f66b0e
make test -C %{_target_platform}
Mattia Verga 4f66b0e
%endif
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
Mattia Verga 4f66b0e
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/%{name}.appdata.xml
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%post
Mattia Verga 4f66b0e
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%postun
Mattia Verga 4f66b0e
if [ $1 -eq 0 ] ; then
Mattia Verga 4f66b0e
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
Mattia Verga 4f66b0e
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
Mattia Verga 4f66b0e
fi
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%posttrans
Mattia Verga 4f66b0e
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%files -f %{name}.lang
Mattia Verga 4f66b0e
%doc README.txt README-PHD2.txt PHD_2.0_Architecture.docx
Mattia Verga 4f66b0e
%license LICENSE.txt
Mattia Verga 4f66b0e
%{_bindir}/*
Mattia Verga 4f66b0e
%{_datadir}/metainfo/%{name}.appdata.xml
Mattia Verga 4f66b0e
%{_datadir}/applications/%{name}.desktop
Mattia Verga 4f66b0e
%{_datadir}/phd2/
Mattia Verga 4f66b0e
%{_datadir}/pixmaps/*
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
%changelog
Mattia Verga 4f66b0e
* Sun Nov 05 2017 Mattia Verga <mattia.verga@email.it> - 2.6.4-3
Mattia Verga 4f66b0e
- Fix spurious exec bits and line endings
Mattia Verga 4f66b0e
- Use more macros
Mattia Verga 4f66b0e
- Purge another unneeded directory from sources
Mattia Verga 4f66b0e
- Use C++14 flag
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
* Sat Nov 04 2017 Mattia Verga <mattia.verga@email.it> - 2.6.4-2
Mattia Verga 4f66b0e
- Breakdown components licenses
Mattia Verga 4f66b0e
- Add some useful docs
Mattia Verga 4f66b0e
- Add weak dependency to libindi
Mattia Verga 4f66b0e
Mattia Verga 4f66b0e
* Thu Nov 02 2017 Mattia Verga <mattia.verga@email.it> - 2.6.4-1
Mattia Verga 4f66b0e
- Initial packaging