Blob Blame History Raw
%global gittag v2.6.13
#%%global commit a205f63238c8505cf641057d8d82734e51f9ab15
#%%global shortcommit %%(c=%%{commit}; echo ${c:0:7})
#%%global date 20230212

Name:           phd2
%if "%{?gittag}"
Version:        2.6.13
Version:        2.6.11^dev4^%{date}%{shortcommit}
Release:        %autorelease
Summary:        Telescope guiding software
License:        BSD-3-Clause AND LGPL-2.1-or-later AND ICU
%if "%{?gittag}"
# Download upstream tarball from
# and then run ./ %%{version}
Source0:        %{name}-%{version}-purged.tar.xz
# Download upstream tarball from
# and then run ./ %%{commit}
Source0:        %{name}-%{commit}-purged.tar.xz
# Script to purge binaries and unneeded files from downloaded sources

# Do not force c++ std
Patch99:        phd2_2.9.10_std_cflags.patch

ExcludeArch:    %{ix86}

BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  dos2unix
BuildRequires:  extra-cmake-modules
BuildRequires:  gettext
BuildRequires:  gtest-devel
BuildRequires:  libappstream-glib
BuildRequires:  libindi-static
BuildRequires:  libnova-devel
BuildRequires:  wxGTK-devel

BuildRequires:  pkgconfig(cfitsio)
BuildRequires:  pkgconfig(eigen3)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libindi) >= 1.5
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  pkgconfig(zlib)

Recommends:     libindi

PHD2 is telescope guiding software that simplifies the process of tracking
a guide star, letting you concentrate on other aspects of deep-sky imaging
or spectroscopy.

%if "%{?gittag}"
%autosetup -p1
%autosetup -n %{name}-%{commit} -p1

# Remove spurious executable bit set on icons and docs
find icons -type f -print0 |xargs -0 chmod -x
chmod -x PHD_2.0_Architecture.docx

            -DUSE_SYSTEM_LIBUSB=ON \
            -DUSE_SYSTEM_EIGEN3=ON \
            -DUSE_SYSTEM_GTEST=ON \

# Build is not parallel safe
%cmake_build -j1


%find_lang %{name}

env CTEST_OUTPUT_ON_FAILURE=1 make test -C %{_vpath_builddir}

desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/%{name}.appdata.xml

%files -f %{name}.lang
%doc README.txt PHD_2.0_Architecture.docx
%license LICENSE.txt