File freediag.spec of Package freediag
#
# spec file for package freediag
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define tagver 1_09
Name: freediag
Version: 1.09
Release: 0
Summary: OBD2 scantool
License: GPL-3.0-or-later
Group: Hardware/Other
Url: http://freediag.sourceforge.net/
# https://github.com/fenugrec/freediag/archive/refs/tags/R1_09.zip
Source0: https://github.com/fenugrec/%{name}/archive/refs/tags/R%{tagver}.tar.gz#/%{name}-%{version}.tar.gz
Source1: man.txt
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: fltk-devel
BuildRequires: help2man
BuildRequires: pkg-config
BuildRequires: pkgconfig(tinfo)
BuildRequires: readline-devel
Recommends: %{name}-doc = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package contains 'core' software which
can be used to access your car's diagnostic system using a laptop
and a suitable interface cable. The gui program is scangui.
%package doc
Summary: Documentation for freediag
Group: Documentation/Other
%description doc
This package contains 'core' software which
can be used to access your car's diagnostic system using a laptop
and a suitable interface cable.
This is the html and pdf documentation.
%prep
%setup -q -n %{name}-R%{tagver}
%autopatch -p1
%build
%cmake -DBUILD_GUI:BOOL=ON \
-DUSE_RCFILE:BOOL=ON
make %{?_smp_mflags}
%install
%cmake_install
# Remove files installed by %%doc
mv %{buildroot}%{_datadir}/%{name}/examples .
rm -rf %{buildroot}%{_datadir}/%{name}/*
mv examples %{buildroot}%{_datadir}/%{name}/
cp -v scangui/README README.scangui
mkdir -p %{buildroot}%{_mandir}/man1
pushd %{buildroot}%{_bindir}
help2man --no-discard-stderr -N -i %{SOURCE1} -o %{buildroot}%{_mandir}/man1/%{name}.1 ./%{name}
popd
%files
%license COPYING
#%%{_bindir}/scangui
%{_bindir}/freediag
%{_datadir}/%{name}/
%{_mandir}/man1/%{name}.1%{ext_man}
%files doc
%doc AUTHORS CHANGES README README.scangui doc doc_interfaces
%changelog