michael@152: ## michael@152: ## geoip.spec -- OpenPKG RPM Package Specification michael@152: ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. michael@152: ## michael@152: ## Permission to use, copy, modify, and distribute this software for michael@152: ## any purpose with or without fee is hereby granted, provided that michael@152: ## the above copyright notice and this permission notice appear in all michael@152: ## copies. michael@152: ## michael@152: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@152: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@152: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@152: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@152: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@152: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@152: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@152: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@152: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@152: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@152: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@152: ## SUCH DAMAGE. michael@152: ## michael@152: michael@152: # package version michael@152: %define V_api_c 1.4.6 michael@152: %define V_api_pl 1.37 michael@152: michael@152: # package information michael@152: Name: geoip michael@152: Summary: Geographic IP Resolution michael@152: URL: http://www.maxmind.com/app/geolitecity michael@152: Vendor: MaxMind michael@152: Packager: OpenPKG Foundation e.V. michael@152: Distribution: OpenPKG Community michael@152: Class: PLUS michael@152: Group: Mapping michael@152: License: GPL michael@152: Version: %{V_api_c} michael@152: Release: 20090307 michael@152: michael@152: # package options michael@152: %option with_perl no michael@152: michael@152: # list of sources michael@152: Source0: http://geolite.maxmind.com/download/geoip/api/c/GeoIP-%{V_api_c}.tar.gz michael@152: Source1: http://www.cpan.org/modules/by-module/Geo/Geo-IP-%{V_api_pl}.tar.gz michael@152: michael@152: # build information michael@152: Prefix: %{l_prefix} michael@152: BuildRoot: %{l_buildroot} michael@152: BuildPreReq: OpenPKG, openpkg >= 20040130, gcc michael@152: PreReq: OpenPKG, openpkg >= 20040130 michael@152: BuildPreReq: zlib michael@152: PreReq: zlib michael@152: AutoReq: no michael@152: AutoReqProv: no michael@152: michael@152: %description michael@152: Geo-IP enables you to easily lookup countries by IP addresses, even michael@152: when Reverse DNS entries don't exist. The Geo-IP database contains michael@152: IP Network Blocks as keys and countries as values, covering every michael@152: public IP address. michael@152: michael@152: %track michael@152: prog geoip = { michael@152: version = %{version} michael@152: url = http://geolite.maxmind.com/download/geoip/api/c/ michael@152: regex = GeoIP-(__VER__)\.tar\.gz michael@152: } michael@152: prog geoip:perl = { michael@152: version = %{V_api_pl} michael@152: url = http://www.cpan.org/modules/by-module/Geo/ michael@152: regex = Geo-IP-(__VER__)\.tar\.gz michael@152: } michael@152: michael@152: %prep michael@152: %setup -q -n GeoIP-%{V_api_c} michael@152: %if "%{with_perl}" == "yes" michael@152: %setup -q -T -D -a 1 -n GeoIP-%{V_api_c} michael@152: %endif michael@152: %{l_shtool} subst \ michael@152: -e 's;-Wall;;g' \ michael@152: -e 's;-ansi;;g' \ michael@152: Makefile.in */Makefile.in michael@152: michael@152: %build michael@152: echo "ac_cv_func_gethostbyname_r=no" >config.cache michael@152: CC="%{l_cc}" \ michael@152: CFLAGS="%{l_cflags -O}" \ michael@152: CPPFLAGS="%{l_cppflags}" \ michael@152: LDFLAGS="%{l_ldflags}" \ michael@152: LIBS="-lz" \ michael@152: ./configure \ michael@152: --cache-file=./config.cache \ michael@152: --prefix=%{l_prefix} \ michael@152: --sysconfdir=%{l_prefix}/etc/geoip \ michael@152: --mandir=$RPM_BUILD_ROOT%{l_prefix}/man \ michael@152: --disable-shared michael@152: %{l_make} %{l_mflags} michael@152: %if "%{with_perl}" == "yes" michael@152: %{l_prefix}/bin/perl-openpkg prepare michael@152: %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} --verbose \ michael@152: --args LIBS="-L../libGeoIP/.libs" \ michael@152: --args INC="-I../libGeoIP" \ michael@152: configure build michael@152: %endif michael@152: michael@152: %install michael@152: rm -rf $RPM_BUILD_ROOT michael@152: %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix} \ michael@152: $RPM_BUILD_ROOT%{l_prefix}/man \ michael@152: $RPM_BUILD_ROOT%{l_prefix}/man/man1 michael@152: %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" michael@152: %if "%{with_perl}" == "yes" michael@152: %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} install michael@152: %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup michael@152: %else michael@152: >perl-openpkg-files michael@152: %endif michael@152: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@152: rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/geoip/GeoIP.conf.default michael@152: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files` michael@152: michael@152: %files -f files michael@152: michael@152: %clean michael@152: rm -rf $RPM_BUILD_ROOT michael@152: