1 |
# $Id: Net-OpenVPN-Manage.spec,v 1.2 2009/03/06 14:34:06 slords Exp $ |
2 |
# Authority: vip-ire |
3 |
# Name: Daniel Berteaud |
4 |
|
5 |
%define pkgname Net-OpenVPN-Manage |
6 |
%define filelist %{pkgname}-%{version}-filelist |
7 |
%define NVR %{pkgname}-%{version}-%{release} |
8 |
%define maketest 1 |
9 |
|
10 |
name: perl-Net-OpenVPN-Manage |
11 |
summary: Net-OpenVPN-Manage - Manage an OpenVPN process via it's management port |
12 |
version: 0.02 |
13 |
release: 1%{?dist} |
14 |
license: Artistic |
15 |
group: Applications/CPAN |
16 |
url: http://www.cpan.org |
17 |
buildroot: %{_tmppath}/%{name}-%{version}-%(id -u -n) |
18 |
buildarch: noarch |
19 |
prefix: %(echo %{_prefix}) |
20 |
source: http://search.cpan.org/dist/M/ME/MEYEAARD/Net-OpenVPN-Manage-0.02.tar.gz |
21 |
|
22 |
%description |
23 |
This module connects to the OpenVPN management interface, executes |
24 |
commands on the interface and returns the results or errors that result. |
25 |
|
26 |
# |
27 |
# This package was generated automatically with the cpan2rpm |
28 |
# utility. To get this software or for more information |
29 |
# please visit: http://perl.arix.com/ |
30 |
# |
31 |
|
32 |
%prep |
33 |
%setup -q -n %{pkgname}-%{version} |
34 |
chmod -R u+w %{_builddir}/%{pkgname}-%{version} |
35 |
|
36 |
%build |
37 |
grep -rsl '^#!.*perl' . | |
38 |
grep -v '.bak$' |xargs --no-run-if-empty \ |
39 |
%__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' |
40 |
CFLAGS="$RPM_OPT_FLAGS" |
41 |
%{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '` |
42 |
%{__make} |
43 |
%if %maketest |
44 |
%{__make} test |
45 |
%endif |
46 |
|
47 |
%install |
48 |
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} |
49 |
|
50 |
%{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '` |
51 |
|
52 |
[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress |
53 |
|
54 |
# SuSE Linux |
55 |
if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ] |
56 |
then |
57 |
%{__mkdir_p} %{buildroot}/var/adm/perl-modules |
58 |
%{__cat} `find %{buildroot} -name "perllocal.pod"` \ |
59 |
| %{__sed} -e s+%{buildroot}++g \ |
60 |
> %{buildroot}/var/adm/perl-modules/%{name} |
61 |
fi |
62 |
|
63 |
# remove special files |
64 |
find %{buildroot} -name "perllocal.pod" \ |
65 |
-o -name ".packlist" \ |
66 |
-o -name "*.bs" \ |
67 |
|xargs -i rm -f {} |
68 |
|
69 |
# no empty directories |
70 |
find %{buildroot}%{_prefix} \ |
71 |
-type d -depth \ |
72 |
-exec rmdir {} \; 2>/dev/null |
73 |
|
74 |
%{__perl} -MFile::Find -le ' |
75 |
find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}"); |
76 |
print ""; |
77 |
for my $x (sort @dirs, @files) { |
78 |
push @ret, $x unless indirs($x); |
79 |
} |
80 |
print join "\n", sort @ret; |
81 |
|
82 |
sub wanted { |
83 |
return if /auto$/; |
84 |
|
85 |
local $_ = $File::Find::name; |
86 |
my $f = $_; s|^\Q%{buildroot}\E||; |
87 |
return unless length; |
88 |
return $files[@files] = $_ if -f $f; |
89 |
|
90 |
$d = $_; |
91 |
/\Q$d\E/ && return for reverse sort @INC; |
92 |
$d =~ /\Q$_\E/ && return |
93 |
for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|; |
94 |
|
95 |
$dirs[@dirs] = $_; |
96 |
} |
97 |
|
98 |
sub indirs { |
99 |
my $x = shift; |
100 |
$x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs; |
101 |
} |
102 |
' > %filelist |
103 |
|
104 |
[ -z %filelist ] && { |
105 |
echo "ERROR: empty %files listing" |
106 |
exit -1 |
107 |
} |
108 |
|
109 |
%clean |
110 |
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} |
111 |
|
112 |
%files -f %filelist |
113 |
%defattr(-,root,root) |
114 |
|
115 |
%changelog |
116 |
* Fri Mar 6 2009 root@smedev |
117 |
- Initial build. |