crossroads.spec 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ##
  2. ## crossroads.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 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 information
  25. Name: crossroads
  26. Summary: Load Balancing Daemon
  27. URL: http://crossroads.e-tunity.com/
  28. Vendor: Karel Kubat
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: EVAL
  32. Group: Network
  33. License: Open Source
  34. Version: 1.33
  35. Release: 20070402
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://crossroads.e-tunity.com/downloads/versions/crossroads-%{version}.tar.gz
  40. Source1: crossroads.conf
  41. Source2: fsl.crossroads
  42. Source3: rc.crossroads
  43. Patch0: crossroads.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20060823, bison, flex, make, perl, make
  48. PreReq: OpenPKG, openpkg >= 20060823
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl >= 1.2.0
  51. PreReq: fsl >= 1.2.0
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. Crossroads is a load balance and fail over utility for TCP based
  57. services. It is a daemon program running in user space, and
  58. features extensive configurability, polling of back ends using
  59. 'wakeup calls', detailed status reporting, 'hooks' for special
  60. actions when backend calls fail, and much more. Crossroads is
  61. service-independent: it is usable for HTTP(S), SSH, SMTP, DNS, etc.
  62. %track
  63. prog crossroads = {
  64. version = %{version}
  65. url = http://crossroads.e-tunity.com/downloads/versions/
  66. regex = crossroads-(__VER__)\.tar\.gz
  67. }
  68. %prep
  69. %setup -q
  70. %patch -p0
  71. %build
  72. %{l_shtool} subst \
  73. -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;' \
  74. tools/*
  75. cd src
  76. %{l_make} %{l_mflags} \
  77. DEFAULT_CONF="%{l_prefix}/etc/crossroads/crossroads.conf" \
  78. CC="%{l_cc} %{l_cflags -O}" \
  79. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  80. LIBS="%{l_fsl_ldflags} %{l_fsl_libs}"
  81. %install
  82. rm -rf $RPM_BUILD_ROOT
  83. %{l_shtool} mkdir -f -p -m 755 \
  84. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  85. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  86. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  87. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
  88. $RPM_BUILD_ROOT%{l_prefix}/etc/crossroads \
  89. $RPM_BUILD_ROOT%{l_prefix}/var/crossroads
  90. %{l_shtool} install -c -s -m 755 \
  91. src/crossroads $RPM_BUILD_ROOT%{l_prefix}/sbin/
  92. %{l_shtool} install -c -m 644 \
  93. doc/crossroads.man $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  94. l_shmkey=`%{l_uuid} -v3 ns:URL "file://%{l_prefix}" | sed -e 's;^.*\(........\)$;\1;'`
  95. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  96. -e "s;@l_shmkey@;$l_shmkey;" \
  97. %{SOURCE crossroads.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/crossroads/
  98. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  99. %{SOURCE rc.crossroads} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  100. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  101. %{SOURCE fsl.crossroads} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  102. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  103. %{l_files_std} \
  104. '%not %dir %{l_prefix}/etc/fsl' \
  105. '%config %{l_prefix}/etc/fsl/*' \
  106. '%config %{l_prefix}/etc/crossroads/*' \
  107. '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/crossroads'
  108. %files -f files
  109. %clean
  110. rm -rf $RPM_BUILD_ROOT