Blob Blame History Raw
%global commit 0911beb61a821b8e6e709cbe5ad8750d4d4e1fe6
%global shorcommit %(c=%{commit}; echo ${c:0:7})

%{!?__python2: %global __python2 %{__python}}
%global with_python3 1

############ General Information ############
Name: ahkab
Version: 0.17
Release: 1%{?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 May 29 2015 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.16-1
- Bump to lastest version
- Implementation of memoization system
- New time functions.
- Replace my_time_function.value()

* Tue May 12 2015 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.16-1
- Bump to latest version

* Fri Mar 13 2015 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.12-2
- Python 3 version created

* Sat Jan 31 2015 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.12-1
- Improving documentation.
- Fix detection of wd
- Use the warning interface
- Fix printing of .DC statements

* Wed Oct 22 2014 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.10-2
- Clean lines on spec file. 

* Sat Oct 18 2014 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.10-1
- Update release version and new source.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.09-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Apr 18 2014 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.09-3
- Change directory files to ahkab. 
- Change spec file permission. 
- Package egg info.
- Remove shebang from python files.


* Thu Apr 17 2014 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.09-2
- Remove defattr macro. Add setuptools as BR. Remove BRoot line.

* Thu Apr 17 2014 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.09-1
- Initial package