3 # This spec file was automatically generated by cpan2rpm [ver: 2.027]
4 # The following arguments were used:
5 # --spec-only --version=0.27 '--author=Marty Pauley' Class-Accessor-0.27.tar.gz
6 # For more information on cpan2rpm please visit: http://perl.arix.com/
9 %define pkgname Class
-Accessor
10 %define filelist
%{pkgname}-%{version}-filelist
11 %define NVR
%{pkgname}-%{version}-%{release}
14 name
: perl
-Class
-Accessor
15 summary
: Class
-Accessor
- Automated accessor generation
19 packager
: Arix International
<cpan2rpm@arix.com
>
21 group
: Applications
/CPAN
22 url
: http
://www.cpan.org
23 buildroot
: %{_tmppath}/%{name}-%{version}-%
(id
-u
-n
)
25 prefix
: %
(echo %{_prefix})
26 source: Class
-Accessor
-0.27.tar.gz
29 This module automagically generates accessors
/mutators
for your class.
31 Most of the
time, writing accessors is an exercise
in cutting and
32 pasting. You usually wind up with a series of methods like this
:
37 $self
->{name
} = $_
[0];
45 $self
->{salary
} = $_
[0];
47 return $self
->{salary
};
52 One
for each piece of data
in your object. While some will be unique
,
53 doing value checks and special storage tricks
, most will simply be
54 exercises
in repetition. Not only is it Bad Style to have a bunch of
55 repetitious code
, but its also simply not lazy
, which is the real
58 If you
make your module a subclass of Class
::Accessor and
declare your
59 accessor fields with mk_accessors
() then you'll find yourself with a
60 set of automatically generated accessors which can even be
63 The basic
set up is very simple
:
66 use base qw
(Class
::Accessor
);
67 My
::Class
->mk_accessors
( qw
(foo bar car
) );
69 Done. My
::Class now has simple foo
(), bar
() and car
() accessors
73 # This package was generated automatically with the cpan2rpm
74 # utility. To get this software or for more information
75 # please visit: http://perl.arix.com/
79 %setup -q
-n
%{pkgname}-%{version}
80 chmod
-R u
+w
%{_builddir}/%{pkgname}-%{version}
83 grep
-rsl '^
#!.*perl' . |
84 grep
-v '.bak$' |xargs
--no
-run
-if-empty \
85 %__perl -MExtUtils
::MakeMaker
-e 'MY
->fixin
(@ARGV
)'
86 CFLAGS
="$RPM_OPT_FLAGS"
87 %{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}|
if \$ExtUtils
::MakeMaker
::VERSION
=~
/5\
.9[1-6]|
6\
.0[0-5]/ '`
94 [ "
%{buildroot}" != "/" ] && rm -rf %{buildroot}
96 %{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '`
98 cmd
=/usr
/share
/spec
-helper
/compress_files
99 [ -x $cmd
] || cmd
=/usr
/lib
/rpm
/brp
-compress
103 if [ -e
/etc
/SuSE
-release
-o
-e
/etc
/UnitedLinux
-release
]
105 %{__mkdir_p} %{buildroot}/var
/adm
/perl
-modules
106 %{__cat} `find %{buildroot} -name "perllocal.pod"` \
107 |
%{__sed} -e s+%{buildroot}++g \
108 > %{buildroot}/var/adm/perl-modules/%{name}
111 # remove special files
112 find
%{buildroot} -name "perllocal.pod" \
113 -o
-name ".packlist" \
117 # no empty directories
118 find
%{buildroot}%{_prefix} \
120 -exec rmdir {} \
; 2>/dev
/null
122 %{__perl} -MFile
::Find
-le '
123 find
({ wanted
=> \
&wanted
, no_chdir
=> 1}, "
%{buildroot}"
);
124 print "
%doc Changes INSTALL README examples"
;
125 for my $x
(sort @
dirs, @files
) {
126 push @ret
, $x unless indirs
($x
);
128 print join "\n"
, sort @ret
;
133 local $_
= $File
::Find
::name
;
134 my $f
= $_
; s|^\Q
%{buildroot}\E||
;
135 return unless length
;
136 return $files
[@files
] = $_
if -f $f
;
139 /\Q$d\E
/ && return for reverse sort @INC
;
140 $d
=~
/\Q$_\E
/ && return
141 for qw|
/etc
%_prefix/man
%_prefix/bin
%_prefix/share|
;
148 $x
=~
/^\Q$_\E\
// && $x ne $_
&& return 1 for @
dirs;
152 [ -z
%filelist ] && {
153 echo "ERROR
: empty
%files listing"
158 [ "
%{buildroot}" != "/" ] && rm -rf %{buildroot}
161 %defattr(-,root
,root
)
164 * Thu Nov
23 2006 root@dca02