geoip/geoip.spec

Thu, 09 Apr 2009 13:28:35 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 09 Apr 2009 13:28:35 +0200
changeset 152
7b468483efb4
child 153
b9de35d46e4e
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

michael@152 1 ##
michael@152 2 ## geoip.spec -- OpenPKG RPM Package Specification
michael@152 3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@152 4 ##
michael@152 5 ## Permission to use, copy, modify, and distribute this software for
michael@152 6 ## any purpose with or without fee is hereby granted, provided that
michael@152 7 ## the above copyright notice and this permission notice appear in all
michael@152 8 ## copies.
michael@152 9 ##
michael@152 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@152 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@152 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@152 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@152 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@152 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@152 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@152 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@152 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@152 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@152 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@152 21 ## SUCH DAMAGE.
michael@152 22 ##
michael@152 23
michael@152 24 # package version
michael@152 25 %define V_api_c 1.4.6
michael@152 26 %define V_api_pl 1.37
michael@152 27
michael@152 28 # package information
michael@152 29 Name: geoip
michael@152 30 Summary: Geographic IP Resolution
michael@152 31 URL: http://www.maxmind.com/app/geolitecity
michael@152 32 Vendor: MaxMind
michael@152 33 Packager: OpenPKG Foundation e.V.
michael@152 34 Distribution: OpenPKG Community
michael@152 35 Class: PLUS
michael@152 36 Group: Mapping
michael@152 37 License: GPL
michael@152 38 Version: %{V_api_c}
michael@152 39 Release: 20090307
michael@152 40
michael@152 41 # package options
michael@152 42 %option with_perl no
michael@152 43
michael@152 44 # list of sources
michael@152 45 Source0: http://geolite.maxmind.com/download/geoip/api/c/GeoIP-%{V_api_c}.tar.gz
michael@152 46 Source1: http://www.cpan.org/modules/by-module/Geo/Geo-IP-%{V_api_pl}.tar.gz
michael@152 47
michael@152 48 # build information
michael@152 49 Prefix: %{l_prefix}
michael@152 50 BuildRoot: %{l_buildroot}
michael@152 51 BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
michael@152 52 PreReq: OpenPKG, openpkg >= 20040130
michael@152 53 BuildPreReq: zlib
michael@152 54 PreReq: zlib
michael@152 55 AutoReq: no
michael@152 56 AutoReqProv: no
michael@152 57
michael@152 58 %description
michael@152 59 Geo-IP enables you to easily lookup countries by IP addresses, even
michael@152 60 when Reverse DNS entries don't exist. The Geo-IP database contains
michael@152 61 IP Network Blocks as keys and countries as values, covering every
michael@152 62 public IP address.
michael@152 63
michael@152 64 %track
michael@152 65 prog geoip = {
michael@152 66 version = %{version}
michael@152 67 url = http://geolite.maxmind.com/download/geoip/api/c/
michael@152 68 regex = GeoIP-(__VER__)\.tar\.gz
michael@152 69 }
michael@152 70 prog geoip:perl = {
michael@152 71 version = %{V_api_pl}
michael@152 72 url = http://www.cpan.org/modules/by-module/Geo/
michael@152 73 regex = Geo-IP-(__VER__)\.tar\.gz
michael@152 74 }
michael@152 75
michael@152 76 %prep
michael@152 77 %setup -q -n GeoIP-%{V_api_c}
michael@152 78 %if "%{with_perl}" == "yes"
michael@152 79 %setup -q -T -D -a 1 -n GeoIP-%{V_api_c}
michael@152 80 %endif
michael@152 81 %{l_shtool} subst \
michael@152 82 -e 's;-Wall;;g' \
michael@152 83 -e 's;-ansi;;g' \
michael@152 84 Makefile.in */Makefile.in
michael@152 85
michael@152 86 %build
michael@152 87 echo "ac_cv_func_gethostbyname_r=no" >config.cache
michael@152 88 CC="%{l_cc}" \
michael@152 89 CFLAGS="%{l_cflags -O}" \
michael@152 90 CPPFLAGS="%{l_cppflags}" \
michael@152 91 LDFLAGS="%{l_ldflags}" \
michael@152 92 LIBS="-lz" \
michael@152 93 ./configure \
michael@152 94 --cache-file=./config.cache \
michael@152 95 --prefix=%{l_prefix} \
michael@152 96 --sysconfdir=%{l_prefix}/etc/geoip \
michael@152 97 --mandir=$RPM_BUILD_ROOT%{l_prefix}/man \
michael@152 98 --disable-shared
michael@152 99 %{l_make} %{l_mflags}
michael@152 100 %if "%{with_perl}" == "yes"
michael@152 101 %{l_prefix}/bin/perl-openpkg prepare
michael@152 102 %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} --verbose \
michael@152 103 --args LIBS="-L../libGeoIP/.libs" \
michael@152 104 --args INC="-I../libGeoIP" \
michael@152 105 configure build
michael@152 106 %endif
michael@152 107
michael@152 108 %install
michael@152 109 rm -rf $RPM_BUILD_ROOT
michael@152 110 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix} \
michael@152 111 $RPM_BUILD_ROOT%{l_prefix}/man \
michael@152 112 $RPM_BUILD_ROOT%{l_prefix}/man/man1
michael@152 113 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
michael@152 114 %if "%{with_perl}" == "yes"
michael@152 115 %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} install
michael@152 116 %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
michael@152 117 %else
michael@152 118 >perl-openpkg-files
michael@152 119 %endif
michael@152 120 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@152 121 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/geoip/GeoIP.conf.default
michael@152 122 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
michael@152 123
michael@152 124 %files -f files
michael@152 125
michael@152 126 %clean
michael@152 127 rm -rf $RPM_BUILD_ROOT
michael@152 128

mercurial