Add gr-osmosdr.spec and README file.
[fedora-specs.git] / gr-osmosdr.spec
diff --git a/gr-osmosdr.spec b/gr-osmosdr.spec
new file mode 100644 (file)
index 0000000..ba01e5a
--- /dev/null
@@ -0,0 +1,103 @@
+%global gitdate 20121205
+
+Name:           gr-osmosdr
+Version:        0
+Release:        0.1.git%{gitdate}%{?dist}
+Summary:        GNU Radio block for Realtek RTL2832U
+
+License:        GPLv3
+URL:            http://sdr.osmocom.org/trac/wiki/rtl-sdr
+
+# To construct the source archive, update gitdate above and then do:
+#   cd /tmp
+#   rm -r gr-osmosdr
+#   git clone git://git.osmocom.org/gr-osmosdr
+#   cd gr-osmosdr
+#   git archive -o ../gr-osmosdr-git%{gitdate}.tar.gz --prefix=gr-osmosdr/ HEAD
+Source0:        gr-osmosdr-git%{gitdate}.tar.gz
+
+# This BR list is by no means complete.  If there are missing
+# dependencies, try 'yum-builddep gnuradio'.
+BuildRequires:  rtl-sdr
+BuildRequires:  gnuradio-devel
+BuildRequires:  gcc-c++
+BuildRequires:  boost-devel
+BuildRequires:  cmake
+BuildRequires:  python-devel
+Requires:       gnuradio
+
+# Python directories.
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+
+
+%description
+GNU Radio port to Realtek RTL2832U.
+
+
+%package devel
+Summary:        GNU Radio block for Realtek RTL2832U
+License:        GPLv3
+Requires:       pkgconfig
+Requires:       gr-osmosdr = %{version}-%{release}
+Requires:       rtl-sdr-devel
+
+
+%description devel
+Development packages for %{name}.
+
+
+%prep
+%setup -q -n gr-osmosdr
+
+
+%build
+mkdir build
+cd build
+cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix}
+make %{?_smp_mflags}
+
+
+%install
+cd build
+%make_install
+
+# It installs the Python libraries in /usr/lib64.  There's
+# probably a CMake variable to fix this ... XXX
+if [ "%{_libdir}/python2.7/site-packages" != "%{python_sitelib}" ]; then
+  mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
+  mv $RPM_BUILD_ROOT%{_libdir}/python2.7/site-packages/* $RPM_BUILD_ROOT%{python_sitelib}
+fi
+
+
+%files
+%doc COPYING
+%{_libdir}/libgnuradio-osmosdr.so.0
+%{_libdir}/libgnuradio-osmosdr.so.0.1
+%{python_sitelib}/osmosdr/__init__.py
+%{python_sitelib}/osmosdr/__init__.pyc
+%{python_sitelib}/osmosdr/__init__.pyo
+%{python_sitelib}/osmosdr/_osmosdr_swig.so
+%{python_sitelib}/osmosdr/osmosdr_swig.py
+%{python_sitelib}/osmosdr/osmosdr_swig.pyc
+%{python_sitelib}/osmosdr/osmosdr_swig.pyo
+%{_datadir}/gnuradio/grc/blocks/osmosdr_source_c.xml
+%{_datadir}/gnuradio/grc/blocks/rtlsdr_source_c.xml
+
+
+%files devel
+%doc COPYING README
+%{_libdir}/libgnuradio-osmosdr.so
+%{_libdir}/pkgconfig/gnuradio-osmosdr.pc
+%{_includedir}/osmosdr/osmosdr_api.h
+%{_includedir}/osmosdr/osmosdr_device.h
+%{_includedir}/osmosdr/osmosdr_pimpl.h
+%{_includedir}/osmosdr/osmosdr_ranges.h
+%{_includedir}/osmosdr/osmosdr_source_c.h
+%{_includedir}/osmosdr/swig/osmosdr_swig.i
+%{_includedir}/osmosdr/swig/osmosdr_swig_doc.i
+
+
+%changelog
+* Wed Dec 05 2012 Richard W.M. Jones <rjones@redhat.com> 0-0.1
+- Initial release.