Debian package updates by Jochen Kunkel
[openxpki.git] / trunk / package / suse / external-dependencies / Test-Pod-Coverage.spec
blobf6f009963fba3a7b32d3844fcbe64c62a31af633
2 # - Test::Pod::Coverage -
3 # This spec file was automatically generated by cpan2rpm [ver: 2.027]
4 # The following arguments were used:
5 # --spec-only --version=1.08 '--author=Andy Lester' Test-Pod-Coverage-1.08.tar.gz
6 # For more information on cpan2rpm please visit: http://perl.arix.com/
9 %define pkgname Test-Pod-Coverage
10 %define filelist %{pkgname}-%{version}-filelist
11 %define NVR %{pkgname}-%{version}-%{release}
12 %define maketest 1
14 name: perl-Test-Pod-Coverage
15 summary: Test-Pod-Coverage - Check for pod coverage in your distribution
16 version: 1.08
17 release: 1
18 vendor: Andy Lester
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 buildarch: noarch
25 prefix: %(echo %{_prefix})
26 source: Test-Pod-Coverage-1.08.tar.gz
28 %description
29 Checks for POD coverage in files for your distribution.
31 use Test::Pod::Coverage tests=>1;
32 pod_coverage_ok( "Foo::Bar", "Foo::Bar is covered" );
34 Can also be called with Pod::Coverage parms.
36 use Test::Pod::Coverage tests=>1;
37 pod_coverage_ok(
38 "Foo::Bar",
39 { also_private => [ qr/^[A-Z_]+$/ ], },
40 "Foo::Bar, with all-caps functions as privates",
43 The Pod::Coverage parms are also useful for subclasses that don't
44 re-document the parent class's methods. Here's an example from
45 Mail::SRS.
47 pod_coverage_ok( "Mail::SRS" ); # No exceptions
49 # Define the three overridden methods.
50 my $trustme = { trustme => [qr/^(new|parse|compile)$/] };
51 pod_coverage_ok( "Mail::SRS::DB", $trustme );
52 pod_coverage_ok( "Mail::SRS::Guarded", $trustme );
53 pod_coverage_ok( "Mail::SRS::Reversable", $trustme );
54 pod_coverage_ok( "Mail::SRS::Shortcut", $trustme );
56 Alternately, you could use Pod::Coverage::CountParents, which always allows
57 a subclass to reimplement its parents' methods without redocumenting them. For
58 example:
60 my $trustparents = { coverage_class => 'Pod::Coverage::CountParents' };
61 pod_coverage_ok( "IO::Handle::Frayed", $trustparents );
63 (The "coverage_class" parameter is not passed to the coverage class with other
64 parameters.)
66 If you want POD coverage for your module, but don't want to make
67 Test::Pod::Coverage a prerequisite for installing, create the following
68 as your t/pod-coverage.t file:
70 use Test::More;
71 eval "use Test::Pod::Coverage";
72 plan skip_all => "Test::Pod::Coverage required for testing pod coverage" if $@;
74 plan tests => 1;
75 pod_coverage_ok( "Pod::Master::Html");
77 Finally, Module authors can include the following in a t/pod-coverage.t
78 file and have "Test::Pod::Coverage" automatically find and check all
79 modules in the module distribution:
81 use Test::More;
82 eval "use Test::Pod::Coverage 1.00";
83 plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
84 all_pod_coverage_ok();
87 # This package was generated automatically with the cpan2rpm
88 # utility. To get this software or for more information
89 # please visit: http://perl.arix.com/
92 %prep
93 %setup -q -n %{pkgname}-%{version}
94 chmod -R u+w %{_builddir}/%{pkgname}-%{version}
96 %build
97 grep -rsl '^#!.*perl' . |
98 grep -v '.bak$' |xargs --no-run-if-empty \
99 %__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
100 CFLAGS="$RPM_OPT_FLAGS"
101 %{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '`
102 %{__make}
103 %if %maketest
104 %{__make} test
105 %endif
107 %install
108 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
110 %{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '`
112 cmd=/usr/share/spec-helper/compress_files
113 [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
114 [ -x $cmd ] && $cmd
116 # SuSE Linux
117 if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
118 then
119 %{__mkdir_p} %{buildroot}/var/adm/perl-modules
120 %{__cat} `find %{buildroot} -name "perllocal.pod"` \
121 | %{__sed} -e s+%{buildroot}++g \
122 > %{buildroot}/var/adm/perl-modules/%{name}
125 # remove special files
126 find %{buildroot} -name "perllocal.pod" \
127 -o -name ".packlist" \
128 -o -name "*.bs" \
129 |xargs -i rm -f {}
131 # no empty directories
132 find %{buildroot}%{_prefix} \
133 -type d -depth \
134 -exec rmdir {} \; 2>/dev/null
136 %{__perl} -MFile::Find -le '
137 find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
138 print "%doc Changes";
139 for my $x (sort @dirs, @files) {
140 push @ret, $x unless indirs($x);
142 print join "\n", sort @ret;
144 sub wanted {
145 return if /auto$/;
147 local $_ = $File::Find::name;
148 my $f = $_; s|^\Q%{buildroot}\E||;
149 return unless length;
150 return $files[@files] = $_ if -f $f;
152 $d = $_;
153 /\Q$d\E/ && return for reverse sort @INC;
154 $d =~ /\Q$_\E/ && return
155 for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
157 $dirs[@dirs] = $_;
160 sub indirs {
161 my $x = shift;
162 $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
164 ' > %filelist
166 [ -z %filelist ] && {
167 echo "ERROR: empty %files listing"
168 exit -1
171 %clean
172 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
174 %files -f %filelist
175 %defattr(-,root,root)
177 %changelog
178 * Thu Nov 23 2006 root@dca02
179 - Initial build.