1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/geoip/geoip.spec Thu Apr 09 13:28:35 2009 +0200 1.3 @@ -0,0 +1,128 @@ 1.4 +## 1.5 +## geoip.spec -- OpenPKG RPM Package Specification 1.6 +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 +# package version 1.28 +%define V_api_c 1.4.6 1.29 +%define V_api_pl 1.37 1.30 + 1.31 +# package information 1.32 +Name: geoip 1.33 +Summary: Geographic IP Resolution 1.34 +URL: http://www.maxmind.com/app/geolitecity 1.35 +Vendor: MaxMind 1.36 +Packager: OpenPKG Foundation e.V. 1.37 +Distribution: OpenPKG Community 1.38 +Class: PLUS 1.39 +Group: Mapping 1.40 +License: GPL 1.41 +Version: %{V_api_c} 1.42 +Release: 20090307 1.43 + 1.44 +# package options 1.45 +%option with_perl no 1.46 + 1.47 +# list of sources 1.48 +Source0: http://geolite.maxmind.com/download/geoip/api/c/GeoIP-%{V_api_c}.tar.gz 1.49 +Source1: http://www.cpan.org/modules/by-module/Geo/Geo-IP-%{V_api_pl}.tar.gz 1.50 + 1.51 +# build information 1.52 +Prefix: %{l_prefix} 1.53 +BuildRoot: %{l_buildroot} 1.54 +BuildPreReq: OpenPKG, openpkg >= 20040130, gcc 1.55 +PreReq: OpenPKG, openpkg >= 20040130 1.56 +BuildPreReq: zlib 1.57 +PreReq: zlib 1.58 +AutoReq: no 1.59 +AutoReqProv: no 1.60 + 1.61 +%description 1.62 + Geo-IP enables you to easily lookup countries by IP addresses, even 1.63 + when Reverse DNS entries don't exist. The Geo-IP database contains 1.64 + IP Network Blocks as keys and countries as values, covering every 1.65 + public IP address. 1.66 + 1.67 +%track 1.68 + prog geoip = { 1.69 + version = %{version} 1.70 + url = http://geolite.maxmind.com/download/geoip/api/c/ 1.71 + regex = GeoIP-(__VER__)\.tar\.gz 1.72 + } 1.73 + prog geoip:perl = { 1.74 + version = %{V_api_pl} 1.75 + url = http://www.cpan.org/modules/by-module/Geo/ 1.76 + regex = Geo-IP-(__VER__)\.tar\.gz 1.77 + } 1.78 + 1.79 +%prep 1.80 + %setup -q -n GeoIP-%{V_api_c} 1.81 +%if "%{with_perl}" == "yes" 1.82 + %setup -q -T -D -a 1 -n GeoIP-%{V_api_c} 1.83 +%endif 1.84 + %{l_shtool} subst \ 1.85 + -e 's;-Wall;;g' \ 1.86 + -e 's;-ansi;;g' \ 1.87 + Makefile.in */Makefile.in 1.88 + 1.89 +%build 1.90 + echo "ac_cv_func_gethostbyname_r=no" >config.cache 1.91 + CC="%{l_cc}" \ 1.92 + CFLAGS="%{l_cflags -O}" \ 1.93 + CPPFLAGS="%{l_cppflags}" \ 1.94 + LDFLAGS="%{l_ldflags}" \ 1.95 + LIBS="-lz" \ 1.96 + ./configure \ 1.97 + --cache-file=./config.cache \ 1.98 + --prefix=%{l_prefix} \ 1.99 + --sysconfdir=%{l_prefix}/etc/geoip \ 1.100 + --mandir=$RPM_BUILD_ROOT%{l_prefix}/man \ 1.101 + --disable-shared 1.102 + %{l_make} %{l_mflags} 1.103 +%if "%{with_perl}" == "yes" 1.104 + %{l_prefix}/bin/perl-openpkg prepare 1.105 + %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} --verbose \ 1.106 + --args LIBS="-L../libGeoIP/.libs" \ 1.107 + --args INC="-I../libGeoIP" \ 1.108 + configure build 1.109 +%endif 1.110 + 1.111 +%install 1.112 + rm -rf $RPM_BUILD_ROOT 1.113 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix} \ 1.114 + $RPM_BUILD_ROOT%{l_prefix}/man \ 1.115 + $RPM_BUILD_ROOT%{l_prefix}/man/man1 1.116 + %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" 1.117 +%if "%{with_perl}" == "yes" 1.118 + %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} install 1.119 + %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup 1.120 +%else 1.121 + >perl-openpkg-files 1.122 +%endif 1.123 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true 1.124 + rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/geoip/GeoIP.conf.default 1.125 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files` 1.126 + 1.127 +%files -f files 1.128 + 1.129 +%clean 1.130 + rm -rf $RPM_BUILD_ROOT 1.131 +