cfengine.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. ##
  2. ## cfengine.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: cfengine
  25. Summary: Automated System Administration Tool
  26. URL: http://www.cfengine.org/
  27. Vendor: Oslo University College, Norway
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: BASE
  31. Group: System
  32. License: GPL
  33. Version: 3.2.4
  34. Release: 20120211
  35. # package options
  36. %option with_fsl yes
  37. # list of sources
  38. Source0: http://cfengine.com/source-code/download?file=cfengine-%{version}.tar.gz
  39. Source1: rc.cfengine
  40. Source2: fsl.cfengine
  41. # build information
  42. BuildPreReq: OpenPKG, openpkg >= 20100101, bison, flex, gcc
  43. PreReq: OpenPKG, openpkg >= 20100101
  44. BuildPreReq: db, openssl, pcre
  45. PreReq: db, openssl, pcre
  46. %if "%{with_fsl}" == "yes"
  47. BuildPreReq: fsl
  48. PreReq: fsl
  49. %endif
  50. %description
  51. Cfengine is a tool for setting up and maintaining BSD and System-5-like
  52. operating system optionally attached to a TCP/IP network. You can think
  53. of cfengine as a very high level language, much higher level than Perl
  54. or shell: a single statement can result in many hundreds of operations
  55. being performed on multiple hosts. Cfengine is good at performing a lot
  56. of common system administration tasks, and allows you to build on its
  57. strengths with your own scripts. You can also use it as a netwide
  58. front-end for `cron'.
  59. %track
  60. prog cfengine = {
  61. version = %{version}
  62. url = http://cfengine.com/source-code
  63. regex = \bcfengine-(\d+.\d+\.\d+(p\d+)?)\.tar\.gz
  64. }
  65. %prep
  66. %setup -q
  67. %build
  68. # configure package
  69. loclibs=""
  70. case "%{l_platform -t}" in
  71. *-sunos* )
  72. loclibs="-lrt"
  73. ;;
  74. esac
  75. CC="%{l_cc}" \
  76. CFLAGS="%{l_cflags -O}" \
  77. CPPFLAGS="%{l_cppflags postgresql .}" \
  78. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  79. LIBS="%{l_fsl_libs} $loclibs" \
  80. ./configure \
  81. --prefix=%{l_prefix} \
  82. --mandir=%{l_prefix}/man \
  83. --infodir=%{l_prefix}/info \
  84. --with-workdir=%{l_prefix}/var/cfengine \
  85. --with-berkeleydb=%{l_prefix} \
  86. --with-openssl=%{l_prefix} \
  87. --with-pcre=%{l_prefix} \
  88. --without-sql
  89. # build package
  90. %{l_make} %{l_mflags}
  91. %install
  92. # install package
  93. %{l_shtool} mkdir -f -p -m 755 \
  94. $RPM_BUILD_ROOT%{l_prefix}/var/cfengine
  95. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  96. # strip down installation
  97. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc >/dev/null 2>&1 || true
  98. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/lib* >/dev/null 2>&1 || true
  99. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir >/dev/null 2>&1 || true
  100. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  101. # install run-command script
  102. %{l_shtool} mkdir -f -p -m 755 \
  103. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  104. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  105. %{SOURCE rc.cfengine} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  106. # install OSSP fsl configuration
  107. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  108. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  109. %{SOURCE fsl.cfengine} \
  110. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  111. # determine installation files
  112. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  113. %{l_files_std} \
  114. '%config %{l_prefix}/etc/fsl/fsl.cfengine'
  115. %files -f files
  116. %clean
  117. %post
  118. # generate a public/private key pair for localhost
  119. if [ ! -f $RPM_INSTALL_PREFIX/var/cfengine/ppkeys/localhost.priv ]; then
  120. $RPM_INSTALL_PREFIX/sbin/cfkey
  121. fi