perl-Geo-IP-vl.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #
  2. # - Geo::IP -
  3. # This spec file was automatically generated by cpan2rpm [ver: 2.028]
  4. # The following arguments were used:
  5. # --author 'Project Vine' --distribution 'Vine Linux' --packager tomop --spec-only --name perl-Geo-IP --version 1.43 Geo::IP
  6. # For more information on cpan2rpm please visit: http://perl.arix.com/
  7. #
  8. %define pkgname perl-Geo-IP
  9. %define filelist %{pkgname}-%{version}-filelist
  10. %define NVR %{pkgname}-%{version}-%{release}
  11. %define maketest 1
  12. Name: perl-Geo-IP
  13. Summary: Look up location and network information by IP Address
  14. Version: 1.51
  15. Release: 1%{?_dist_release}
  16. License: Artistic or GPL+
  17. Group: Development/Libraries
  18. URL: http://search.cpan.org/~maxmind/Geo-IP/
  19. Source: http://search.cpan.org//CPAN/authors/id/B/BO/BORISZ/Geo-IP-%{version}.tar.gz
  20. Buildroot: %{_tmppath}/%{name}-%{version}-root
  21. BuildRequires: GeoIP-devel
  22. BuildRequires: perl
  23. BuildRequires: perl(ExtUtils::MakeMaker)
  24. Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
  25. Distribution: Vine Linux
  26. Vendor: Project Vine
  27. Packager: tomop
  28. %description
  29. This module a simple file-based database. This database simply contains
  30. IP blocks as keys, and countries as values. The data contains all public
  31. IP addresses and should be more complete and accurate than reverse DNS
  32. lookups.
  33. This module can be used to automatically select the geographically closest
  34. mirror, or to analyze your web server logs to determine the countries of
  35. your visiters.
  36. %prep
  37. %setup -q -n Geo-IP-%{version}
  38. chmod -R u+w %{_builddir}/Geo-IP-%{version}
  39. %build
  40. grep -rsl '^#!.*perl' . |
  41. grep -v '.bak$' |xargs --no-run-if-empty \
  42. %__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
  43. CFLAGS="$RPM_OPT_FLAGS"
  44. %{__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]/ '`
  45. %{__make}
  46. %if %maketest
  47. if [ -f /usr/share/GeoIP/GeoIP.dat ]; then
  48. %{__make} test
  49. fi
  50. %endif
  51. %install
  52. [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
  53. %{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '`
  54. cmd=/usr/share/spec-helper/compress_files
  55. [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
  56. [ -x $cmd ] && $cmd
  57. # SuSE Linux
  58. if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
  59. then
  60. %{__mkdir_p} %{buildroot}/var/adm/perl-modules
  61. %{__cat} `find %{buildroot} -name "perllocal.pod"` \
  62. | %{__sed} -e s+%{buildroot}++g \
  63. > %{buildroot}/var/adm/perl-modules/%{name}
  64. fi
  65. # remove special files
  66. find %{buildroot} -name "perllocal.pod" \
  67. -o -name ".packlist" \
  68. -o -name "*.bs" \
  69. |xargs -i rm -f {}
  70. # no empty directories
  71. find %{buildroot}%{_prefix} \
  72. -type d -depth \
  73. -exec rmdir {} \; 2>/dev/null
  74. %{__perl} -MFile::Find -le '
  75. find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
  76. print "%doc example Changes INSTALL README";
  77. for my $x (sort @dirs, @files) {
  78. push @ret, $x unless indirs($x);
  79. }
  80. print join "\n", sort @ret;
  81. sub wanted {
  82. return if /auto$/;
  83. local $_ = $File::Find::name;
  84. my $f = $_; s|^\Q%{buildroot}\E||;
  85. return unless length;
  86. return $files[@files] = $_ if -f $f;
  87. $d = $_;
  88. /\Q$d\E/ && return for reverse sort @INC;
  89. $d =~ /\Q$_\E/ && return
  90. for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
  91. $dirs[@dirs] = $_;
  92. }
  93. sub indirs {
  94. my $x = shift;
  95. $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
  96. }
  97. ' > %filelist
  98. [ -z %filelist ] && {
  99. echo "ERROR: empty %files listing"
  100. exit -1
  101. }
  102. %clean
  103. [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
  104. %check
  105. make test
  106. %files -f %filelist
  107. %defattr(-,root,root)
  108. %changelog
  109. * Sun May 19 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.51-1
  110. - new upstream release.
  111. - rebuilt with perl-5.26.
  112. * Sat Oct 11 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.45-1
  113. - new upstream release
  114. * Mon Jun 30 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.43-2
  115. - rebuilt with perl-5.16.3.
  116. * Thu Mar 27 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.43-1
  117. - Initial build.