perl-FCGI-vl.spec 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. %define pkgname FCGI
  2. %define filelist %{pkgname}-%{version}-filelist
  3. %define maketest 1
  4. Name: perl-FCGI
  5. Summary: FCGI - Perl module
  6. Version: 0.67
  7. Release: 3%{_dist_release}
  8. License: Artistic
  9. Group: Development/Libraries
  10. Url: http://www.cpan.org
  11. Buildroot: %{_tmppath}/%{name}-%{version}
  12. Source: http://search.cpan.org//CPAN/authors/id/S/SK/SKIMO/FCGI-%{version}.tar.gz
  13. %description
  14. This is a FastCGI module for perl.
  15. %prep
  16. %setup -q -n %{pkgname}-%{version}
  17. chmod -R u+w %{_builddir}/%{pkgname}-%{version}
  18. %build
  19. grep -rsl '^#!.*perl' . |
  20. grep -v '.bak$' |xargs --no-run-if-empty \
  21. %__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
  22. CFLAGS="$RPM_OPT_FLAGS"
  23. %{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '` INSTALLDIRS=vendor
  24. %{__make}
  25. %install
  26. [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
  27. %{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '`
  28. cmd=/usr/share/spec-helper/compress_files
  29. [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
  30. [ -x $cmd ] && $cmd
  31. # SuSE Linux
  32. if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
  33. then
  34. %{__mkdir_p} %{buildroot}/var/adm/perl-modules
  35. %{__cat} `find %{buildroot} -name "perllocal.pod"` \
  36. | %{__sed} -e s+%{buildroot}++g \
  37. > %{buildroot}/var/adm/perl-modules/%{name}
  38. fi
  39. # remove special files
  40. find %{buildroot} -name "perllocal.pod" \
  41. -o -name ".packlist" \
  42. -o -name "*.bs" \
  43. |xargs -i rm -f {}
  44. # no empty directories
  45. find %{buildroot}%{_prefix} \
  46. -type d -depth \
  47. -exec rmdir {} \; 2>/dev/null
  48. %{__perl} -MFile::Find -le '
  49. find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
  50. print "%doc configure.readme LICENSE.TERMS README";
  51. for my $x (sort @dirs, @files) {
  52. push @ret, $x unless indirs($x);
  53. }
  54. print join "\n", sort @ret;
  55. sub wanted {
  56. return if /auto$/;
  57. local $_ = $File::Find::name;
  58. my $f = $_; s|^\Q%{buildroot}\E||;
  59. return unless length;
  60. return $files[@files] = $_ if -f $f;
  61. $d = $_;
  62. /\Q$d\E/ && return for reverse sort @INC;
  63. $d =~ /\Q$_\E/ && return
  64. for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
  65. $dirs[@dirs] = $_;
  66. }
  67. sub indirs {
  68. my $x = shift;
  69. $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
  70. }
  71. ' > %filelist
  72. [ -z %filelist ] && {
  73. echo "ERROR: empty %files listing"
  74. exit -1
  75. }
  76. %clean
  77. [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
  78. %check
  79. %if %maketest
  80. %{__make} test
  81. %endif
  82. %files -f %filelist
  83. %defattr(-,root,root)
  84. %changelog
  85. * Sat Jan 17 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.67-3
  86. - changed Group to Development/Libraries
  87. * Wed Apr 30 2008 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 0.67-2
  88. - rebuilt with perl-5.10.0.
  89. * Sun Apr 27 2008 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 0.67-1
  90. - initial build.