cfengine.spec 4.9 KB

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