RT notifier: parse templates without header correctly
[openxpki.git] / trunk / package / suse / perl-openxpki-client-scep / perl-openxpki-client-scep.spec.in
blob3842aac6516a188717d987c5387eddd0d15ac378
1 ## Written 2006 by Martin Bartosch for the OpenXPKI project
2 ## Copyright (C) 2005-2006 by The OpenXPKI Project
5 # - OpenXPKI HTML Mason client package -
8 %define pkgname OpenXPKI-Client-SCEP
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-scep
15 summary: OpenXPKI SCEP Client - client 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-SCEP-%{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 install -d -D -m 755 %{buildroot}/srv/www/openxpki/cgi-bin/scep
57 install -D -m 755 bin/scep %{buildroot}/srv/www/openxpki/cgi-bin/scep/scep
58 install -D -m 644 eg/scep.conf %{buildroot}/etc/openxpki/scep.conf
59 tar cf - htdocs | tar -C %{buildroot}/srv/www/openxpki/ -x -f -
61 cmd=/usr/share/spec-helper/compress_files
62 [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
63 [ -x $cmd ] && $cmd
65 # SuSE Linux
66 if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
67 then
68 %{__mkdir_p} %{buildroot}/var/adm/perl-modules
69 %{__cat} `find %{buildroot} -name "perllocal.pod"` \
70 | %{__sed} -e s+%{buildroot}++g \
71 > %{buildroot}/var/adm/perl-modules/%{name}
74 # remove special files
75 find %{buildroot} -name "perllocal.pod" \
76 -o -name ".packlist" \
77 -o -name "*.bs" \
78 |xargs -i rm -f {}
80 # no empty directories
81 find %{buildroot}%{_prefix} \
82 -type d -depth \
83 -exec rmdir {} \; 2>/dev/null
85 %{__perl} -MFile::Find -le '
86 find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
87 print "%doc README";
88 for my $x (sort @dirs, @files) {
89 push @ret, $x unless indirs($x);
91 print join "\n", sort @ret;
93 sub wanted {
94 return if /auto$/;
96 local $_ = $File::Find::name;
97 my $f = $_; s|^\Q%{buildroot}\E||;
98 return unless length;
99 return $files[@files] = $_ if -f $f;
101 $d = $_;
102 /\Q$d\E/ && return for reverse sort @INC;
103 $d =~ /\Q$_\E/ && return
104 for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
106 $dirs[@dirs] = $_;
109 sub indirs {
110 my $x = shift;
111 $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
113 ' > %filelist
115 [ -z %filelist ] && {
116 echo "ERROR: empty %files listing"
117 exit -1
120 %clean
121 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
123 %files -f %filelist
124 %defattr(-,root,root)
126 %attr(0755,root,openxpki) /srv/www/openxpki/cgi-bin/scep/scep
127 %config(noreplace) %attr(0644,root,openxpki) /etc/openxpki/scep.conf
129 %changelog
130 * Mon Nov 27 2006 m.bartosch@cynops.de
131 - Initial build.