source: projects/specs/trunk/p/perl-Geo-IP/perl-Geo-IP-vl.spec @ 12120

Revision 12120, 4.3 KB checked in by tomop, 5 years ago (diff)

perl-5.26 and friends

Line 
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
14Name:      perl-Geo-IP
15Summary:   Look up location and network information by IP Address
16Version:   1.51
17Release:   1%{?_dist_release}
18
19License:   Artistic or GPL+
20Group:     Development/Libraries
21URL:       http://search.cpan.org/~maxmind/Geo-IP/
22Source:    http://search.cpan.org//CPAN/authors/id/B/BO/BORISZ/Geo-IP-%{version}.tar.gz
23
24Buildroot: %{_tmppath}/%{name}-%{version}-root
25BuildRequires: GeoIP-devel
26BuildRequires: perl
27BuildRequires: perl(ExtUtils::MakeMaker)
28Requires:      perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
29
30Distribution: Vine Linux
31Vendor:    Project Vine
32Packager:  tomop
33
34%description
35This module a simple file-based database. This database simply contains
36IP blocks as keys, and countries as values. The data contains all public
37IP addresses and should be more complete and accurate than reverse DNS
38lookups.
39
40This module can be used to automatically select the geographically closest
41mirror, or to analyze your web server logs to determine the countries of
42your visiters.
43
44%prep
45%setup -q -n Geo-IP-%{version}
46chmod -R u+w %{_builddir}/Geo-IP-%{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
56if [ -f /usr/share/GeoIP/GeoIP.dat ]; then
57%{__make} test
58fi
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
66cmd=/usr/share/spec-helper/compress_files
67[ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
68[ -x $cmd ] && $cmd
69
70# SuSE Linux
71if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
72then
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}
77fi
78
79# remove special files
80find %{buildroot} -name "perllocal.pod" \
81    -o -name ".packlist"                \
82    -o -name "*.bs"                     \
83    |xargs -i rm -f {}
84
85# no empty directories
86find %{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
128%check
129make test
130
131%files -f %filelist
132%defattr(-,root,root)
133
134%changelog
135* Sun May 19 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.51-1
136- new upstream release.
137- rebuilt with perl-5.26.
138
139* Sat Oct 11 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 1.45-1
140- new upstream release
141
142* Mon Jun 30 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.43-2
143- rebuilt with perl-5.16.3.
144
145* Thu Mar 27 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.43-1
146- Initial build.
Note: See TracBrowser for help on using the repository browser.