source: projects/specs/trunk/p/perl-Encode-Detect/perl-Encode-Detect-vl.spec @ 10769

Revision 10769, 3.4 KB checked in by ara_t, 8 years ago (diff)

rebuild with gcc-5.4.0

Line 
1%define pkgname Encode-Detect
2%define filelist %{pkgname}-%{version}-filelist
3%define NVR %{pkgname}-%{version}-%{release}
4%define maketest 1
5
6Name:      perl-Encode-Detect
7Summary:   Encode-Detect - An Encode::Encoding subclass that detects the encoding of data
8Version:   1.01
9Release:   2%{?_dist_release}
10Vendor:    Project Vine
11Packager:  tomop
12Distribution: Vine Linux
13License:   Artistic
14Group:     Development/Libraries
15Url:       http://www.cpan.org
16BuildRoot: %{_tmppath}/%{name}-%{version}-%(id -u -n)
17Source:    http://search.cpan.org//CPAN/authors/id/J/JG/JGMYERS/Encode-Detect-1.01.tar.gz
18
19%description
20This Perl module is an Encode::Encoding subclass that uses
21Encode::Detect::Detector to determine the charset of the input data
22and then decodes it using the encoder of the detected charset.
23
24It is similar to Encode::Guess, but does not require the configuration
25of a set of expected encodings.  Like Encode::Guess, it only supports
26decoding--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}
36chmod -R u+w %{_builddir}/%{pkgname}-%{version}
37
38%build
39grep -rsl '^#!.*perl' . |
40grep -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
53cmd=/usr/share/spec-helper/compress_files
54[ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
55[ -x $cmd ] && $cmd
56
57# SuSE Linux
58if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
59then
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}
64fi
65
66# remove special files
67find %{buildroot} -name "perllocal.pod" \
68    -o -name ".packlist"                \
69    -o -name "*.bs"                     \
70    |xargs -i rm -f {}
71
72# no empty directories
73find %{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* Fri Sep 02 2016 Toshiaki Ara <ara_t@384.jp> 1.01-2
120- rebuild with gcc-5.4.0
121
122* Mon Jun 30 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.01-1
123- initial build for Vine Linux.
Note: See TracBrowser for help on using the repository browser.