pgpool.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. ##
  2. ## pgpool.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package versions
  25. %define V_pgpool 3.0.1
  26. %define V_subdir 3.0.1
  27. %define V_download 733
  28. # package information
  29. Name: pgpool
  30. Summary: PostgreSQL Connection Pooling
  31. URL: http://pgpool.projects.postgresql.org/
  32. Vendor: Tatsuo Ishii
  33. Packager: OpenPKG
  34. Distribution: OpenPKG
  35. Class: PLUS
  36. Group: Database
  37. License: GPL
  38. Version: %{V_pgpool}
  39. Release: 20060219
  40. # list of sources
  41. Source0: http://pgfoundry.org/frs/download.php/%{V_download}/pgpool-%{version}.tar.gz
  42. Source1: rc.pgpool
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20040130
  47. PreReq: OpenPKG, openpkg >= 20040130
  48. BuildPreReq: getopt
  49. PreReq: getopt
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. PGPool is a connection pool server for PostgreSQL. PGPool runs
  54. between PostgreSQL's clients (front ends) and servers (back ends).
  55. A PostgreSQL client can connect to PGPool as if it were a standard
  56. PostgreSQL server. PGPool caches the connection to the PostgreSQL
  57. server to reduce the overhead to establish the connection to it.
  58. Also, PGPool could use two PostgreSQL servers for fail over. If the
  59. first server goes down, PGPool will automatically switch to the
  60. secondary server. Moreover, PGPool supports scheduled switch over.
  61. %track
  62. prog pgpool = {
  63. version = %{V_pgpool}
  64. url = http://pgpool.projects.postgresql.org/
  65. regex = /\d+/pgpool-(__VER__)\.tar\.gz
  66. }
  67. prog pgpool:download = {
  68. version = %{V_download}
  69. url = http://pgpool.projects.postgresql.org/
  70. regex = /(__VER__)/pgpool-([\d\.]+)\.tar\.gz
  71. }
  72. %prep
  73. %setup -q -n pgpool-%{V_subdir}
  74. %build
  75. # configure program
  76. CC="%{l_cc}" \
  77. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  78. CPPFLAGS="%{l_cppflags}" \
  79. LDFLAGS="%{l_ldflags}" \
  80. LIBS="-lgetopt" \
  81. ./configure \
  82. --prefix=%{l_prefix} \
  83. --sysconfdir=%{l_prefix}/etc/pgpool \
  84. --with-pgsrc=/dummy
  85. # build program
  86. %{l_make} %{l_mflags -O}
  87. %install
  88. # create installation hierarchy
  89. rm -rf $RPM_BUILD_ROOT
  90. %{l_shtool} mkdir -f -p -m 755 \
  91. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  92. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  93. $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool \
  94. $RPM_BUILD_ROOT%{l_prefix}/var/pgpool \
  95. $RPM_BUILD_ROOT%{l_prefix}/man/cat8
  96. # install program
  97. %{l_shtool} install -c -s -m 755 \
  98. pgpool $RPM_BUILD_ROOT%{l_prefix}/sbin/
  99. # install documentation
  100. %{l_shtool} install -c -m 644 \
  101. README $RPM_BUILD_ROOT%{l_prefix}/man/cat8/pgpool.8
  102. # install default configuration
  103. %{l_shtool} install -c -m 644 \
  104. -e 's;\(logdir = .\).*\(.\)$;\1%{l_prefix}/var/pgpool\2;' \
  105. -e 's;\(socket_dir = .\).*\(.\)$;\1%{l_prefix}/var/pgpool\2;' \
  106. -e 's;\(backend_socket_dir = .\).*\(.\)$;\1%{l_prefix}/var/postgresql/run\2;' \
  107. pgpool.conf.sample $RPM_BUILD_ROOT%{l_prefix}/etc/pgpool/pgpool.conf
  108. # install run-command script
  109. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  110. %{SOURCE rc.pgpool} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  111. # determine installation files
  112. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  113. %{l_files_std} \
  114. '%config %{l_prefix}/etc/pgpool/*' \
  115. '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/pgpool'
  116. %files -f files
  117. %clean
  118. rm -rf $RPM_BUILD_ROOT