RT notifier: parse templates without header correctly
[openxpki.git] / trunk / package / suse / external-dependencies / Want.spec
blob6d9b43ec92f96558125993927a2af46242e6a866
2 # - Want -
3 # This spec file was automatically generated by cpan2rpm [ver: 2.027]
4 # The following arguments were used:
5 # --spec-only --version=0.12 '--author=Robin Houston' Want-0.12.tar.gz
6 # For more information on cpan2rpm please visit: http://perl.arix.com/
9 %define pkgname Want
10 %define filelist %{pkgname}-%{version}-filelist
11 %define NVR %{pkgname}-%{version}-%{release}
12 %define maketest 1
14 name: perl-Want
15 summary: Want - A generalisation of "wantarray"
16 version: 0.12
17 release: 1
18 vendor: Robin Houston
19 packager: Arix International <cpan2rpm@arix.com>
20 license: Artistic
21 group: Applications/CPAN
22 url: http://www.cpan.org
23 buildroot: %{_tmppath}/%{name}-%{version}-%(id -u -n)
24 prefix: %(echo %{_prefix})
25 source: Want-0.12.tar.gz
27 %description
28 This module generalises the mechanism of the wantarray function,
29 allowing a function to determine in some detail how its return value
30 is going to be immediately used.
33 # This package was generated automatically with the cpan2rpm
34 # utility. To get this software or for more information
35 # please visit: http://perl.arix.com/
38 %prep
39 %setup -q -n %{pkgname}-%{version}
40 chmod -R u+w %{_builddir}/%{pkgname}-%{version}
42 %build
43 grep -rsl '^#!.*perl' . |
44 grep -v '.bak$' |xargs --no-run-if-empty \
45 %__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
46 CFLAGS="$RPM_OPT_FLAGS"
47 %{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '`
48 %{__make}
49 %if %maketest
50 %{__make} test
51 %endif
53 %install
54 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
56 %{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '`
58 cmd=/usr/share/spec-helper/compress_files
59 [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
60 [ -x $cmd ] && $cmd
62 # SuSE Linux
63 if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
64 then
65 %{__mkdir_p} %{buildroot}/var/adm/perl-modules
66 %{__cat} `find %{buildroot} -name "perllocal.pod"` \
67 | %{__sed} -e s+%{buildroot}++g \
68 > %{buildroot}/var/adm/perl-modules/%{name}
71 # remove special files
72 find %{buildroot} -name "perllocal.pod" \
73 -o -name ".packlist" \
74 -o -name "*.bs" \
75 |xargs -i rm -f {}
77 # no empty directories
78 find %{buildroot}%{_prefix} \
79 -type d -depth \
80 -exec rmdir {} \; 2>/dev/null
82 %{__perl} -MFile::Find -le '
83 find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
84 print "%doc TODO Changes README";
85 for my $x (sort @dirs, @files) {
86 push @ret, $x unless indirs($x);
88 print join "\n", sort @ret;
90 sub wanted {
91 return if /auto$/;
93 local $_ = $File::Find::name;
94 my $f = $_; s|^\Q%{buildroot}\E||;
95 return unless length;
96 return $files[@files] = $_ if -f $f;
98 $d = $_;
99 /\Q$d\E/ && return for reverse sort @INC;
100 $d =~ /\Q$_\E/ && return
101 for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
103 $dirs[@dirs] = $_;
106 sub indirs {
107 my $x = shift;
108 $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
110 ' > %filelist
112 [ -z %filelist ] && {
113 echo "ERROR: empty %files listing"
114 exit -1
117 %clean
118 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
120 %files -f %filelist
121 %defattr(-,root,root)
123 %changelog
124 * Tue Dec 19 2006 root@dca02
125 - Initial build.