Blob Blame History Raw
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%if 0%{?fedora}
%global with_python3 1
%endif

Name:           python-posix_ipc
Version:        0.9.8
Release:        4%{?dist}
Summary:        POSIX IPC primitives (semaphores and shared memory) for Python
Group:          Development/Languages
License:        BSD
URL:            http://semanchuk.com/philip/posix_ipc/
Source0:        http://semanchuk.com/philip/posix_ipc/posix_ipc-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  python-devel python-setuptools


%description
posix_ipc is a Python module (written in C) that permits creation and
manipulation of POSIX inter-process semaphores, shared memory and message
queues on platforms supporting POSIX Realtime Extensions, POSIX 1003.1b-1993.


%if 0%{?with_python3}
%package -n python3-posix_ipc
Summary:        POSIX IPC primitives (semaphores and shared memory) for Python
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%description -n python3-posix_ipc
posix_ipc is a Python module (written in C) that permits creation and
manipulation of POSIX inter-process semaphores, shared memory and message
queues on platforms supporting POSIX Realtime Extensions, POSIX 1003.1b-1993.
%endif


%prep
%setup -q -n posix_ipc-%{version}
chmod 644 demo/make_all.sh
chmod 644 demo2/cleanup.py
chmod 644 demo/cleanup.py

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3


%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
popd
%endif


%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
popd
%endif


%clean


%files
%defattr(-,root,root,-)
%doc README LICENSE demo demo2
%{python_sitearch}/*

%if 0%{?with_python3}
%files -n python3-posix_ipc
%defattr(-,root,root,-)
%doc README LICENSE demo demo2
%{python3_sitearch}/*
%endif


%changelog
* Wed Sep 10 2014 Nejc Saje <nsaje@redhat.com> - 0.9.8-4
- Introduce python3- subpackage

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Apr 08 2014 Pádraig Brady <pbrady@redhat.com> - 0.9.8-1
- Latest upstream

* Tue Apr 08 2014 Jordan O'Mara <jomara@redhat.com> - 0.5.3-9
- Link with required threading libs

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.5.3-3
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Apr 16 2009 Ramakrishna Reddy Yekulla <ramkrsna@fedoraproject.org> 0.5.3-1
- Initial RPM release