Sophie

Sophie

distrib > Fedora > 16 > i386 > media > os-src > by-pkgid > 5657b036b595954a07147d347dce3938 > files > 2

python-signalfd-0.1-1.fc16.src.rpm

# Define the python_* macros for F12, RHEL5 and older
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

# Resolve rpmlint warning: private-shared-object-provides
%{?filter_setup:
%filter_provides_in %{python_sitearch}/%{name}/.*\.so$
%filter_setup
}


Name:           python-signalfd
Version:        0.1
Release:        1%{?dist}
Summary:        Python bindings to the Linux signalfd library/system call
Group:          Development/Languages
License:        MIT
URL:            https://launchpad.net/python-signalfd
Source0:        http://launchpad.net/%{name}/0.x/%{version}/+download/%{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# BuildArch:      noarch
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
BuildRequires:  python2-devel
BuildRequires:  python-setuptools-devel
%else
BuildRequires:  python-setuptools
%endif
BuildRequires:  gcc


%description
The python-signalfd package is a simple wrapper around the POSIX sigprocmask(2)
and the Linux signalfd(2) platform APIs, providing very direct access to them.


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


%build
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%else
CFLAGS="$RPM_OPT_FLAGS" %{__python} -c 'import setuptools; execfile("setup.py")' build
%endif


%install
rm -rf $RPM_BUILD_ROOT
%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%else
%{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root $RPM_BUILD_ROOT
%endif
# Resolve rpmlint error: non-standard-executable-perm
%{__chmod} 755 $RPM_BUILD_ROOT/%{python_sitearch}/signalfd/_signalfd.so


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc LICENSE
%{python_sitearch}/signalfd
%{python_sitearch}/*egg-info


%changelog
* Wed Aug 17 2011 James Laska<jlaska@redhat.com> - 0.1-1
- Initial packaging