%{!?python_ver: %global python_ver %(%{__python} -c "import sys ; print sys.version[:3]")}
%global __provides_exclude_from ^%{python_sitearch}/.*\\.so$
%global libname cpopen

Name:           python-%{libname}
Version:        @VERSION@
Release:        @RELEASE@%{?dist}
Summary:        Creates a sub-process in simpler safer manner

License:        GPLv2+
Group:          System Environment/Libraries
URL:            http://pypi.python.org/pypi/cpopen
Source0:        http://bronhaim.fedorapeople.org/cpopen-%{version}.tar.gz

BuildRequires: python2-devel
Provides: vdsm-python-cpopen = 4.13.2
Obsoletes: vdsm-python-cpopen <= 4.14

%description
Python package for creating sub-process in simpler and safer manner by using C
code.

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

%build
CPOPEN_VERSION=%{version} %{__python} setup.py build


%install
CPOPEN_VERSION=%{version} %{__python} setup.py install --root $RPM_BUILD_ROOT

%files
%doc AUTHORS COPYING README
%{python_sitearch}/%{libname}/__init__.py*
%{python_sitearch}/%{libname}-%{version}-py*.egg-info
%attr(755, root, root) %{python_sitearch}/%{libname}/%{libname}.so*

%changelog
* Thu Sep 24 2015 Yaniv Bronhaim <ybronhei@redhat.com> - 1.4
* Adding sigpipe handler - fix compatibility with python 2.7.5-33

* Sat Jun 13 2015 Yaniv Bronhaim <ybronhei@redhat.com> - 1.3.2
- Fixing mishmash in versioning and rpm lint

* Mon Oct 27 2014 Saggi Mizrahi <smizrahi@redhat.com> - 1.3.1-5
- Add RELRO to LDFLAGS
- New brew build with ppc

* Wed Jul 30 2014 Yaniv Bronhaim <ybronhei@redhat.com> - 1.3.1-4
- raising version to latest build
- no changes in the code, just comparing to koji release number

* Tue Jun 24 2014 Yaniv Bronhaim <ybronhei@redhat.com> - 1.3.1
- fix compatibility with F20's python 2.7.5-12

* Sun Apr 6 2014 Yaniv Bronhaim <ybronhei@redhat.com> - 1.3
- Tagging 1.3

* Thu Jan 2 2014 Yaniv Bronhaim <ybronhei@redhat.com> - 1.2.3-7
- Changing Obsoletes and Provides of vdsm-python-cpopen package

* Wed Dec 25 2013 Yaniv Bronhaim <ybronhei@redhat.com> - 1.2.3-6
- Bumping version for RHEL build

* Wed Dec 11 2013 Yaniv Bronhaim <ybronhei@redhat.com> - 1.2.3-5
- Adding umask configuration to the child process

* Mon Oct 28 2013 Yaniv Bronhaim <ybronhei@redhat.com> - 1.2.3-4
- Wrong code were packed on previous release

* Wed Oct 23 2013 Yaniv Bronhaim <ybronhei@redhat.com> - 1.2.3-3
- Override old packages with same file names

* Mon Aug 26 2013 Yaniv Bronhaim <ybronhei@redhat.com> - 1.2.3-2
- Fixing import error in __init__.py

* Sun Aug 25 2013 Yaniv Bronhaim <ybronhei@redhat.com> - 1.2.3-1
- Moving files under cpopen folder

* Wed Jun 12 2013 Yaniv Bronhaim <ybronhei@redhat.com> - 1.2.2-1
- Merging vdsm-python-cpopen fixes
- Renaming to cpopen.so

* Tue Mar 19 2013 Yaniv Bronhaim <ybronhei@redhat.com> 1.2.1-1
- Changing ownership and mod of cpopen-createprocess.so file

* Wed Mar 13 2013 Yaniv Bronhaim <ybronhei@redhat.com> 1.2-1
- Renaming createprocess to cpopen-createprocess

* Tue Feb 05 2013 Yaniv Bronhaim <ybronhei@redhat.com> 1.1-1
- Fix dependencies
- Adding AUTHORS file

* Sun Jan 20 2013 Yaniv Bronhaim <ybronhei@redhat.com> 1.0-1
- Initial take

