File etherlab.spec of Package etherlab

# vim: tw=78
#
# spec file for package etherlab
#
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016-2020       Richard Hacker (lerichi at gmx dot net)
#
# 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/
#

%{!?make_jobs: %global make_jobs make %{?_smp_mflags} VERBOSE=1}
%{!?cmake_install: %global cmake_install DESTDIR=%{buildroot} make install}

# see https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.best-practices.scm_integration.html
%define build_tar_ball 0

# There is no debuginfo for this package, so disable automatic generation
%define debug_package %{nil}

Name:           etherlab
Version:        0
Release:        0

#----------------------------------------------------------------------------
# Main Package
#----------------------------------------------------------------------------
Summary:        Simulink Coder target meta package
License:        GPL-3.0+
Group:          Productivity/Other
URL:            http://etherlab.org/en/etherlab
Source1:        etherlab-rpmlintrc
BuildRequires:  cmake
Requires:       etherlab-devel = %{version}
Requires:       libethercat-devel
Requires:       pdserv-devel >= 3.2
BuildArch:      noarch
%if %{build_tar_ball}
Source:         https://gitlab.com/etherlab.org/etherlab/etherlab-%{version}.tar.bz2
%else
Source:         _service
%endif

%if 0%{?fedora}
BuildRequires: glibc-langpack-en
%endif

%description
EtherLab is a Simulink Coder Target used to create user space
binaries that use the PdServ library.

This meta package installs common dependencies like pdserv and ethercat to get
the normal user running quickly.

#----------------------------------------------------------------------------
# devel
#----------------------------------------------------------------------------
%package devel
Summary:        EtherLab target for Simulink Coder
Group:          Development/Tools/Other

%description devel
EtherLab is a Simulink Coder Target used to create user space
binaries that use the PdServ library.

This package installs the necessary files in a Matlab independent way. After
installing, use the install.sh command to copy the required files into the
Matlab distribution instances. See installation instructions for further
details.

#----------------------------------------------------------------------------

%prep
%if %{build_tar_ball}
%setup -q
%else
%setup -q -n %{_sourcedir}/%{name}-%{version} -T -D
%endif

%build
%cmake --no-warn-unused-cli

%install
%cmake_install

%post
echo "Now use \"%{_datadir}/etherlab/install.sh \$MATLAB_ROOT\" \
to install etherlab into matlab"

%files
%defattr(-, root, root)
%doc AUTHORS ChangeLog COPYING NEWS README.md README-windows.md README-packngo.md ReleaseNotes.txt

%files devel
%defattr(-, root, root)
%doc AUTHORS ChangeLog COPYING NEWS README.md README-windows.md README-packngo.md ReleaseNotes.txt
%{_datadir}/etherlab

%changelog
openSUSE Build Service is sponsored by