- Add python 3 subpackage
- License changed to MIT
This commit is contained in:
terjeros 2010-06-19 16:00:09 +00:00
parent b14b7f1ed3
commit bc108aea4d
3 changed files with 73 additions and 19 deletions

View File

@ -1 +1 @@
pyinotify-0.8.8.tar.gz pyinotify-0.9.0.tar.gz

View File

@ -1,17 +1,22 @@
%global with_python3 1
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")} %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")}
%global oname pyinotify %global oname pyinotify
Summary: Monitor filesystem events with Python under Linux Summary: Monitor filesystem events with Python under Linux
Name: python-inotify Name: python-inotify
Version: 0.8.8 Version: 0.9.0
Release: 1%{?dist} Release: 1%{?dist}
License: GPLv2+ License: MIT
Group: Development/Libraries Group: Development/Libraries
URL: http://trac.dbzteam.org/pyinotify URL: http://trac.dbzteam.org/pyinotify
Source0: http://seb.dbzteam.org/pub/pyinotify/releases/pyinotify-%{version}.tar.gz Source0: http://seb.dbzteam.org/pub/pyinotify/releases/pyinotify-%{version}.tar.gz
Source1: %{oname} Source1: %{oname}
BuildRequires: python-devel BuildRequires: python-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif
BuildArch: noarch BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -22,14 +27,28 @@ recent Linux Kernel feature (merged in kernel 2.6.13) called
inotify. inotify is an event-driven notifier, its notifications are inotify. inotify is an event-driven notifier, its notifications are
exported from kernel space to user space. exported from kernel space to user space.
%package examples %package examples
Summary: Examples for Python inotify module Summary: Examples for Python inotify module
Group: Development/Libraries Group: Development/Libraries
Requires: python-inotify = %{version}-%{release} Requires: python-inotify = %{version}-%{release}
%description examples %description examples
This package includes some examples usage of the Python inotify module, This package includes some examples usage of the Python inotify module.
extensive documentation is also included.
%if 0%{?with_python3}
%package -n python3-inotify
Summary: Monitor filesystem events with Python under Linux
Group: Development/Languages
%description -n python3-inotify
This is a Python 3 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 3 build of pyinotify
%endif # if with_python3
%prep %prep
%setup -q -n %{oname} %setup -q -n %{oname}
@ -37,36 +56,71 @@ extensive documentation is also included.
for f in ChangeLog_old ; do for f in ChangeLog_old ; do
mv $f $f.iso88591 mv $f $f.iso88591
iconv -o $f -f iso88591 -t utf8 $f.iso88591 iconv -o $f -f iso88591 -t utf8 $f.iso88591
rm -f $f.iso88591 %{__rm} -f $f.iso88591
done done
%if 0%{?with_python3}
%{__rm} -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
%{__python} setup.py build %{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install %install
%{__rm} -rf %{buildroot} %{__rm} -rf %{buildroot}
# Install python 3 first, so that python 2 gets precedence:
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
%{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}%{_bindir}/python3-%{oname}
%{__sed} -i -e 's/^python /python3 /' %{buildroot}%{_bindir}/python3-%{oname}
%{__chmod} 0755 %{buildroot}%{python3_sitelib}/%{oname}.py
popd
%endif
%{__python} setup.py install -O1 --skip-build --root %{buildroot} %{__python} setup.py install -O1 --skip-build --root %{buildroot}
%{__install} -d %{buildroot}%{_datadir}/%{name}
#{__cp} -a loop.py chain.py daemon.py loop.py not_quiet.py stats.py \
# stats_threaded.py transient_file.py %{buildroot}%{_datadir}/%{name}
%{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}%{_bindir}/%{oname} %{__install} -D -m 0755 -p %{SOURCE1} %{buildroot}%{_bindir}/%{oname}
%{__chmod} 0755 %{buildroot}%{python_sitelib}/%{oname}.py %{__chmod} 0755 %{buildroot}%{python_sitelib}/%{oname}.py
# examples
%{__install} -d -m 0755 %{buildroot}%{_datadir}/%{oname}
%{__cp} -a python2/examples/* %{buildroot}%{_datadir}/%{oname}
%clean %clean
%{__rm} -rf %{buildroot} %{__rm} -rf %{buildroot}
%files %files
%defattr(-, root, root, -) %defattr(-, root, root, -)
%doc ChangeLog_old NEWS %doc ACKS COPYING ChangeLog_old NEWS_old README
%{python_sitelib}/%{oname}*
%{_bindir}/%{oname} %{_bindir}/%{oname}
%{python_sitelib}/%{oname}*
%files examples %files examples
%defattr(-, root, root, -) %defattr(-, root, root, -)
%doc docstrings/* %{_datadir}/%{oname}
%{_datadir}/%{name}
%if 0%{?with_python3}
%files -n python3-inotify
%defattr(-, root, root, -)
%doc ACKS ChangeLog_old COPYING NEWS_old README
%{_bindir}/python3-%{oname}
%{python3_sitelib}/%{oname}*
%endif
%changelog %changelog
* Sat Jun 19 2010 Terje Rosten <terje.rosten@ntnu.no> - 0.9.0-1
- 0.9.0
- Add python 3 subpackage
- License changed to MIT
* Sun Dec 06 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.8.8-1 * Sun Dec 06 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.8.8-1
- 0.8.8 - 0.8.8

View File

@ -1 +1 @@
3c4214f10955e6be0ac2d054efa55cf8 pyinotify-0.8.8.tar.gz 9822b3cfe1494e1a9e8bce70b1214db7 pyinotify-0.9.0.tar.gz