geoip.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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.4
  27. %define V_api_pl 1.21
  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: 20040606
  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. comment = "rse: 1.3.5: undefined reference to `gethostbyname_r'"
  62. version = %{version}
  63. url = http://maxmind.com/download/geoip/api/c/
  64. regex = GeoIP-(__VER__)\.tar\.gz
  65. }
  66. prog geoip:perl = {
  67. version = %{V_api_pl}
  68. url = http://www.cpan.org/modules/by-module/Geo/
  69. regex = Geo-IP-(__VER__)\.tar\.gz
  70. }
  71. %prep
  72. %setup -q -n GeoIP-%{V_api_c}
  73. %if "%{with_perl}" == "yes"
  74. %setup -q -T -D -a 1 -n GeoIP-%{V_api_c}
  75. %endif
  76. %{l_shtool} subst \
  77. -e 's;-Wall;;g' \
  78. -e 's;-ansi;;g' \
  79. Makefile.in */Makefile.in
  80. %build
  81. CC="%{l_cc}" \
  82. CFLAGS="%{l_cflags -O}" \
  83. CPPFLAGS="%{l_cppflags}" \
  84. LDFLAGS="%{l_ldflags}" \
  85. LIBS="-lz" \
  86. ./configure \
  87. --prefix=%{l_prefix} \
  88. --sysconfdir=%{l_prefix}/etc/geoip \
  89. --mandir=$RPM_BUILD_ROOT%{l_prefix}/man \
  90. --disable-shared
  91. %{l_make} %{l_mflags}
  92. %if "%{with_perl}" == "yes"
  93. %{l_prefix}/bin/perl-openpkg prepare
  94. %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} --verbose \
  95. --args LIBS="-L../libGeoIP/.libs" \
  96. --args INC="-I../libGeoIP" \
  97. configure build
  98. %endif
  99. %install
  100. rm -rf $RPM_BUILD_ROOT
  101. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix} \
  102. $RPM_BUILD_ROOT%{l_prefix}/man \
  103. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  104. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  105. %if "%{with_perl}" == "yes"
  106. %{l_prefix}/bin/perl-openpkg -d Geo-IP-%{V_api_pl} install
  107. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files install fixate cleanup
  108. %else
  109. >perl-openpkg-files
  110. %endif
  111. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  112. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/geoip/GeoIP.conf.default
  113. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  114. %files -f files
  115. %clean
  116. rm -rf $RPM_BUILD_ROOT