%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %{?!pybasever:%{expand:%%define pybasever %(%{__python} -c "import sys ; print sys.version[:3]")}} Name: python-twisted-core Version: 10.0.0 Release: 2.0.cf%{?dist} Summary: Asynchronous networking framework written in Python Group: Development/Libraries License: MIT URL: http://twistedmatrix.com/trac/wiki/TwistedCore Source0: http://tmrc.mit.edu/mirror/twisted/Core/10.0/TwistedCore-%{version}.tar.bz2 # Available here: # https://apestaart.org/thomas/trac/browser/pkg/fedora.extras/python-twisted-core/twisted-dropin-cache?format=raw Source1: twisted-dropin-cache BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel, python-zope-interface >= 3.0.1 %if "%{pybasever}" == "2.3" Requires: python-abi = 2.3 %endif Requires: python-zope-interface, pyOpenSSL, pyserial # Don't want provides for python shared objects %{?filter_provides_in: %filter_provides_in %{python_sitearch}/twisted/.*\.so} %{?filter_setup} %description An extensible framework for Python programming, with special focus on event-based network programming and multi-protocol integration. It is expected that one day the project will expanded to the point that the framework will seamlessly integrate with mail, web, DNS, net news, IRC, RDBMSs, desktop environments, and your toaster. Twisted Core is used by most of the servers, clients and protocols that are part of other Twisted projects. %package doc Summary: Documentation for Twisted Core Group: Documentation Requires: python-twisted-core = %{version}-%{release} %description doc Documentation for Twisted Core. %package zsh Summary: Tab completion for Zsh and Twisted Core Group: System Environment/Shells Requires: python-twisted-core = %{version}-%{release} Requires: zsh %description zsh Tab completions for Zsh and Twisted Core. %prep %setup -n TwistedCore-%{version} -q # Turn off exec bits on docs to avoid spurious dependencies /usr/bin/find doc -type f | /usr/bin/xargs chmod 644 # Fix line endings %{__sed} -i -e 's,\r$,,' doc/howto/listings/udp/* # Remove spurious shellbangs %{__sed} -i -e '/^#! *\/usr\/bin\/python/d' \ twisted/internet/glib2reactor.py %{__sed} -i -e '/^#! *\/usr\/bin\/env python/d' \ twisted/trial/test/scripttest.py # Generate a brief README.zsh %{__awk} '/^Zsh Notes:/,/^Have fun!/' twisted/python/zshcomp.py > README.zsh # Fix encodings for f in CREDITS LICENSE; do /usr/bin/iconv -f iso-8859-1 -t utf-8 < ${f} > ${f}.utf8 %{__mv} -f ${f}.utf8 ${f} done %build CFLAGS="%{optflags}" %{__python} setup.py build %install %{__rm} -rf %{buildroot} %{__python} setup.py install -O1 --skip-build --root %{buildroot} # cfsupport is support for MacOSX Core Foundations, so we can delete it %{__rm} -rf %{buildroot}%{python_sitearch}/twisted/internet/cfsupport # iocpreactor is a win32 reactor, so we can delete it %{__rm} -rf %{buildroot}%{python_sitearch}/twisted/internet/iocpreactor # Man pages %{__mkdir_p} %{buildroot}%{_mandir}/man1/ %{__cp} -a doc/man/*.1 %{buildroot}%{_mandir}/man1/ %{__rm} -rf doc/man # Zsh tab complete stub (à la teratorn) %{__mkdir_p} %{buildroot}%{_datadir}/zsh/site-functions/ %{__sed} -e 's#python -c#%{__python} -c#g' twisted/python/_twisted_zsh_stub \ > %{buildroot}%{_datadir}/zsh/site-functions/_twisted_zsh_stub %{__rm} -f %{buildroot}%{python_sitearch}/twisted/python/_twisted_zsh_stub # Some of the zsh completions are no longer appropriate /usr/bin/find %{buildroot}%{python_sitearch}/twisted/python/zsh -size 0c -exec %{__rm} -f {} \; # script to regenerate dropin.cache %{__mkdir_p} %{buildroot}%{_libexecdir} %{__install} -m 755 %{SOURCE1} %{buildroot}%{_libexecdir} # Create an empty dropin.cache to be %ghost-ed /bin/touch %{buildroot}%{python_sitearch}/twisted/plugins/dropin.cache # C files don't need to be packaged %{__rm} -f %{buildroot}%{python_sitearch}/twisted/protocols/_c_urlarg.c %{__rm} -f %{buildroot}%{python_sitearch}/twisted/python/_epoll.c %{__rm} -f %{buildroot}%{python_sitearch}/twisted/python/_initgroups.c %{__rm} -f %{buildroot}%{python_sitearch}/twisted/test/raiser.c # Fix permissions of shared objects %{__chmod} 755 %{buildroot}%{python_sitearch}/twisted/protocols/_c_urlarg.so %{__chmod} 755 %{buildroot}%{python_sitearch}/twisted/python/_epoll.so %{__chmod} 755 %{buildroot}%{python_sitearch}/twisted/python/_initgroups.so %{__chmod} 755 %{buildroot}%{python_sitearch}/twisted/test/raiser.so # See if there's any egg-info if [ -f %{buildroot}%{python_sitearch}/Twisted*.egg-info ]; then echo %{buildroot}%{python_sitearch}/Twisted*.egg-info | %{__sed} -e 's|^%{buildroot}||' fi > egg-info %check # trial twisted # can't get this to work within the buildroot yet %clean %{__rm} -rf %{buildroot} %post %{_libexecdir}/twisted-dropin-cache || : %preun if [ $1 -eq 0 ]; then # Complete removal, not upgrade, so remove plugins cache file %{__rm} -f %{python_sitearch}/twisted/plugins/dropin.cache || : fi %files -f egg-info %defattr(-,root,root,-) %doc CREDITS LICENSE NEWS README %{_bindir}/manhole %{_bindir}/mktap %{_bindir}/pyhtmlizer %{_bindir}/tap2deb %{_bindir}/tap2rpm %{_bindir}/tapconvert %{_bindir}/trial %{_bindir}/twistd %{_libexecdir}/twisted-dropin-cache %{_mandir}/man1/manhole.1* %{_mandir}/man1/mktap.1* %{_mandir}/man1/pyhtmlizer.1* %{_mandir}/man1/tap2deb.1* %{_mandir}/man1/tap2rpm.1* %{_mandir}/man1/tapconvert.1* %{_mandir}/man1/trial.1* %{_mandir}/man1/twistd.1* %dir %{python_sitearch}/twisted/ %{python_sitearch}/twisted/*.py* %{python_sitearch}/twisted/application/ %{python_sitearch}/twisted/cred/ %{python_sitearch}/twisted/enterprise/ %{python_sitearch}/twisted/internet/ %{python_sitearch}/twisted/manhole/ %{python_sitearch}/twisted/persisted/ %dir %{python_sitearch}/twisted/plugins/ %{python_sitearch}/twisted/plugins/*.py* %ghost %{python_sitearch}/twisted/plugins/dropin.cache %{python_sitearch}/twisted/protocols/ %{python_sitearch}/twisted/python/ %{python_sitearch}/twisted/scripts/ %dir %{python_sitearch}/twisted/spread/ %{python_sitearch}/twisted/spread/*.py* %dir %{python_sitearch}/twisted/spread/ui/ %{python_sitearch}/twisted/spread/ui/*.py* %{python_sitearch}/twisted/spread/ui/*.glade %{python_sitearch}/twisted/tap/ %{python_sitearch}/twisted/test/ %{python_sitearch}/twisted/trial/ %files doc %defattr(-,root,root,-) %doc doc/* %files zsh %defattr(-,root,root,-) %doc README.zsh %{_datadir}/zsh/site-functions/_twisted_zsh_stub %changelog * Fri Oct 1 2010 Paul Howarth 10.0.0-2.0.cf - Add pyserial to Requires * Thu Mar 4 2010 Paul Howarth 10.0.0-1.0.cf - Update to 10.0.0 (see NEWS for details) - Another C object (_initgroups) to fix up in %%install - Filter provides for python shared objects * Wed Nov 25 2009 Paul Howarth 9.0.0-1.0.cf - Update to 9.0.0 - Drop upstreamed python 2.6 DeprecationWarnings patch - Remove changed shellbang in twisted/trial/test/scripttest.py * Mon Jun 29 2009 Paul Howarth 8.2.0-3.0.cf - Include patch pulled from debian to fix all python 2.6 DeprecationWarnings (#497783) * Mon Mar 2 2009 Paul Howarth 8.2.0-2.0.cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Fri Jan 16 2009 Paul Howarth 8.2.0-1.0.CF - Update to 8.2.0 - Upstream no longer includes t-im - twisted/trial/test/scripttest.py has a different shellbang to remove * Fri Jan 16 2009 Paul Howarth 8.1.0-2.0.CF - Make sure the scriplets never return a non-zero exit status - Remove dropin.cache file upon package removal * Mon May 19 2008 Paul Howarth 8.1.0-1.0.cf - Update to 8.1.0 - Another C object (raiser) to fix up in %%install * Mon Mar 31 2008 Paul Howarth 8.0.1-1.0.cf - Update to 8.0.1 - New programs pyhtmlizer and t-im - Fix permissions of installed shared objects to placate rpmlint - dropin.cache no longer created by installer so do it ourselves * Mon Mar 10 2008 Paul Howarth 2.5.0-4.0.cf - Include egg info in %%files list if present * Fri Sep 28 2007 Paul Howarth 2.5.0-2.1 - don't include twisted/spread/*.so - fix documentation character encoding where possible * Wed Jan 10 2007 Paul Howarth 2.5.0-1 - update to 2.5.0 - tkmktap no longer included - don't include empty zsh completion stubs * Tue Dec 26 2006 Thomas Vander Stichele 2.4.0-6 - new twisted-dropin-cache; does not complain loudly about plugins in the cache that are no longer installed * Mon Dec 11 2006 Paul Howarth 2.4.0-5 - rebuild for python 2.5 on Rawhide * Fri Nov 3 2006 Paul Howarth 2.4.0-4 - incorporate changes from current FE submission (Thomas Vander Stichele & Jeffrey C. Ollie) - use Twisted Core specific URL - add -doc and -zsh subpackages - don't package C source files * Mon Sep 4 2006 Paul Howarth 2.4.0-3 - split python-twisted into python-twisted metapackage and python-twisted-core - add twisted-dropin-cache script and use it - ghost the dropin.cache file - remove cfsupport (MacOS) and iocpreactor (Windows) bits inappropriate for Linux - don't ghost .pyo files * Fri Jun 9 2006 Paul Howarth 2.4.0-2 - drop dependencies on sub-projects flow, pair, and web2 that are not included in the upstream Twisted bundle - script the python files list generation to clean up the spec * Wed May 31 2006 Paul Howarth 2.4.0-1 - update to 2.4.0 - update Source0 URL to point to core-only tarball * Wed May 10 2006 Paul Howarth 2.2.0-2 - drop python-twisted-xish dep, now bundled with python-twisted-words * Tue May 9 2006 Paul Howarth 2.2.0-1 - import from PyVault Repository - update to 2.2.0 - change python-openssl dep to pyOpenSSL for Fedora compatibility - rewrite in Fedora Extras style * Mon Oct 10 2005 Jeff Pitman 2.1.0-1 - upstream release * Tue Aug 23 2005 Jeff Pitman 2.0.1-1 - upstream release * Mon Apr 04 2005 Jeff Pitman 2.0.0-2 - add zsh support * Fri Mar 25 2005 Jeff Pitman 2.0.0-1 - final release * Thu Mar 17 2005 Jeff Pitman 2.0.0-0.2.a3 - dropped web2 * Wed Mar 16 2005 Jeff Pitman 2.0.0-0.1.a3 - upstream release * Sat Mar 12 2005 Jeff Pitman 2.0.0-0.1.a2 - new prerelease; FE versioning * Mon Feb 07 2005 Jeff Pitman 2.0.0a1-1 - prep for split * Fri Aug 20 2004 Jeff Pitman 1.3.0-1 - new version * Mon Apr 19 2004 Jeff Pitman 1.2.0-3 - vaultize * Mon Apr 12 2004 Jeff Pitman 1.2.0-2 - require pyOpenSSL, SOAPpy, openssh-clients, crypto, dia so trial can run