RT notifier: parse templates without header correctly
[openxpki.git] / trunk / package / suse / perl-openxpki-client / perl-openxpki-client.spec.in
blob69946c23e0449cf0fc0c29b4e668acd17d46628a
1 ## Written 2006 by Martin Bartosch for the OpenXPKI project
2 ## Copyright (C) 2005-2006 by The OpenXPKI Project
5 # - OpenXPKI client package -
8 %define pkgname OpenXPKI-Client
9 %define filelist %{pkgname}-%{version}-filelist
10 %define NVR %{pkgname}-%{version}-%{release}
11 %define maketest 0
12 %define __perl _PERL_
14 name: perl-openxpki-client
15 summary: OpenXPKI Client - base module for Perl clients
16 version: _VERSION_
17 release: 1
18 vendor: OpenXPKI Project
19 packager: Martin Bartosch <m.bartosch@cynops.de>
20 license: Apache
21 group: Applications/CPAN
22 url: http://www.openxpki.org
23 buildroot: %{_tmppath}/%{name}-%{version}-%(id -u -n)
24 prefix: %(echo %{_prefix})
25 source: OpenXPKI-Client-%{version}.tar.gz
27 %description
28 None.
31 # This package was generated automatically with the cpan2rpm
32 # utility. To get this software or for more information
33 # please visit: http://perl.arix.com/
36 %prep
37 %setup -q -n %{pkgname}-%{version}
38 chmod -R u+w %{_builddir}/%{pkgname}-%{version}
40 %build
41 grep -rsl '^#!.*perl' . |
42 grep -v '.bak$' |xargs --no-run-if-empty \
43 %__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
44 CFLAGS="$RPM_OPT_FLAGS"
45 %{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '` _MAKEPL_ARGS_
46 %{__make}
47 %if %maketest
48 %{__make} test
49 %endif
51 %install
52 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
54 %{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '`
56 cmd=/usr/share/spec-helper/compress_files
57 [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
58 [ -x $cmd ] && $cmd
60 # SuSE Linux
61 if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
62 then
63 %{__mkdir_p} %{buildroot}/var/adm/perl-modules
64 %{__cat} `find %{buildroot} -name "perllocal.pod"` \
65 | %{__sed} -e s+%{buildroot}++g \
66 > %{buildroot}/var/adm/perl-modules/%{name}
69 # remove special files
70 find %{buildroot} -name "perllocal.pod" \
71 -o -name ".packlist" \
72 -o -name "*.bs" \
73 |xargs -i rm -f {}
75 # no empty directories
76 find %{buildroot}%{_prefix} \
77 -type d -depth \
78 -exec rmdir {} \; 2>/dev/null
80 %{__perl} -MFile::Find -le '
81 find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
82 print "%doc LICENSE README";
83 for my $x (sort @dirs, @files) {
84 push @ret, $x unless indirs($x);
86 print join "\n", sort @ret;
88 sub wanted {
89 return if /auto$/;
91 local $_ = $File::Find::name;
92 my $f = $_; s|^\Q%{buildroot}\E||;
93 return unless length;
94 return $files[@files] = $_ if -f $f;
96 $d = $_;
97 /\Q$d\E/ && return for reverse sort @INC;
98 $d =~ /\Q$_\E/ && return
99 for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
101 $dirs[@dirs] = $_;
104 sub indirs {
105 my $x = shift;
106 $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
108 ' > %filelist
110 [ -z %filelist ] && {
111 echo "ERROR: empty %files listing"
112 exit -1
115 %clean
116 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
118 %files -f %filelist
119 %defattr(-,root,root)
121 %changelog
122 * Mon Nov 27 2006 m.bartosch@cynops.de
123 - Initial build.