perl-NetAddr-IP-vl.spec 3.8 KB

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