cfengine.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ##
  2. ## cfengine.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: cfengine
  26. Summary: Automated System Administration Tool
  27. URL: http://www.cfengine.org/
  28. Vendor: Oslo University College, Norway
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: BASE
  32. Group: System
  33. License: GPL
  34. Version: 2.2.2
  35. Release: 20071001
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: ftp://ftp.iu.hio.no/pub/cfengine/cfengine-%{version}.tar.gz
  40. Source1: rc.cfengine
  41. Source2: fsl.cfengine
  42. Patch0: cfengine.patch
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20060823, bison, flex, gcc
  47. PreReq: OpenPKG, openpkg >= 20060823
  48. BuildPreReq: db, openssl
  49. PreReq: db, openssl
  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+(p\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}
  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. '%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