%global commit f3ca64c6d6a6c83172cb951a2f4643494e3a93b4 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %{!?__python2: %global __python2 %{__python}} %global with_python3 1 ############ General Information ############ Name: python-deltasigma Version: 0.1 Release: 4%{?dist} Summary: The python2-deltasigma is a package that simulate Delta Sigma modulators Group: Applications/Engineering License: BSD URL: http://www.python-deltasigma.io/ Source0: http://github.com/ggventurini/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz ############ Dependencies ############ BuildArch: noarch BuildRequires: python2-devel python-setuptools %if 0%{?with_python3} BuildRequires: python3-devel python3-setuptools %endif # if with_python3 Requires: numpy Requires: python-matplotlib >= 1.1.1 Requires: scipy >= 0.11.0 Requires: Cython %if 0%{?with_python3} %package -n python3-deltasigma Summary: The python3-deltasigma is a package that simulate Delta Sigma modulators Group: Applications/Engineering Requires: python3-numpy Requires: python3-matplotlib Requires: python3-scipy Requires: python3-Cython %endif # if with_python3 ############ Description and Python3 Global Config ############ %description Deltasigma synthesize, simulate, scale and map. It can be use to implementable topologies Delta Sigma modulators. %if 0%{?with_python3} %description -n python3-deltasigma Deltasigma synthesize, simulate, scale and map. It can be use to implementable topologies Delta Sigma modulators. %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}|' rm -rf deltasigma.egg-info # This folder is unnecessary rm -rf delsig %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 %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif # with_python3 %{__python2} setup.py install --skip-build --root %{buildroot} ############ Files ############ %files %doc README.md LICENSE ROADMAP.md CHANGES.rst %{python2_sitelib}/deltasigma %{python2_sitelib}/deltasigma-*.egg-info %if 0%{?with_python3} %files -n python3-deltasigma %doc README.md LICENSE ROADMAP.md CHANGES.rst %{python3_sitelib}/deltasigma %{python3_sitelib}/deltasigma-*.egg-info %endif # with_python3 ############ Changelog ############ %changelog * Tue Nov 4 2014 Kiara Navarro - 0.1-4 - Package support for python3. - URL of the project changed. * Mon Nov 3 2014 Kiara Navarro - 0.1-3 - Delete delsig folder in prep section * Mon Nov 3 2014 Kiara Navarro - 0.1-2 - Fix date error typo. - Fix build requires python2-devel. - Delete delsig folder. * Mon Nov 3 2014 Kiara Navarro - 0.1-1 - Initial package.