1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/cfengine/cfengine.spec Tue Aug 28 18:33:50 2012 +0200 1.3 @@ -0,0 +1,139 @@ 1.4 +## 1.5 +## cfengine.spec -- OpenPKG RPM Package Specification 1.6 +## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> 1.7 +## 1.8 +## Permission to use, copy, modify, and distribute this software for 1.9 +## any purpose with or without fee is hereby granted, provided that 1.10 +## the above copyright notice and this permission notice appear in all 1.11 +## copies. 1.12 +## 1.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.24 +## SUCH DAMAGE. 1.25 +## 1.26 + 1.27 +# package information 1.28 +Name: cfengine 1.29 +Summary: Automated System Administration Tool 1.30 +URL: http://www.cfengine.org/ 1.31 +Vendor: Oslo University College, Norway 1.32 +Packager: OpenPKG Foundation e.V. 1.33 +Distribution: OpenPKG Community 1.34 +Class: BASE 1.35 +Group: System 1.36 +License: GPL 1.37 +Version: 3.2.4 1.38 +Release: 20120211 1.39 + 1.40 +# package options 1.41 +%option with_fsl yes 1.42 + 1.43 +# list of sources 1.44 +Source0: http://cfengine.com/source-code/download?file=cfengine-%{version}.tar.gz 1.45 +Source1: rc.cfengine 1.46 +Source2: fsl.cfengine 1.47 + 1.48 +# build information 1.49 +BuildPreReq: OpenPKG, openpkg >= 20100101, bison, flex, gcc 1.50 +PreReq: OpenPKG, openpkg >= 20100101 1.51 +BuildPreReq: db, openssl, pcre 1.52 +PreReq: db, openssl, pcre 1.53 +%if "%{with_fsl}" == "yes" 1.54 +BuildPreReq: fsl 1.55 +PreReq: fsl 1.56 +%endif 1.57 + 1.58 +%description 1.59 + Cfengine is a tool for setting up and maintaining BSD and System-5-like 1.60 + operating system optionally attached to a TCP/IP network. You can think 1.61 + of cfengine as a very high level language, much higher level than Perl 1.62 + or shell: a single statement can result in many hundreds of operations 1.63 + being performed on multiple hosts. Cfengine is good at performing a lot 1.64 + of common system administration tasks, and allows you to build on its 1.65 + strengths with your own scripts. You can also use it as a netwide 1.66 + front-end for `cron'. 1.67 + 1.68 +%track 1.69 + prog cfengine = { 1.70 + version = %{version} 1.71 + url = http://cfengine.com/source-code 1.72 + regex = \bcfengine-(\d+.\d+\.\d+(p\d+)?)\.tar\.gz 1.73 + } 1.74 + 1.75 +%prep 1.76 + %setup -q 1.77 + 1.78 +%build 1.79 + # configure package 1.80 + loclibs="" 1.81 + case "%{l_platform -t}" in 1.82 + *-sunos* ) 1.83 + loclibs="-lrt" 1.84 + ;; 1.85 + esac 1.86 + CC="%{l_cc}" \ 1.87 + CFLAGS="%{l_cflags -O}" \ 1.88 + CPPFLAGS="%{l_cppflags postgresql .}" \ 1.89 + LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ 1.90 + LIBS="%{l_fsl_libs} $loclibs" \ 1.91 + ./configure \ 1.92 + --prefix=%{l_prefix} \ 1.93 + --mandir=%{l_prefix}/man \ 1.94 + --infodir=%{l_prefix}/info \ 1.95 + --with-workdir=%{l_prefix}/var/cfengine \ 1.96 + --with-berkeleydb=%{l_prefix} \ 1.97 + --with-openssl=%{l_prefix} \ 1.98 + --with-pcre=%{l_prefix} \ 1.99 + --without-sql 1.100 + 1.101 + # build package 1.102 + %{l_make} %{l_mflags} 1.103 + 1.104 +%install 1.105 + # install package 1.106 + %{l_shtool} mkdir -f -p -m 755 \ 1.107 + $RPM_BUILD_ROOT%{l_prefix}/var/cfengine 1.108 + %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" 1.109 + 1.110 + # strip down installation 1.111 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc >/dev/null 2>&1 || true 1.112 + rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/lib* >/dev/null 2>&1 || true 1.113 + rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir >/dev/null 2>&1 || true 1.114 + strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true 1.115 + 1.116 + # install run-command script 1.117 + %{l_shtool} mkdir -f -p -m 755 \ 1.118 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 1.119 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 1.120 + %{SOURCE rc.cfengine} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 1.121 + 1.122 + # install OSSP fsl configuration 1.123 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl 1.124 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 1.125 + %{SOURCE fsl.cfengine} \ 1.126 + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ 1.127 + 1.128 + # determine installation files 1.129 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 1.130 + %{l_files_std} \ 1.131 + '%config %{l_prefix}/etc/fsl/fsl.cfengine' 1.132 + 1.133 +%files -f files 1.134 + 1.135 +%clean 1.136 + 1.137 +%post 1.138 + # generate a public/private key pair for localhost 1.139 + if [ ! -f $RPM_INSTALL_PREFIX/var/cfengine/ppkeys/localhost.priv ]; then 1.140 + $RPM_INSTALL_PREFIX/sbin/cfkey 1.141 + fi 1.142 +