[python-inotify/el5/master: 9/9] - Add python26 support.

stevetraylen stevetraylen at fedoraproject.org
Wed Jan 26 09:44:46 UTC 2011


commit 21b793f0bf1d1b7d6e0af5c25bf4041efeb89507
Author: Steve Traylen <steve.traylen at cern.ch>
Date:   Wed Jan 26 10:43:56 2011 +0100

    - Add python26 support.

 python-inotify.spec |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 deletions(-)
---
diff --git a/python-inotify.spec b/python-inotify.spec
index cd98aac..bbfd6d2 100644
--- a/python-inotify.spec
+++ b/python-inotify.spec
@@ -1,7 +1,16 @@
 %global with_python3 0
+%global with_python26 1
 
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")}
 
+%if 0%{?with_python26}
+%global __python26 /usr/bin/python2.6
+%global py26dir  %{_builddir}/python26-%{name}-%{version}-%{release}
+%global python26_sitelib     /usr/lib/python2.6/site-packages
+# Disable byte compiling. Do ourselves later.
+%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') 
+%endif
+
 %global oname  pyinotify
 
 Summary:       Monitor filesystem events with Python under Linux
@@ -17,6 +26,10 @@ BuildRequires: python-devel
 %if 0%{?with_python3}
 BuildRequires: python3-devel
 %endif
+%if 0%{?with_python26}
+BuildRequires: python26-devel
+%endif
+
 BuildArch:     noarch
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires:      python-ctypes
@@ -51,6 +64,23 @@ exported from kernel space to user space.
 This is the Python 3 build of pyinotify
 %endif # if with_python3
 
+%if 0%{?with_python26}
+%package -n    python26-inotify
+Summary:       Monitor filesystem events with Python under Linux
+Group:         Development/Languages
+Requires:      python(abi) = 2.6
+
+%description -n python26-inotify
+This is a Python 2.6 module for watching filesystems changes. pyinotify
+can be used for various kind of fs monitoring. pyinotify relies on a
+recent Linux Kernel feature (merged in kernel 2.6.13) called
+inotify. inotify is an event-driven notifier, its notifications are
+exported from kernel space to user space.
+
+This is the Python 2.6 build of pyinotify
+%endif # if with_python26
+
+
 %prep
 %setup -q -n %{oname}
 
@@ -65,6 +95,12 @@ done
 cp -a . %{py3dir}
 %endif
 
+%if 0%{?with_python26}
+%{__rm} -rf %{py26dir}
+cp -a . %{py26dir}
+%endif
+
+
 %build
 %{__python} setup.py build
 
@@ -74,6 +110,13 @@ pushd %{py3dir}
 popd
 %endif
 
+%if 0%{?with_python26}
+pushd %{py26dir}
+%{__python26} setup.py build
+popd
+%endif
+
+
 %install
 %{__rm} -rf %{buildroot}
 
@@ -87,6 +130,16 @@ pushd %{py3dir}
 popd
 %endif
 
+%if 0%{?with_python26}
+pushd %{py26dir}
+%{__python26} setup.py install -O1 --skip-build --root %{buildroot}
+%{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}%{_bindir}/python26-%{oname}
+%{__sed} -i -e 's/^python /python2.6 /' %{buildroot}%{_bindir}/python26-%{oname}
+%{__chmod} 0755 %{buildroot}%{python26_sitelib}/%{oname}.py
+popd
+%endif
+
+
 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
 %{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}%{_bindir}/%{oname}
 %{__chmod} 0755 %{buildroot}%{python_sitelib}/%{oname}.py
@@ -95,6 +148,7 @@ popd
 %{__install} -d -m 0755 %{buildroot}%{_datadir}/%{oname}
 %{__cp} -a python2/examples/* %{buildroot}%{_datadir}/%{oname}
 
+
 %clean
 %{__rm} -rf %{buildroot}
 
@@ -116,12 +170,21 @@ popd
 %{python3_sitelib}/%{oname}*
 %endif
 
+%if 0%{?with_python26}
+%files -n python26-inotify
+%defattr(-, root, root, -)
+%doc ACKS ChangeLog_old COPYING NEWS_old README.md
+%{_bindir}/python26-%{oname}
+%{python26_sitelib}/%{oname}*
+%endif
+
 
 %changelog
 * Wed Jan 26 2011 Steve Traylen <steve.traylen at cern.ch> - 0.9.1-1
 - 0.9.1
 - Change name of README to README.md
 - Require python-ctypes on EPEL5( python2.4)
+- Add python26 support.
 
 * Wed Aug 25 2010 Thomas Spura <tomspur at fedoraproject.org> - 0.9.0-3
 - rebuild with python3.2


More information about the scm-commits mailing list