3fcc951
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
3fcc951
%global with_python3 1
3fcc951
3fcc951
Name:           python-iptools
3fcc951
Version:        0.6.1
42f74b1
Release:        4%{?dist}
3fcc951
Summary:        A few useful functions and objects for manipulating IP addresses in python
3fcc951
3fcc951
License:        BSD
3fcc951
URL:            https://github.com/bd808/%{name}
3fcc951
Source0:        https://github.com/bd808/%{name}/archive/v%{version}.tar.gz
3fcc951
3fcc951
BuildArch:      noarch
3fcc951
BuildRequires:  python2-devel
2a97d11
BuildRequires:  python-nose
3fcc951
BuildRequires:  python-setuptools
3fcc951
%if 0%{?with_python3}
3fcc951
BuildRequires:  python3-devel
2a97d11
BuildRequires:  python3-nose
3fcc951
BuildRequires:  python3-setuptools
3fcc951
%endif # if with_python3
3fcc951
3fcc951
%description
3fcc951
A few useful functions and objects for manipulating IPv4 and IPv6 addresses
3fcc951
in python. The project was inspired by a desire to be able to use CIDR address
3fcc951
notation to designate INTERNAL_IPS in a Django project's settings file.
3fcc951
3fcc951
3fcc951
%if 0%{?with_python3}
3fcc951
%package -n python3-iptools
3fcc951
Summary:        A few useful functions and objects for manipulating IP addresses in python 3
3fcc951
Group:          Applications/System
3fcc951
3fcc951
%description -n python3-iptools
3fcc951
A few useful functions and objects for manipulating IPv4 and IPv6 addresses
3fcc951
in python. The project was inspired by a desire to be able to use CIDR address
3fcc951
notation to designate INTERNAL_IPS in a Django project's settings file.
3fcc951
%endif # if with_python3
3fcc951
3fcc951
3fcc951
%prep
3fcc951
%setup -q
3fcc951
find -name .gitignore -delete
3fcc951
3fcc951
%if 0%{?with_python3}
3fcc951
rm -rf %{py3dir}
3fcc951
cp -a . %{py3dir}
3fcc951
%endif # with_python3
3fcc951
3fcc951
3fcc951
%build
3fcc951
%{__python} setup.py build
3fcc951
3fcc951
%if 0%{?with_python3}
3fcc951
pushd %{py3dir}
3fcc951
%{__python3} setup.py build
3fcc951
popd
3fcc951
%endif # with_python3
3fcc951
3fcc951
3fcc951
%install
3fcc951
# Must do the python3 install first because the scripts in /usr/bin are
3fcc951
# overwritten with every setup.py install (and we want the python2 version
3fcc951
# to be the default for now).
3fcc951
%if 0%{?with_python3}
3fcc951
pushd %{py3dir}
3fcc951
%{__python3} setup.py install --skip-build --root %{buildroot}
3fcc951
popd
3fcc951
%endif # with_python3
3fcc951
3fcc951
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
3fcc951
3fcc951
3fcc951
%check
3fcc951
%{__python} setup.py test
3fcc951
3fcc951
%if 0%{?with_python3}
3fcc951
pushd %{py3dir}
3fcc951
%{__python3} setup.py test
3fcc951
popd
3fcc951
%endif # with_python3
3fcc951
3fcc951
 
3fcc951
%files
3fcc951
%doc AUTHORS CHANGES docs LICENSE README.md
3fcc951
%{python_sitelib}/*
3fcc951
3fcc951
%if 0%{?with_python3}
3fcc951
%files -n python3-iptools
3fcc951
%doc AUTHORS CHANGES docs LICENSE README.md
3fcc951
%{python3_sitelib}/*
3fcc951
%endif # with_python3
3fcc951
3fcc951
3fcc951
%changelog
42f74b1
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-4
42f74b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
42f74b1
Orion Poplawski 0f2f09c
* Fri May 02 2014 Orion Poplawski <orion@cora.nwra.com> - 0.6.1-3
Orion Poplawski 0f2f09c
- Rebuild for Python 3.4
Orion Poplawski 0f2f09c
4d4107a
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-2
4d4107a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
4d4107a
3fcc951
* Mon Apr 22 2013 Orion Poplawski <orion@cora.nwra.com> - 0.6.1-1
3fcc951
- Update to 0.6.1
3fcc951
3fcc951
* Fri Apr 19 2013 Orion Poplawski <orion@cora.nwra.com> - 0.6.0-4
3fcc951
- Remove install dir rm in %%install
3fcc951
3fcc951
* Fri Apr 19 2013 Orion Poplawski <orion@cora.nwra.com> - 0.6.0-3
3fcc951
- Cleanup macros
3fcc951
3fcc951
* Sun Apr 7 2013 Orion Poplawski <orion@cora.nwra.com> - 0.6.0-2
3fcc951
- Add BR python-setuptools
3fcc951
- Add %%check
3fcc951
3fcc951
* Sat Apr 6 2013 Orion Poplawski <orion@cora.nwra.com> - 0.6.0-1
3fcc951
- Initial Fedora package