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

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

############ General Information ############
Name: ahkab
Version: 0.18
Release: 14%{?dist}
Summary: A SPICE-like electronic circuit simulator written in Python
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 python2-setuptools

%if 0%{?with_python3}

BuildRequires: python3-devel python3-setuptools

%endif # if with_python3

%if 0%{?with_python3}
%package -n python3-ahkab

Summary: A SPICE-like electronic circuit simulator written in Python
Requires: python3-sympy
Requires: python3-matplotlib
Requires: python3-numpy

%endif # if with_python3

############ Description and Python3 Global Config ############
%global _description\
A SPICE-like electronic circuit simulator written in Python.\
It can be used to do AC analysis, DC sweep, Transient analysis and more.

%description %_description

%package -n python2-ahkab
Summary: %summary
Requires: python2-sympy python2-matplotlib python2-numpy
Requires: python2 >= 2.6
%{?python_provide:%python_provide python2-ahkab}
# Remove before F30
Provides: ahkab = %{version}-%{release}
Obsoletes: ahkab < %{version}-%{release}

%description -n python2-ahkab %_description

%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 -n python2-ahkab
%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
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.18-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.18-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.18-12
- Rebuilt for Python 3.7

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.18-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Jan 03 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.18-10
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.18-9
- Python 2 binary package renamed to python2-ahkab
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.18-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.18-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.18-6
- Rebuild for Python 3.6

* Mon Sep 26 2016 Dominik Mierzejewski <rpm@greysector.net> - 0.18-5
- rebuilt for matplotlib-2.0.0

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.18-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Sat Jul 18 2015 Kiara Navarro <sophiekovalevsky@fedoraproject.org> - 0.18-1
- Bump to lastest version
- Add Four and Fft support
- Add PWL waveforms

* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* 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