|
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 |
|
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: 3.2.4 |
|
35 Release: 20120211 |
|
36 |
|
37 # package options |
|
38 %option with_fsl yes |
|
39 |
|
40 # list of sources |
|
41 Source0: http://cfengine.com/source-code/download?file=cfengine-%{version}.tar.gz |
|
42 Source1: rc.cfengine |
|
43 Source2: fsl.cfengine |
|
44 |
|
45 # build information |
|
46 BuildPreReq: OpenPKG, openpkg >= 20100101, bison, flex, gcc |
|
47 PreReq: OpenPKG, openpkg >= 20100101 |
|
48 BuildPreReq: db, openssl, pcre |
|
49 PreReq: db, openssl, pcre |
|
50 %if "%{with_fsl}" == "yes" |
|
51 BuildPreReq: fsl |
|
52 PreReq: fsl |
|
53 %endif |
|
54 |
|
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 |
|
65 %track |
|
66 prog cfengine = { |
|
67 version = %{version} |
|
68 url = http://cfengine.com/source-code |
|
69 regex = \bcfengine-(\d+.\d+\.\d+(p\d+)?)\.tar\.gz |
|
70 } |
|
71 |
|
72 %prep |
|
73 %setup -q |
|
74 |
|
75 %build |
|
76 # configure package |
|
77 loclibs="" |
|
78 case "%{l_platform -t}" in |
|
79 *-sunos* ) |
|
80 loclibs="-lrt" |
|
81 ;; |
|
82 esac |
|
83 CC="%{l_cc}" \ |
|
84 CFLAGS="%{l_cflags -O}" \ |
|
85 CPPFLAGS="%{l_cppflags postgresql .}" \ |
|
86 LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ |
|
87 LIBS="%{l_fsl_libs} $loclibs" \ |
|
88 ./configure \ |
|
89 --prefix=%{l_prefix} \ |
|
90 --mandir=%{l_prefix}/man \ |
|
91 --infodir=%{l_prefix}/info \ |
|
92 --with-workdir=%{l_prefix}/var/cfengine \ |
|
93 --with-berkeleydb=%{l_prefix} \ |
|
94 --with-openssl=%{l_prefix} \ |
|
95 --with-pcre=%{l_prefix} \ |
|
96 --without-sql |
|
97 |
|
98 # build package |
|
99 %{l_make} %{l_mflags} |
|
100 |
|
101 %install |
|
102 # install package |
|
103 %{l_shtool} mkdir -f -p -m 755 \ |
|
104 $RPM_BUILD_ROOT%{l_prefix}/var/cfengine |
|
105 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" |
|
106 |
|
107 # strip down installation |
|
108 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc >/dev/null 2>&1 || true |
|
109 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/lib* >/dev/null 2>&1 || true |
|
110 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir >/dev/null 2>&1 || true |
|
111 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true |
|
112 |
|
113 # install run-command script |
|
114 %{l_shtool} mkdir -f -p -m 755 \ |
|
115 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
|
116 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
117 %{SOURCE rc.cfengine} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
|
118 |
|
119 # install OSSP fsl configuration |
|
120 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl |
|
121 %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
122 %{SOURCE fsl.cfengine} \ |
|
123 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ |
|
124 |
|
125 # determine installation files |
|
126 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
|
127 %{l_files_std} \ |
|
128 '%config %{l_prefix}/etc/fsl/fsl.cfengine' |
|
129 |
|
130 %files -f files |
|
131 |
|
132 %clean |
|
133 |
|
134 %post |
|
135 # generate a public/private key pair for localhost |
|
136 if [ ! -f $RPM_INSTALL_PREFIX/var/cfengine/ppkeys/localhost.priv ]; then |
|
137 $RPM_INSTALL_PREFIX/sbin/cfkey |
|
138 fi |
|
139 |