geoip.spec 4.3 KB

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