geoip/geoip.spec

changeset 787
f0da6998c61a
parent 603
72fb5257eb82
equal deleted inserted replaced
2:4863cbdce565 3:f4057d6c4331
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE. 21 ## SUCH DAMAGE.
22 ## 22 ##
23 23
24 # package version 24 # package version
25 %define V_api_c 1.4.8 25 %define V_api_c 1.6.0
26 %define V_api_pl 1.40 26 %define V_api_pl 1.40
27 27
28 # package information 28 # package information
29 Name: geoip 29 Name: geoip
30 Summary: Geographic IP Resolution 30 Summary: Geographic IP Resolution
43 43
44 # list of sources 44 # list of sources
45 Source0: http://geolite.maxmind.com/download/geoip/api/c/GeoIP-%{V_api_c}.tar.gz 45 Source0: http://geolite.maxmind.com/download/geoip/api/c/GeoIP-%{V_api_c}.tar.gz
46 Source1: http://www.cpan.org/modules/by-module/Geo/Geo-IP-%{V_api_pl}.tar.gz 46 Source1: http://www.cpan.org/modules/by-module/Geo/Geo-IP-%{V_api_pl}.tar.gz
47 Source2: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz 47 Source2: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
48 Source3: http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
49 Source4: http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz
48 50
49 # build information 51 # build information
50 Prefix: %{l_prefix} 52 Prefix: %{l_prefix}
51 BuildRoot: %{l_buildroot} 53 BuildRoot: %{l_buildroot}
52 BuildPreReq: OpenPKG, openpkg >= 20060823, gcc 54 BuildPreReq: OpenPKG, openpkg >= 20060823, gcc
85 regex = Geo-IP-(__VER__)\.tar\.gz 87 regex = Geo-IP-(__VER__)\.tar\.gz
86 } 88 }
87 89
88 %prep 90 %prep
89 %setup -q -n GeoIP-%{V_api_c} 91 %setup -q -n GeoIP-%{V_api_c}
90 ( cd data && %{l_gzip} -cd %{SOURCE2} >GeoLiteCity.dat) || exit $? 92 %{l_shtool} mkdir -f -p -m 755 data
93 ( cd data && \
94 %{l_gzip} -cd %{SOURCE2} >GeoLiteCityIPv4.dat
95 %{l_gzip} -cd %{SOURCE3} >GeoLiteCountryIPv4.dat
96 %{l_gzip} -cd %{SOURCE4} >GeoLiteCountryIPv6.dat
97 ) || exit $?
91 %if "%{with_perl}" == "yes" 98 %if "%{with_perl}" == "yes"
92 %setup -q -T -D -a 1 -n GeoIP-%{V_api_c} 99 %setup -q -T -D -a 1 -n GeoIP-%{V_api_c}
93 %endif 100 %endif
94 %{l_shtool} subst \ 101 %{l_shtool} subst \
95 -e 's;-Wall;;g' \ 102 -e 's;-Wall;;g' \
124 131
125 %install 132 %install
126 rm -rf $RPM_BUILD_ROOT 133 rm -rf $RPM_BUILD_ROOT
127 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix} \ 134 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix} \
128 $RPM_BUILD_ROOT%{l_prefix}/man \ 135 $RPM_BUILD_ROOT%{l_prefix}/man \
129 $RPM_BUILD_ROOT%{l_prefix}/man/man1 136 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
137 $RPM_BUILD_ROOT%{l_prefix}/share/GeoIP
130 %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT" 138 %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT"
131 %{l_shtool} install -c -m 644 \ 139 %{l_shtool} install -c -m 644 \
132 data/GeoLiteCity.dat $RPM_BUILD_ROOT%{l_prefix}/share/GeoIP 140 data/*.dat $RPM_BUILD_ROOT%{l_prefix}/share/GeoIP/
133 %if "%{with_perl}" == "yes" 141 %if "%{with_perl}" == "yes"
134 %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} install 142 %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} install
135 %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup 143 %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
136 %else 144 %else
137 >perl-openpkg-files 145 >perl-openpkg-files

mercurial