perl-Encode-Detect-vl.spec 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. %define pkgname Encode-Detect
  2. %define filelist %{pkgname}-%{version}-filelist
  3. %define NVR %{pkgname}-%{version}-%{release}
  4. %define maketest 1
  5. Name: perl-Encode-Detect
  6. Summary: Encode-Detect - An Encode::Encoding subclass that detects the encoding of data
  7. Version: 1.01
  8. Release: 2%{?_dist_release}
  9. Vendor: Project Vine
  10. Packager: tomop
  11. Distribution: Vine Linux
  12. License: Artistic
  13. Group: Development/Libraries
  14. Url: http://www.cpan.org
  15. BuildRoot: %{_tmppath}/%{name}-%{version}-%(id -u -n)
  16. Source: http://search.cpan.org//CPAN/authors/id/J/JG/JGMYERS/Encode-Detect-1.01.tar.gz
  17. %description
  18. This Perl module is an Encode::Encoding subclass that uses
  19. Encode::Detect::Detector to determine the charset of the input data
  20. and then decodes it using the encoder of the detected charset.
  21. It is similar to Encode::Guess, but does not require the configuration
  22. of a set of expected encodings. Like Encode::Guess, it only supports
  23. decoding--it cannot encode.
  24. #
  25. # This package was generated automatically with the cpan2rpm
  26. # utility. To get this software or for more information
  27. # please visit: http://perl.arix.com/
  28. #
  29. %prep
  30. %setup -q -n %{pkgname}-%{version}
  31. chmod -R u+w %{_builddir}/%{pkgname}-%{version}
  32. %build
  33. grep -rsl '^#!.*perl' . |
  34. grep -v '.bak$' |xargs --no-run-if-empty \
  35. %__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
  36. %{__perl} Build.PL installdirs=vendor
  37. %{__perl} Build
  38. %if %maketest
  39. %{__perl} Build test
  40. %endif
  41. %install
  42. [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
  43. %{__perl} Build install destdir=%{buildroot}
  44. cmd=/usr/share/spec-helper/compress_files
  45. [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
  46. [ -x $cmd ] && $cmd
  47. # SuSE Linux
  48. if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
  49. then
  50. %{__mkdir_p} %{buildroot}/var/adm/perl-modules
  51. %{__cat} `find %{buildroot} -name "perllocal.pod"` \
  52. | %{__sed} -e s+%{buildroot}++g \
  53. > %{buildroot}/var/adm/perl-modules/%{name}
  54. fi
  55. # remove special files
  56. find %{buildroot} -name "perllocal.pod" \
  57. -o -name ".packlist" \
  58. -o -name "*.bs" \
  59. |xargs -i rm -f {}
  60. # no empty directories
  61. find %{buildroot}%{_prefix} \
  62. -type d -depth \
  63. -exec rmdir {} \; 2>/dev/null
  64. %{__perl} -MFile::Find -le '
  65. find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
  66. print "%doc src include Changes LICENSE";
  67. for my $x (sort @dirs, @files) {
  68. push @ret, $x unless indirs($x);
  69. }
  70. print join "\n", sort @ret;
  71. sub wanted {
  72. return if /auto$/;
  73. local $_ = $File::Find::name;
  74. my $f = $_; s|^\Q%{buildroot}\E||;
  75. return unless length;
  76. return $files[@files] = $_ if -f $f;
  77. $d = $_;
  78. /\Q$d\E/ && return for reverse sort @INC;
  79. $d =~ /\Q$_\E/ && return
  80. for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
  81. $dirs[@dirs] = $_;
  82. }
  83. sub indirs {
  84. my $x = shift;
  85. $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
  86. }
  87. ' > %filelist
  88. [ -z %filelist ] && {
  89. echo "ERROR: empty %files listing"
  90. exit -1
  91. }
  92. %clean
  93. [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
  94. %files -f %filelist
  95. %defattr(-,root,root)
  96. %changelog
  97. * Fri Sep 02 2016 Toshiaki Ara <ara_t@384.jp> 1.01-2
  98. - rebuild with gcc-5.4.0
  99. * Mon Jun 30 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.01-1
  100. - initial build for Vine Linux.