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.

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

mercurial