File gr-gsm.spec of Package gr-gsm
#
# spec file for package gr-gsm
#
# Copyright (c) 2015, Martin Hauke <mardnh@gmx.de>
#
# 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 with_docs 0
%define sover -0_42_2_0_0_0
Name: gr-gsm
Version: 0.42.2
Release: 0
Summary: Gnuradio blocks and tools for receiving GSM transmissions
License: GPL-3.0-only
Group: Productivity/Hamradio/Other
URL: https://github.com/ptrkrysik/gr-gsm
Source: %{name}-%{version}.tar.gz
Patch0: gr-gsm-docdir.diff
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gr-osmosdr
BuildRequires: memory-constraints
BuildRequires: pkgconfig
BuildRequires: python-devel
BuildRequires: swig
BuildRequires: cppunit-devel
BuildRequires: gnuradio-devel >= 3.8.0
BuildRequires: libosmocodec-devel
BuildRequires: libosmocoding-devel
BuildRequires: libosmocore-devel
BuildRequires: libosmogsm-devel
BuildRequires: log4cpp-devel
Recommends: python-qwt5
%if 0%{with_docs}
BuildRequires: doxygen
BuildRequires: graphviz
%endif
%if 0%{?suse_version} > 1325
BuildRequires: libboost_chrono-devel
BuildRequires: libboost_date_time-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_program_options-devel
BuildRequires: libboost_regex-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_test-devel
BuildRequires: libboost_thread-devel
%else
BuildRequires: boost-devel
%endif
%description
Implementation of the Global System for Mobile Communications
protocol and provide tools for scanning for GSM base stations and for
decoding GSM radio trafic.
%package -n libgrgsm%{sover}
Summary: Library for gr-gsm
Group: Productivity/Hamradio/Other
%description -n libgrgsm%{sover}
Implementation of the Global System for Mobile Communications
protocol and provide tools for scanning for GSM base stations and for
decoding GSM radio trafic.
%package devel
Summary: Development files for gr-gsm
Group: Development/Libraries/Other
Requires: libgrgsm%{sover} = %{version}
%description devel
Implementation of the Global System for Mobile Communications
protocol and provide tools for scanning for GSM base stations and for
decoding GSM radio trafic.
Headers for gr-gsm module for GNURadio.
%if 0%{with_docs}
%package doc
Summary: Documentation for gr-gsm
Group: Documentation/Other
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation files for gr-gsm.
%endif
%prep
%setup -q
%patch0 -p1
%build
# FIXME: Hack - should be handled in CMake
export LD_LIBRARY_PATH=$(pwd)/build/lib/
%limit_build -m 2000
%cmake \
-DCMAKE_SHARED_LINKER_FLAGS="-pthread" \
%if 0%{with_docs}
-DENABLE_DOXYGEN=ON \
%endif
-DPYTHON_EXECUTABLE:STRING="%{_bindir}/python2"
%make_jobs
%install
%cmake_install
# FIXME: upstream desktop file is broken, install path is also not correct
rm -rf %{buildroot}%{_datadir}/gr-gsm/gr-gsm/freedesktop/grgsm-livemon.desktop
#install -d %%{buildroot}/%%{_datadir}/applications/
#mv %%{buildroot}/usr/share/gr-gsm/gr-gsm/freedesktop/grgsm-livemon.desktop %%{buildroot}/%%{_datadir}/applications/
%fdupes %{buildroot}/%{python_sitearch}
%fdupes %{buildroot}/%{_docdir}
%post -p /sbin/ldconfig -n libgrgsm%{sover}
%postun -p /sbin/ldconfig -n libgrgsm%{sover}
%files
%license LICENSE COPYING
%doc README.md
%{_bindir}/grgsm_decode
%{_bindir}/grgsm_livemon
%{_bindir}/grgsm_scanner
%{_bindir}/grgsm_capture
%{_bindir}/grgsm_channelize
%{_bindir}/grgsm_livemon_headless
%{_bindir}/grgsm_trx
%{_datadir}/gnuradio/grc/blocks/*.xml
#%%{_datadir}/applications/grgsm-livemon.desktop
%{python_sitearch}/grgsm
%if 0%{with_docs}
%exclude %{_docdir}/gr-grgsm/html
%exclude %{_docdir}/gr-grgsm/xml
%endif
%files -n libgrgsm%{sover}
%{_libdir}/libgrgsm-*.so.*
%files devel
%{_includedir}/grgsm
%{_libdir}/libgrgsm*.so
%dir %{_libdir}/cmake/grgsm/
%{_libdir}/cmake/grgsm/*.cmake
%if 0%{with_docs}
%files doc
%dir %{_docdir}/gr-grgsm
%{_docdir}/gr-grgsm/html
%{_docdir}/gr-grgsm/xml
%endif
%changelog