[ahkab] Create python3 version.

Kiara Navarro sophiekovalevsky at fedoraproject.org
Sat Mar 14 04:34:07 UTC 2015


commit a3bd316623502916460e25242db7307e0fb2cf16
Author: Kiara Navarro <sophiekovalevsky at fedoraproject.org>
Date:   Fri Mar 13 23:33:57 2015 -0500

    Create python3 version.

 ahkab.spec | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)
---
diff --git a/ahkab.spec b/ahkab.spec
index 300d5f9..f72771b 100644
--- a/ahkab.spec
+++ b/ahkab.spec
@@ -1,42 +1,118 @@
 %global commit aea579b3a19697ba87411b5b5801cb18e024db50
 %global shorcommit %(c=%{commit}; echo ${c:0:7})
 
+%{!?__python2: %global __python2 %{__python}}
+%global with_python3 1
+
+############ General Information ############
 Name: ahkab
 Version: 0.12
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: A SPICE-like electronic circuit simulator written in Python
 Group: Applications/Engineering	
 License: GPLv2
 URL: http://ahkab.github.io/ahkab/
 Source0: https://github.com/ahkab/%{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: sympy python-matplotlib numpy 
 Requires: python >= 2.6
 
+%if 0%{?with_python3}
+%package -n python3-ahkab
+
+Summary: A SPICE-like electronic circuit simulator written in Python
+Group: Applications/Engineering	
+Requires: python3-sympy
+Requires: python3-matplotlib
+Requires: python3-numpy
+
+%endif # if with_python3
+
+############ Description and Python3 Global Config ############
 %description
 A SPICE-like electronic circuit simulator written in Python.
 It can be used to do AC analysis, DC sweep, Transient analysis and more.
 
+%if 0%{?with_python3}
+
+%description -n python3-ahkab
+A SPICE-like electronic circuit simulator written in Python.
+It can be used to do AC analysis, DC sweep, Transient analysis and more.
+
+%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 ahkab.egg-info
+
+%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 COPYING
 %{python2_sitelib}/ahkab/
 %{python2_sitelib}/ahkab-*.egg-info
 %{_bindir}/ahkab
 
+%if 0%{?with_python3}
+
+%files -n python3-ahkab
+%doc README.md COPYING
+%{python3_sitelib}/ahkab/
+%{python3_sitelib}/ahkab-*.egg-info
+
+%endif # with_python3
+
+############ Changelog ############
 %changelog
+* Fri Mar 13 2015 Kiara Navarro <sophiekovalevsky at fedoraproject.org> - 0.12-2
+- Python 3 version created
+
 * Sat Jan 31 2015 Kiara Navarro <sophiekovalevsky at fedoraproject.org> - 0.12-1
 - Improving documentation.
 - Fix detection of wd


More information about the scm-commits mailing list