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