cfengine.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. ##
  2. ## cfengine.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2005 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. # FIXME: rse: reasonable default configuration missing
  26. # package information
  27. Name: cfengine
  28. Summary: Automated System Administration Tool
  29. URL: http://www.cfengine.org/
  30. Vendor: Oslo University College, Norway
  31. Packager: The OpenPKG Project
  32. Distribution: OpenPKG
  33. Class: PLUS
  34. Group: System
  35. License: GPL
  36. Version: 2.1.13
  37. Release: 20050221
  38. # package options
  39. %option with_fsl yes
  40. # list of sources
  41. Source0: ftp://ftp.iu.hio.no/pub/cfengine/cfengine-%{version}.tar.gz
  42. Source1: rc.cfengine
  43. Source2: fsl.cfengine
  44. Patch0: cfengine.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130, db, openssl, openssl::with_threads = yes, bison, flex, gcc
  49. PreReq: OpenPKG, openpkg >= 20040130, db, openssl, openssl::with_threads = yes
  50. %if "%{with_fsl}" == "yes"
  51. BuildPreReq: fsl >= 1.2.0
  52. PreReq: fsl >= 1.2.0
  53. %endif
  54. AutoReq: no
  55. AutoReqProv: no
  56. %description
  57. Cfengine is a tool for setting up and maintaining BSD and System-5-like
  58. operating system optionally attached to a TCP/IP network. You can think
  59. of cfengine as a very high level language, much higher level than Perl
  60. or shell: a single statement can result in many hundreds of operations
  61. being performed on multiple hosts. Cfengine is good at performing a lot
  62. of common system administration tasks, and allows you to build on its
  63. strengths with your own scripts. You can also use it as a netwide
  64. front-end for `cron'.
  65. %track
  66. prog cfengine = {
  67. version = %{version}
  68. url = ftp://ftp.iu.hio.no/pub/cfengine/
  69. regex = \bcfengine-(\d+.\d+\.\d+)\.tar\.gz
  70. }
  71. %prep
  72. %setup -q
  73. %patch -p0
  74. %build
  75. # configure package
  76. loclibs=""
  77. case "%{l_platform -t}" in
  78. *-sunos* )
  79. loclibs="-lrt"
  80. ;;
  81. esac
  82. CC="%{l_cc}" \
  83. CFLAGS="%{l_cflags -O}" \
  84. CPPLAGS="%{l_cppflags}" \
  85. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  86. LIBS="%{l_fsl_libs} $loclibs" \
  87. ./configure \
  88. --prefix=%{l_prefix} \
  89. --with-berkeleydb=%{l_prefix} \
  90. --with-openssl=%{l_prefix} \
  91. --with-workdir=%{l_prefix}/var/cfengine
  92. # build package
  93. %{l_make} %{l_mflags -O}
  94. %install
  95. # install package
  96. rm -rf $RPM_BUILD_ROOT
  97. %{l_shtool} mkdir -f -p -m 755 \
  98. $RPM_BUILD_ROOT%{l_prefix}/var/cfengine \
  99. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  100. $RPM_BUILD_ROOT%{l_prefix}/info
  101. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  102. %{l_shtool} install -c -m 644 \
  103. doc/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  104. %{l_shtool} install -c -m 644 \
  105. doc/*.info* $RPM_BUILD_ROOT%{l_prefix}/info/
  106. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  107. # install run-command script
  108. %{l_shtool} mkdir -f -p -m 755 \
  109. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  110. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  111. %{SOURCE rc.cfengine} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  112. # install OSSP fsl configuration
  113. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  114. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  115. %{SOURCE fsl.cfengine} \
  116. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  117. # determine installation files
  118. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  119. %{l_files_std} \
  120. '%not %dir %{l_prefix}/etc/fsl' \
  121. '%config %{l_prefix}/etc/fsl/fsl.cfengine'
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT
  125. %post
  126. # generate a public/private key pair for localhost
  127. if [ ! -f $RPM_INSTALL_PREFIX/var/cfengine/ppkeys/localhost.priv ]; then
  128. $RPM_INSTALL_PREFIX/sbin/cfkey
  129. fi