Blob Blame History Raw
%global srcname pybeam


Name:		python-%{srcname}
Version:	0.3.2
Release:	2%{?dist}
Summary:	Python module to parse Erlang BEAM files
License:	MIT
Group:		Development/Languages
URL:		https://github.com/matwey/%{srcname}
Source0:	https://github.com/matwey/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz
BuildArch:	noarch


%description
Python module to parse Erlang BEAM files.


%package -n python2-%{srcname}
Summary:	%{summary}
BuildRequires:	python-construct
BuildRequires:	python-devel
BuildRequires:	python-setuptools
Requires:	python-construct
Requires:	python-six >= 1.4.0


%description -n python2-%{srcname}
Python module to parse Erlang BEAM files.


%if 0%{?fedora}
%package -n python3-%{srcname}
Summary:	%{summary}
BuildRequires:	python3-construct
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
Requires:	python3-construct
Requires:	python3-six >= 1.4.0
%{?python_provide:%python_provide python3-%{srcname}}


%description -n python3-%{srcname}
Python module to parse Erlang BEAM files.
%endif


%prep
%setup -q -n %{srcname}-%{version}


%build
%py2_build
%if 0%{?fedora}
%py3_build
%endif


%install
# Must do the python2 install first because the scripts in /usr/bin are
# overwritten with every setup.py install, and in general we want the
# python3 version to be the default.
%py2_install
%if 0%{?fedora}
%py3_install
%endif


%check
%{__python2} setup.py test
%if 0%{?fedora}
%{__python3} setup.py test
%endif


%files -n python2-%{srcname}
%license LICENSE
%doc README.md
%{python2_sitelib}/*


%if 0%{?fedora}
%files -n python3-%{srcname}
%license LICENSE
%doc README.md
%{python3_sitelib}/*
%endif


%changelog
* Tue Jun  7 2016 Peter Lemenkov <lemenkov@gmail.com> - 0.3.2-2
- Build for EL7

* Mon Feb 15 2016 Peter Lemenkov <lemenkov@gmail.com> - 0.3.2-1
- Initial build