apache-geoip.spec 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ##
  2. ## apache-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. ##
  23. # package information
  24. Name: apache-geoip
  25. Summary: Apache Extension: GeoIP
  26. URL: http://www.maxmind.com/app/mod_geoip
  27. Vendor: MaxMind
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: Web
  32. License: Open Source
  33. Version: 1.2.1
  34. Release: 20080228
  35. # list of sources
  36. Source0: http://www.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_%{version}.tar.gz
  37. Source1: apache-geoip.conf
  38. # build information
  39. Prefix: %{l_prefix}
  40. BuildRoot: %{l_buildroot}
  41. BuildPreReq: OpenPKG, openpkg >= 20060823, apache, make
  42. PreReq: OpenPKG, openpkg >= 20060823, apache
  43. BuildPreReq: geoip >= 1.4.3
  44. PreReq: geoip >= 1.4.3
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. This is the GeoIP extension module for the Apache HTTP webserver.
  49. %track
  50. prog apache-geoip = {
  51. version = %{version}
  52. url = http://www.maxmind.com/download/geoip/api/mod_geoip2/
  53. regex = mod_geoip2_(\d+\.\d+\.\d+)\.tar\.gz
  54. }
  55. %prep
  56. %setup -q -n mod_geoip2_%{version}
  57. %build
  58. # build module
  59. %{l_prefix}/sbin/apxs -c %{l_cppflags} mod_geoip.c %{l_ldflags} -lGeoIP
  60. %install
  61. # install module
  62. rm -rf $RPM_BUILD_ROOT
  63. %{l_shtool} mkdir -f -p -m 755 \
  64. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d \
  65. $RPM_BUILD_ROOT%{l_prefix}/libexec/apache
  66. %{l_shtool} install -c -m 755 \
  67. .libs/mod_geoip.so \
  68. $RPM_BUILD_ROOT%{l_prefix}/libexec/apache/mod_geoip.so
  69. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  70. %{SOURCE apache-geoip.conf} \
  71. $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
  72. # create directories for database
  73. %{l_shtool} mkdir -f -p -m 755 \
  74. $RPM_BUILD_ROOT%{l_prefix}/var/apache-geoip
  75. # determine installation files
  76. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  77. %{l_files_std} \
  78. '%config %{l_prefix}/etc/apache/apache.d/apache-geoip.conf' \
  79. '%config %{l_prefix}/etc/apache-geoip/*' \
  80. '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache-geoip'
  81. %files -f files
  82. %clean
  83. rm -rf $RPM_BUILD_ROOT
  84. %post
  85. # after upgrade, restart service
  86. [ $1 -eq 2 ] || exit 0
  87. eval `%{l_rc} apache status 2>/dev/null`
  88. [ ".$apache_active" = .yes ] && %{l_rc} apache restart
  89. exit 0