monit.spec 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ##
  2. ## monit.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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 information
  26. Name: monit
  27. Summary: Service Monitoring Daemon
  28. URL: http://www.tildeslash.com/monit/
  29. Vendor: Jan-Henrik Haukeland et al.
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: System
  33. License: GPL
  34. Version: 3.2
  35. Release: 20030508
  36. # package options
  37. %option with_ssl no
  38. # list of sources
  39. Source0: http://www.tildeslash.com/monit/dist/monit-%{version}.tar.gz
  40. Source1: rc.monit
  41. Source2: fsl.monit
  42. Patch0: monit.patch
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20030103, make, gcc, bison, flex, fsl
  47. PreReq: OpenPKG, openpkg >= 20030103
  48. %if "%{with_ssl}" == "yes"
  49. BuildPreReq: openssl
  50. %endif
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. Monit is a utility for monitoring and managing daemons or similar
  55. programs running on a Unix system. It will start specified programs
  56. if they are not running and restart programs not responding.
  57. %prep
  58. %setup -q
  59. %patch -p0
  60. %{l_shtool} subst \
  61. -e 's;@l_prefix@;%{l_prefix};g' \
  62. files.c monit.1
  63. %{l_shtool} subst \
  64. -e 's;piddir=;dummy=;' \
  65. configure
  66. %build
  67. CC="%{l_cc}" \
  68. CFLAGS="%{l_cflags -O}" \
  69. CPPFLAGS="%{l_cppflags}" \
  70. LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/fsl-config --all --ldflags`" \
  71. LIBS="`%{l_prefix}/bin/fsl-config --all --libs`" \
  72. piddir="%{l_prefix}/var/monit" \
  73. ./configure \
  74. --prefix=%{l_prefix} \
  75. %if "%{with_ssl}" == "yes"
  76. --with-ssl-dir=%{l_prefix}
  77. %else
  78. --without-ssl
  79. %endif
  80. %{l_make} %{l_mflags -O}
  81. %install
  82. rm -rf $RPM_BUILD_ROOT
  83. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  84. %{l_shtool} mkdir -f -p -m 755 \
  85. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  86. %{l_shtool} install -c -m 755 \
  87. -e 's;@l_prefix@;%{l_prefix};g' \
  88. -e 's;@l_susr@;%{l_susr};g' \
  89. %{SOURCE rc.monit} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  90. %{l_shtool} mkdir -f -p -m 755 \
  91. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  92. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  93. %{SOURCE fsl.monit} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  94. %{l_shtool} mkdir -f -p -m 700 \
  95. $RPM_BUILD_ROOT%{l_prefix}/etc/monit
  96. %{l_shtool} install -c -m 600 \
  97. -e 's;@l_prefix@;%{l_prefix};g' \
  98. %{SOURCE monitrc} $RPM_BUILD_ROOT%{l_prefix}/etc/monit/
  99. %{l_shtool} mkdir -f -p -m 700 \
  100. $RPM_BUILD_ROOT%{l_prefix}/var/monit
  101. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  102. '%config %attr(0600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/monit/*' \
  103. '%dir %attr(0700,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/monit' \
  104. '%dir %attr(0700,%{l_susr},%{l_mgrp}) %{l_prefix}/var/monit' \
  105. '%config %{l_prefix}/etc/fsl/fsl.monit' \
  106. '%not %dir %{l_prefix}/etc/fsl'
  107. %files -f files
  108. %clean
  109. rm -rf $RPM_BUILD_ROOT