RT notifier: parse templates without header correctly
[openxpki.git] / trunk / package / suse / external-dependencies / Class-Accessor.spec
blob6370cf38afa8d922a8906cfc272231e210b4ae8c
2 # - Class::Accessor -
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}
12 %define maketest 1
14 name: perl-Class-Accessor
15 summary: Class-Accessor - Automated accessor generation
16 version: 0.27
17 release: 1
18 vendor: Marty Pauley
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: Class-Accessor-0.27.tar.gz
28 %description
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:
34 sub name {
35 my $self = shift;
36 if(@_) {
37 $self->{name} = $_[0];
39 return $self->{name};
42 sub salary {
43 my $self = shift;
44 if(@_) {
45 $self->{salary} = $_[0];
47 return $self->{salary};
50 # etc...
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
56 tragedy.
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
61 customized!
63 The basic set up is very simple:
65 package My::Class;
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
70 defined.
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/
78 %prep
79 %setup -q -n %{pkgname}-%{version}
80 chmod -R u+w %{_builddir}/%{pkgname}-%{version}
82 %build
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]/ '`
88 %{__make}
89 %if %maketest
90 %{__make} test
91 %endif
93 %install
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
100 [ -x $cmd ] && $cmd
102 # SuSE Linux
103 if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
104 then
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" \
114 -o -name "*.bs" \
115 |xargs -i rm -f {}
117 # no empty directories
118 find %{buildroot}%{_prefix} \
119 -type d -depth \
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;
130 sub wanted {
131 return if /auto$/;
133 local $_ = $File::Find::name;
134 my $f = $_; s|^\Q%{buildroot}\E||;
135 return unless length;
136 return $files[@files] = $_ if -f $f;
138 $d = $_;
139 /\Q$d\E/ && return for reverse sort @INC;
140 $d =~ /\Q$_\E/ && return
141 for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
143 $dirs[@dirs] = $_;
146 sub indirs {
147 my $x = shift;
148 $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
150 ' > %filelist
152 [ -z %filelist ] && {
153 echo "ERROR: empty %files listing"
154 exit -1
157 %clean
158 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
160 %files -f %filelist
161 %defattr(-,root,root)
163 %changelog
164 * Thu Nov 23 2006 root@dca02
165 - Initial build.