source: projects/specs/branches/6/p/perl-NetAddr-IP/perl-NetAddr-IP-vl.spec @ 3344

Revision 3344, 3.8 KB checked in by tomop, 13 years ago (diff)

perl-NetAddr?-IP-4.042-1

Line 
1#
2#   - NetAddr::IP -
3#   This spec file was automatically generated by cpan2rpm [ver: 2.028]
4#   The following arguments were used:
5#       NetAddr::IP
6#   For more information on cpan2rpm please visit: http://perl.arix.com/
7#
8
9%define pkgname NetAddr-IP
10%define filelist %{pkgname}-%{version}-filelist
11%define NVR %{pkgname}-%{version}-%{release}
12%define maketest 1
13
14Name:      perl-NetAddr-IP
15Summary:   NetAddr-IP - Manages IPv4 and IPv6 addresses and subnets
16Version:   4.042
17Release:   1%{?_dist_release}
18License:   Artistic
19Group:     Development/Libraries
20Url:       http://www.cpan.org
21BuildRoot: %{_tmppath}/%{name}-%{version}-%(id -u -n)
22Prefix:    %(echo %{_prefix})
23Source:    http://search.cpan.org//CPAN/authors/id/M/MI/MIKER/NetAddr-IP-4.042.tar.gz
24
25Vendor:       Project Vine
26Distribution: Vine Linux
27Packager:     tomop
28
29%description
30This module provides an object-oriented abstraction on top of IP
31addresses or IP subnets, that allows for easy manipulations.
32Version 4.xx of NetAdder::IP will will work older
33versions of Perl and does B<not> use Math::BigInt as in previous versions.
34
35The internal representation of all IP objects is in 128 bit IPv6 notation.
36IPv4 and IPv6 objects may be freely mixed.
37
38#
39# This package was generated automatically with the cpan2rpm
40# utility.  To get this software or for more information
41# please visit: http://perl.arix.com/
42#
43
44%prep
45%setup -q -n %{pkgname}-%{version}
46chmod -R u+w %{_builddir}/%{pkgname}-%{version}
47
48%build
49grep -rsl '^#!.*perl' . |
50grep -v '.bak$' |xargs --no-run-if-empty \
51%__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
52CFLAGS="$RPM_OPT_FLAGS"
53%{__perl} Makefile.PL INSTALLDIRS="vendor" `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '`
54%{__make}
55%if %maketest
56%{__make} test
57%endif
58
59%install
60[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
61
62%{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '`
63
64cmd=/usr/share/spec-helper/compress_files
65[ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
66[ -x $cmd ] && $cmd
67
68# SuSE Linux
69if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
70then
71    %{__mkdir_p} %{buildroot}/var/adm/perl-modules
72    %{__cat} `find %{buildroot} -name "perllocal.pod"`  \
73        | %{__sed} -e s+%{buildroot}++g                 \
74        > %{buildroot}/var/adm/perl-modules/%{name}
75fi
76
77# remove special files
78find %{buildroot} -name "perllocal.pod" \
79    -o -name ".packlist"                \
80    -o -name "*.bs"                     \
81    |xargs -i rm -f {}
82
83# no empty directories
84find %{buildroot}%{_prefix}             \
85    -type d -depth                      \
86    -exec rmdir {} \; 2>/dev/null
87
88%{__perl} -MFile::Find -le '
89    find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
90    print "%doc  TODO Lite Changes docs README";
91    for my $x (sort @dirs, @files) {
92        push @ret, $x unless indirs($x);
93        }
94    print join "\n", sort @ret;
95
96    sub wanted {
97        return if /auto$/;
98
99        local $_ = $File::Find::name;
100        my $f = $_; s|^\Q%{buildroot}\E||;
101        return unless length;
102        return $files[@files] = $_ if -f $f;
103
104        $d = $_;
105        /\Q$d\E/ && return for reverse sort @INC;
106        $d =~ /\Q$_\E/ && return
107            for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
108
109        $dirs[@dirs] = $_;
110        }
111
112    sub indirs {
113        my $x = shift;
114        $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
115        }
116    ' > %filelist
117
118[ -z %filelist ] && {
119    echo "ERROR: empty %files listing"
120    exit -1
121    }
122
123%clean
124[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
125
126%files -f %filelist
127%defattr(-,root,root)
128
129%changelog
130* Thu Apr 07 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.042-1
131- Initial build.
Note: See TracBrowser for help on using the repository browser.