File gr-rds.spec of Package gr-rds

#
# spec file for package gr-rds
#
# Copyright (c) 2015-2022 Wojciech Kazubski, wk@ire.pw.edu.pl
#
# 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 libname libgnuradio-rds
%define sover 3_7_0git0_0_0
%define examplesdir %{_datadir}/gnuradio/examples

Name:           gr-rds
Version:        1.1.0git20200224
Release:        1.1
Summary:        GNU Radio module for RDS decoder
License:        GPL-2.0
Group:          Productivity/Hamradio/Other
Source:         %{name}-%{version}.tar.gz
URL:            https://github.com/bastibl/gr-rds
%if 0%{?suse_version} >= 1330
BuildRequires:  libboost_system-devel
%else
BuildRequires:  boost-devel
%endif
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  doxygen
BuildRequires:  gnuradio-devel >= 3.7.0
BuildRequires:  gnuradio-examples
BuildRequires:  python-devel
BuildRequires:  python2-devel
BuildRequires:  swig
%if 0%{?suse_version} > 1010
BuildRequires:  fdupes
%endif

%description
GNU Radio module implementing input block for RDS decoder.


%package -n %{libname}-%{sover}
Summary:        Libraries for decoding RDS
Group:          Hardware/Other

%description -n %{libname}-%{sover}
Library for decoding RDS (Radio Data System).


%package devel
Summary:        Development files for gr-rds
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}-%{release}
Requires:       %{libname}-%{sover} = %{version}-%{release}
AutoReq:        on

%description devel
Library headers for gr-rds RDS decoder.


%package doc
Summary:        Documentation for gnuradio-rds
Group:          Documentation/Other
BuildArch:      noarch
Requires:       %{name}

%description doc
Documentation for gr-rds module for GNU Radio.

%package examples
Summary:        RDS examples for GNU Radio
Group:          Hardware/Other
BuildArch:      noarch
Requires:       %{name}
Requires:       gnuradio-examples

%description examples
Example RDS flowgraphs for GNU Radio Companion 

%prep
%setup -q  -n %{name}
echo "HTML_TIMESTAMP         = NO" >> docs/Doxyfile.in
echo "HTML_TIMESTAMP         = NO" >> docs/Doxyfile.swig_doc.in


%build
%cmake -DENABLE_DOXYGEN=1
make %{?_smp_mflags}


%install
%cmake_install
find %{buildroot}%{_libdir}/python*/site-packages/ -name '*.pyo' -exec rm {} \;

#install examples
install -m 644 -D apps/rds*.grc -t %{buildroot}%{examplesdir}/rds

#move docs to correct location
mkdir -p %{buildroot}%{_docdir}
mv %{buildroot}/%{_datadir}/doc/%{name} %{buildroot}%{_docdir}

%if 0%{?suse_version} > 1010
%fdupes -s %{buildroot}%{_docdir}
%endif


%post -n %{libname}-%{sover} -p /sbin/ldconfig
%postun  -n %{libname}-%{sover} -p /sbin/ldconfig


%files
%defattr(-,root,root)
%doc README.md
%doc docs/tmc_event_tables.ods docs/tmc_locations_italy.ods
%license COPYING 
%{python_sitearch}/rds
%exclude %{_docdir}/%{name}/html
%exclude %{_docdir}/%{name}/xml
%{_datadir}/gnuradio/grc/blocks/*.xml

%files -n %{libname}-%{sover}
%defattr(-,root,root)
%{_libdir}/libgnuradio-rds*.so.*

%files devel
%defattr(-,root,root)
%{_libdir}/libgnuradio-rds*.so
%{_includedir}/rds

%files doc
%defattr(-,root,root)
%{_docdir}/%{name}/html
%{_docdir}/%{name}/xml

%files examples
%defattr(-,root,root)
%{examplesdir}/rds

%changelog
openSUSE Build Service is sponsored by