%global commit 4481df5c1ed5efe6f9921a0c90e4f48662924f6e %global shortcommit %(c=%{commit}; echo ${c:0:7}) %{!?__python2: %global __python2 %{__python}} %global with_python3 1 ############ General Information ############ Name: scikit-rf Version: 0.14 Release: 1%{?dist} Summary: Scikit-rf is a Python library for RF/Microwave engineering Group: Applications/Engineering License: BSD URL: http://scikit-rf.org Source0: http://github.com/scikit-rf/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz ############ Dependencies ############ BuildArch: noarch %if 0%{?with_python3} BuildRequires: python3-devel python3-setuptools %endif # if with_python3 Requires: numpy Requires: python-matplotlib Requires: scipy Requires: python3-ipython %if 0%{?with_python3} %package -n python3-scikit-rf Summary: scikit-rf is a Python library for RF-Microwave engineering Group: Applications/Engineering Requires: python3-numpy Requires: python3-matplotlib Requires: python3-scipy Requires: python3-ipython %endif # if with_python3 ############ Description and Python3 Global Config ############ %description Python library for RF/Microwave engineering %if 0%{?with_python3} %description -n python3-scikit-rf Python library for RF/Microwave engineering %endif # with_python3 ############ Prep ############ %prep %setup -q -n %{name}-%{commit} find -name '*.py' | xargs sed -i -e '/^#!\//, 1d' find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find -name '*.py' | xargs sed -i -e '/^#!\//, 1d' find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif # with_python3 ############ Build ############ %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 ############ Install ############ %install %{__python2} setup.py install --skip-build --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif # with_python3 %if 0%{?with_python3} pushd %{py3dir} %{_bindir}/nosetests-3* -v || : popd %endif %clean rm -rf $RPM_BUILD_ROOT ############ Files ############ %files %doc examples/ README.md INSTALL.txt CHANGELOG.txt TODO.rst %license LICENSE.txt %{python2_sitelib}/apps %{python2_sitelib}/skrf %{python2_sitelib}/scikit_rf-*.egg-info %if 0%{?with_python3} %files -n python3-scikit-rf %doc examples/ README.md INSTALL.txt CHANGELOG.txt TODO.rst %license LICENSE.txt %{python3_sitelib}/skrf %{python3_sitelib}/scikit_rf-*.egg-info %{python3_sitelib}/apps %endif # with_python3 ############ Changelog ############ %changelog * Sat Jul 18 2015 Kiara Navarro - 0.14-1 - Initial package.