Tue, 28 Aug 2012 18:33:50 +0200
Import package vendor original specs for necessary manipulations.
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 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/cfengine/fsl.cfengine Tue Aug 28 18:33:50 2012 +0200 2.3 @@ -0,0 +1,16 @@ 2.4 +## 2.5 +## fsl.cfengine -- OSSP fsl configuration 2.6 +## 2.7 + 2.8 +ident (cfagent|cfenvd|cfexecd|cfkey|cfrun|cfservd)/.+ q{ 2.9 + prefix( 2.10 + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " 2.11 + ) 2.12 + -> { 2.13 + debug: file( 2.14 + path="@l_prefix@/var/cfengine/cfengine.log", 2.15 + perm=0644 2.16 + ) 2.17 + } 2.18 +}; 2.19 +
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/cfengine/rc.cfengine Tue Aug 28 18:33:50 2012 +0200 3.3 @@ -0,0 +1,72 @@ 3.4 +#!@l_prefix@/bin/openpkg rc 3.5 +## 3.6 +## rc.cfengine -- Run-Commands 3.7 +## 3.8 + 3.9 +%config 3.10 + cfengine_enable="$openpkg_rc_def" 3.11 + cfengine_cservd_flags="" 3.12 + cfengine_cenvd_flags="" 3.13 + cfengine_log_prolog="true" 3.14 + cfengine_log_epilog="true" 3.15 + cfengine_log_numfiles="10" 3.16 + cfengine_log_minsize="1M" 3.17 + cfengine_log_complevel="9" 3.18 + 3.19 +%common 3.20 + cfengine_cfservd_pidfile="@l_prefix@/var/cfengine/cfservd.pid" 3.21 + cfengine_cfenvd_pidfile="@l_prefix@/var/cfengine/cfenvd.pid" 3.22 + cfengine_signal () { 3.23 + [ -f $cfengine_cfservd_pidfile ] \ 3.24 + && kill -$1 `cat $cfengine_cfservd_pidfile` 3.25 + local rc=$? 3.26 + [ -f $cfengine_cfenvd_pidfile ] \ 3.27 + && kill -$1 `cat $cfengine_cfenvd_pidfile` \ 3.28 + && [ $rc -eq 0 ] 3.29 + } 3.30 + 3.31 +%status -u @l_susr@ -o 3.32 + cfengine_usable="unknown" 3.33 + cfengine_active="no" 3.34 + rcService cfengine enable yes && \ 3.35 + cfengine_signal 0 && cfengine_active="yes" 3.36 + echo "cfengine_enable=\"$cfengine_enable\"" 3.37 + echo "cfengine_usable=\"$cfengine_usable\"" 3.38 + echo "cfengine_active=\"$cfengine_active\"" 3.39 + 3.40 +%start -u @l_susr@ 3.41 + rcService cfengine enable yes || exit 0 3.42 + rcService cfengine active yes && exit 0 3.43 + ( nohup @l_prefix@/sbin/cfservd \ 3.44 + --no-fork $cfengine_cfservd_flags \ 3.45 + </dev/null >/dev/null 2>&1 & 3.46 + echo $! >$cfengine_cfservd_pidfile 3.47 + ) >/dev/null 2>&1 3.48 + ( nohup @l_prefix@/sbin/cfenvd \ 3.49 + --no-fork $cfengine_cfenvd_flags \ 3.50 + </dev/null >/dev/null 2>&1 & 3.51 + echo $! >$cfengine_cfenvd_pidfile 3.52 + ) >/dev/null 2>&1 3.53 + 3.54 +%stop -u @l_susr@ 3.55 + rcService cfengine enable yes || exit 0 3.56 + rcService cfengine active no && exit 0 3.57 + cfengine_signal TERM 3.58 + sleep 2 3.59 + rm -f $cfengine_cfservd_pidfile 2>/dev/null || true 3.60 + rm -f $cfengine_cfenvd_pidfile 2>/dev/null || true 3.61 + 3.62 +%restart -u @l_susr@ 3.63 + rcService cfengine enable yes || exit 0 3.64 + rcService cfengine active no && exit 0 3.65 + rc cfengine stop start 3.66 + 3.67 +%daily -u @l_susr@ 3.68 + rcService cfengine enable yes || exit 0 3.69 + shtool rotate -f \ 3.70 + -n ${cfengine_log_numfiles} -s ${cfengine_log_minsize} -d \ 3.71 + -z ${cfengine_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \ 3.72 + -P "${cfengine_log_prolog}" \ 3.73 + -E "${cfengine_log_epilog}" \ 3.74 + @l_prefix@/var/cfengine/cfengine.log 3.75 +