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