perl-Coro-vl.spec 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. Name: perl-Coro
  2. Version: 6.07
  3. Release: 1%{?_dist_release}
  4. Summary: The only real threads in perl
  5. License: GPL+ or Artistic
  6. Group: Development/Libraries
  7. URL: http://search.cpan.org/dist/Coro/
  8. Source0: http://search.cpan.org/CPAN/authors/id/M/ML/MLEHMANN/Coro-%{version}.tar.gz
  9. Patch0: %{name}-5.25-ucontext-default.patch
  10. BuildRequires: perl(AnyEvent) >= 5
  11. BuildRequires: perl(common::sense)
  12. BuildRequires: perl(ExtUtils::MakeMaker)
  13. BuildRequires: perl(Guard) >= 0.5
  14. BuildRequires: perl(Scalar::Util)
  15. BuildRequires: perl(Storable) >= 2.15
  16. BuildRequires: perl(Time::HiRes)
  17. # Recommended optional modules
  18. BuildRequires: perl(AnyEvent::AIO) >= 1
  19. BuildRequires: perl(AnyEvent::BDB) >= 1
  20. BuildRequires: perl(BDB)
  21. # perl-EV not packaged
  22. BuildRequires: perl(EV) >= 3
  23. BuildRequires: perl(Event) >= 1.08
  24. BuildRequires: perl(IO::AIO) >= 3.1
  25. Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
  26. # Export correct required versions
  27. Requires: perl(AnyEvent) >= 5
  28. Requires: perl(AnyEvent::AIO) >= 1
  29. Requires: perl(AnyEvent::BDB) >= 1
  30. Requires: perl(EV) >= 3
  31. Requires: perl(Event) >= 1.08
  32. Requires: perl(Guard) >= 0.5
  33. Requires: perl(Storable) >= 2.15
  34. %description
  35. This module collection manages continuations in general, most often in the
  36. form of cooperative threads (also called coros, or simply "coro" in the
  37. documentation). They are similar to kernel threads but don't (in general) run
  38. in parallel at the same time even on SMP machines. The specific flavor of
  39. thread offered by this module also guarantees you that it will not switch
  40. between threads unless necessary, at easily-identified points in your
  41. program, so locking and parallel access are rarely an issue, making thread
  42. programming much safer and easier than using other thread models.
  43. %prep
  44. %setup -q -n Coro-%{version}
  45. # use ucontext backend on non-x86 (setjmp didn't work on s390(x))
  46. %ifnarch %{ix86} x86_64 %{arm}
  47. %patch0 -p1 -b .ucontext-default
  48. %endif
  49. for F in Coro/jit-*.pl; do
  50. sed -i -e '/^#!/d' "$F"
  51. chmod -x "$F"
  52. done
  53. %global wrong_shbangs eg/myhttpd
  54. %if %{defined fix_shbang_line}
  55. %fix_shbang_line %wrong_shbangs
  56. %else
  57. # at least EL6 doesn't have the %%fix_shbang_line macro
  58. sed -i -e '/^#!/ s|.*|#!%{__perl}|' %wrong_shbangs
  59. %endif
  60. %if %{_dist_release} < "vl7"
  61. # Filter underspecified dependencies
  62. cat << \EOF > %{name}-prov
  63. #!/bin/sh
  64. %{__perl_provides} $* |\
  65. sed -e '/^perl(Coro)$/d'
  66. EOF
  67. %global __perl_provides %{_builddir}/Coro-%{version}/%{name}-prov
  68. chmod +x %{__perl_provides}
  69. cat << \EOF > %{name}-req
  70. #!/bin/sh
  71. %{__perl_requires} $* |\
  72. sed -e '/^perl(AnyEvent)$/d' |\
  73. sed -e '/^perl(AnyEvent >= 4.800001$/d' |\
  74. sed -e '/^perl(AnyEvent::AIO)$/d' |\
  75. sed -e '/^perl(AnyEvent::BDB)$/d' |\
  76. sed -e '/^perl(EV)$/d' |\
  77. sed -e '/^perl(Event)$/d' |\
  78. sed -e '/^perl(Guard)$/d' |\
  79. sed -e '/^perl(Storable)$/d'
  80. EOF
  81. %global __perl_requires %{_builddir}/Coro-%{version}/%{name}-req
  82. chmod +x %{__perl_requires}
  83. %{?perl_default_filter}
  84. %else
  85. # RPM 4.9 style:
  86. # Filter underspecified dependencies
  87. %global __requires_exclude %{?__requires_exclude:__requires_exclude|}^perl\\(AnyEvent\\)$
  88. %global __requires_exclude %__requires_exclude|^perl\\(AnyEvent\\) >= 4.800001$
  89. %global __requires_exclude %__requires_exclude|^perl\\(AnyEvent::AIO\\)$
  90. %global __requires_exclude %__requires_exclude|^perl\\(AnyEvent::BDB\\)$
  91. %global __requires_exclude %__requires_exclude|^perl\\(EV\\)$
  92. %global __requires_exclude %__requires_exclude|^perl\\(Event\\)$
  93. %global __requires_exclude %__requires_exclude|^perl\\(Guard\\)$
  94. %global __requires_exclude %__requires_exclude|^perl\\(Storable\\)$
  95. %global __requires_exclude %__requires_exclude|^perl\\(Coro\\)$
  96. %global __provides_exclude %{?__provides_exclude:__provides_exclude|}^perl\\(Coro\\)$
  97. %endif
  98. %build
  99. # Disable FORTIFY_SOURCE on ARM as it breaks setjmp - RHBZ 750805
  100. %ifarch %{arm}
  101. RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2/-D_FORTIFY_SOURCE=0/g')
  102. %endif
  103. # Interractive configuration. Use default values.
  104. %{__perl} Makefile.PL INSTALLDIRS=perl OPTIMIZE="$RPM_OPT_FLAGS" </dev/null
  105. make %{?_smp_mflags}
  106. %install
  107. make pure_install PERL_INSTALL_ROOT=%{buildroot}
  108. find %{buildroot} -type f -name .packlist -exec rm -f {} \;
  109. find %{buildroot} -type f -name '*.bs' -size 0 -exec rm -f {} \;
  110. find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null \;
  111. %{_fixperms} %{buildroot}/*
  112. %check
  113. make test
  114. %files
  115. %defattr(-,root,root,-)
  116. %doc Changes COPYING README README.linux-glibc
  117. %doc doc/* eg
  118. %{perl_archlib}/auto/*
  119. %{perl_archlib}/Coro*
  120. %{_mandir}/man3/*
  121. %changelog
  122. * Fri Mar 02 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 6.07-1
  123. - initial build for Vine Linux
  124. * Tue Feb 21 2012 Peter Robinson <pbrobinson@fedoraproject.org> - 6.07-3
  125. - Add patch to fix build on ARM. RHBZ 750805
  126. * Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.07-2
  127. - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
  128. * Fri Dec 09 2011 Petr Pisar <ppisar@redhat.com> - 6.07-1
  129. - 6.07 bump
  130. * Thu Nov 03 2011 Nicolas Chauvet <kwizart@gmail.com> - 6.06-2
  131. - Fix ucontext on ARM - rhbz750805
  132. * Fri Aug 12 2011 Petr Sabata <contyk@redhat.com> - 6.06-1
  133. - 6.06 bump
  134. * Fri Aug 05 2011 Petr Sabata <contyk@redhat.com> - 6.05-1
  135. - 6.05 bump
  136. * Thu Aug 04 2011 Petr Sabata <contyk@redhat.com> - 6.04-1
  137. - 6.04 bump
  138. * Fri Jul 29 2011 Petr Pisar <ppisar@redhat.com> - 6.02-1
  139. - 6.02 bump
  140. - Major version 6 breaks compatibility: Unreferenced coro objects will now be
  141. destroyed and cleaned up automatically (e.g. async { schedule }).
  142. * Tue Jun 21 2011 Marcela Mašláňová <mmaslano@redhat.com> - 5.372-4
  143. - Perl mass rebuild
  144. * Fri Apr 08 2011 Mathieu Bridon <bochecha@fedoraproject.org> - 5.372-3
  145. - Added explicit versionned Requires: on perl(EV)
  146. - Removed automatically added unversionned Requires: on perl(EV)
  147. * Thu Apr 07 2011 Mathieu Bridon <bochecha@fedoraproject.org> - 5.372-2
  148. - Rebuild with EV support.
  149. * Mon Mar 07 2011 Petr Pisar <ppisar@redhat.com> - 5.372-1
  150. - 5.372 bump
  151. * Mon Feb 21 2011 Petr Pisar <ppisar@redhat.com> - 5.37-1
  152. - 5.37 bump
  153. - Fix State.xs syntax (RT#65991)
  154. - Version unversioned Provides
  155. * Mon Feb 14 2011 Petr Pisar <ppisar@redhat.com> - 5.26-1
  156. - 5.26 bump
  157. * Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.25-4
  158. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  159. * Fri Jan 21 2011 Mathieu Bridon <bochecha@fedoraproject.org> 5.25-3
  160. - Allow building on systems without %%fix_shbang_line macro (needed for EL6)
  161. * Mon Jan 10 2011 Dan Horák <dan[at]danny.cz> 5.25-2
  162. - use ucontext backend on non-x86
  163. * Tue Jan 04 2011 Petr Pisar <ppisar@redhat.com> 5.25-1
  164. - 5.25 import
  165. - Disable perl(EV) support as it's not packaged yet