1 |
# $Id: Test-Inline.spec,v 1.1 2013/01/24 19:33:08 slords Exp $ |
2 |
|
3 |
# |
4 |
# - Test::Inline - |
5 |
# This spec file was automatically generated by cpan2rpm [ver: 2.026] |
6 |
# The following arguments were used: |
7 |
# --release=1centos Test::Inline |
8 |
# For more information on cpan2rpm please visit: http://perl.arix.com/ |
9 |
# |
10 |
%define pkgname Test-Inline |
11 |
%define filelist %{pkgname}-%{version}-filelist |
12 |
%define NVR %{pkgname}-%{version}-%{release} |
13 |
%define maketest 1 |
14 |
|
15 |
name: perl-Test-Inline |
16 |
summary: Test-Inline - Inlining your tests next to the code being tested. |
17 |
version: 0.16 |
18 |
release: 1%{?dist} |
19 |
license: Artistic |
20 |
group: Applications/CPAN |
21 |
url: http://www.cpan.org |
22 |
buildroot: %{_tmppath}/%{name}-%{version}-%(id -u -n) |
23 |
buildarch: noarch |
24 |
prefix: %(echo %{_prefix}) |
25 |
source: http://search.cpan.org/dist/M/MS/MSCHWERN/Test-Inline-0.16.tar.gz |
26 |
buildrequires: perl(ExtUtils::MakeMaker) |
27 |
buildrequires: perl(Test::More) |
28 |
|
29 |
%description |
30 |
B<LOOK AT Test::Inline::Tutorial FIRST!> |
31 |
|
32 |
Embedding tests allows tests to be placed near the code its testing. |
33 |
This is a nice supplement to the traditional .t files. It's like |
34 |
XUnit, Perl-style. |
35 |
|
36 |
Test::Tutorial is just documentation. To actually get anything done |
37 |
you use pod2test. Read the Test::Inline::Tutoral, really. |
38 |
|
39 |
A test is denoted using either "=for testing" or a "=begin/end |
40 |
testing" block. |
41 |
|
42 |
=item B<is_pirate> |
43 |
|
44 |
@pirates = is_pirate(@arrrgs); |
45 |
|
46 |
Go through @arrrgs and return a list of pirates. |
47 |
|
48 |
=begin testing |
49 |
|
50 |
my @p = is_pirate('Blargbeard', 'Alfonse', 'Capt. Hampton', 'Wesley'); |
51 |
ok(@p == 2); |
52 |
|
53 |
=end testing |
54 |
|
55 |
# |
56 |
# This package was generated automatically with the cpan2rpm |
57 |
# utility. To get this software or for more information |
58 |
# please visit: http://perl.arix.com/ |
59 |
# |
60 |
|
61 |
%prep |
62 |
%setup -q -n %{pkgname}-%{version} |
63 |
chmod -R u+w %{_builddir}/%{pkgname}-%{version} |
64 |
|
65 |
%build |
66 |
grep -rsl '^#!.*perl' . | |
67 |
grep -v '.bak$' |xargs --no-run-if-empty \ |
68 |
%__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' |
69 |
CFLAGS="$RPM_OPT_FLAGS" |
70 |
%{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '` |
71 |
%{__make} |
72 |
%if %maketest |
73 |
%{__make} test |
74 |
%endif |
75 |
|
76 |
%install |
77 |
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} |
78 |
|
79 |
%{makeinstall} INSTALLDIRS=vendor `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '` |
80 |
|
81 |
[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress |
82 |
|
83 |
# SuSE Linux |
84 |
if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ] |
85 |
then |
86 |
%{__mkdir_p} %{buildroot}/var/adm/perl-modules |
87 |
%{__cat} `find %{buildroot} -name "perllocal.pod"` \ |
88 |
| %{__sed} -e s+%{buildroot}++g \ |
89 |
> %{buildroot}/var/adm/perl-modules/%{name} |
90 |
fi |
91 |
|
92 |
# remove special files |
93 |
find %{buildroot} -name "perllocal.pod" \ |
94 |
-o -name ".packlist" \ |
95 |
-o -name "*.bs" \ |
96 |
|xargs -i rm -f {} |
97 |
|
98 |
# no empty directories |
99 |
find %{buildroot}%{_prefix} \ |
100 |
-type d -depth \ |
101 |
-exec rmdir {} \; 2>/dev/null |
102 |
|
103 |
%{__perl} -MFile::Find -le ' |
104 |
find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}"); |
105 |
print "%doc bin Changes docs"; |
106 |
for my $x (sort @dirs, @files) { |
107 |
push @ret, $x unless indirs($x); |
108 |
} |
109 |
print join "\n", sort @ret; |
110 |
|
111 |
sub wanted { |
112 |
return if /auto$/; |
113 |
|
114 |
local $_ = $File::Find::name; |
115 |
my $f = $_; s|^\Q%{buildroot}\E||; |
116 |
return unless length; |
117 |
return $files[@files] = $_ if -f $f; |
118 |
|
119 |
$d = $_; |
120 |
/\Q$d\E/ && return for reverse sort @INC; |
121 |
$d =~ /\Q$_\E/ && return |
122 |
for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|; |
123 |
|
124 |
$dirs[@dirs] = $_; |
125 |
} |
126 |
|
127 |
sub indirs { |
128 |
my $x = shift; |
129 |
$x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs; |
130 |
} |
131 |
' > %filelist |
132 |
|
133 |
[ -z %filelist ] && { |
134 |
echo "ERROR: empty %files listing" |
135 |
exit -1 |
136 |
} |
137 |
|
138 |
%clean |
139 |
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} |
140 |
|
141 |
%files -f %filelist |
142 |
%defattr(-,root,root) |
143 |
|
144 |
%changelog |
145 |
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com> |
146 |
- Clean up spec so package can be built by koji/plague |
147 |
|
148 |
* Thu Dec 07 2006 Shad L. Lords <slords@mail.com> |
149 |
- Update to new release naming. No functional changes. |
150 |
- Make Packager generic |
151 |
|
152 |
* Thu Sep 2 2004 charlieb@charlieb-centos |
153 |
- Initial build. |