]>
Commit | Line | Data |
---|---|---|
95d0617b ER |
1 | # TODO |
2 | # - precise texinfo deps | |
3 | # - pldize initscript | |
4 | # - FHS | |
5 | Summary: A systems administration tool for networks | |
6 | Name: cfengine | |
7 | Version: 3.0.5p1 | |
8 | Release: 0.1 | |
9 | License: GPL v3 | |
10 | Group: Applications/System | |
11 | Source0: http://www.cfengine.org/tarballs/%{name}-%{version}.tar.gz | |
12 | # Source0-md5: b74af23928253e11dcce3d98510f1066 | |
13 | Source1: cf-execd | |
14 | Source2: cf-serverd | |
15 | Source3: cf-monitord | |
16 | URL: http://www.cfengine.org/ | |
17 | BuildRequires: acl-devel | |
18 | BuildRequires: bison | |
19 | BuildRequires: db-devel | |
20 | BuildRequires: flex | |
21 | BuildRequires: libselinux-devel | |
22 | BuildRequires: m4 | |
23 | BuildRequires: openssl-devel | |
24 | BuildRequires: pcre-devel | |
25 | BuildRequires: tetex-dvips | |
26 | Requires(post,preun): /sbin/chkconfig | |
27 | Requires: rc-scripts | |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | Cfengine, or the configuration engine is an agent/software robot and a | |
32 | very high level language for building expert systems to administrate | |
33 | and configure large computer networks. Cfengine uses the idea of | |
34 | classes and a primitive form of intelligence to define and automate | |
35 | the configuration and maintenance of system state, for small to huge | |
36 | configurations. Cfengine is designed to be a part of a computer immune | |
37 | system. | |
38 | ||
39 | %package doc | |
40 | Summary: Documentation for cfengine | |
41 | Group: Documentation | |
42 | Requires: %{name} = %{version}-%{release} | |
43 | ||
44 | %description doc | |
45 | This package contains the documentation for cfengine. | |
46 | ||
47 | %prep | |
48 | %setup -q | |
49 | ||
50 | %build | |
51 | %configure \ | |
52 | BERKELEY_DB_LIB=-ldb \ | |
53 | --docdir=%{_docdir}/%{name}-%{version} \ | |
54 | --enable-selinux | |
55 | %{__make} | |
56 | ||
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_datadir}/%{name}} | |
60 | %{__make} install \ | |
61 | DESTDIR=$RPM_BUILD_ROOT | |
62 | ||
63 | # make directory tree for cfengine configs | |
64 | install -d $RPM_BUILD_ROOT%{_var}/%{name} | |
65 | for i in ppkeys inputs outputs; do | |
66 | mkdir -m 0700 $RPM_BUILD_ROOT%{_var}/%{name}/$i | |
67 | done | |
68 | ||
69 | # It's ugly, but thats the way Mark wants to have it. :( | |
70 | # If we don't create this link, cfexecd will not be able to start | |
71 | # (hardcoded) /var/sbin/cf-agent in scheduled intervals. Other option | |
72 | # would be to patch cfengine to use %{_sbindir}/cf-agent | |
73 | # but upstream won't support this | |
74 | install -d $RPM_BUILD_ROOT%{_var}/%{name}/bin | |
75 | ln -sf %{_sbindir}/cf-agent $RPM_BUILD_ROOT%{_var}/%{name}/bin | |
76 | ln -sf %{_sbindir}/cf-promises $RPM_BUILD_ROOT%{_var}/%{name}/bin | |
77 | ||
78 | # init scripts | |
79 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d | |
80 | for i in %{SOURCE1} %{SOURCE2} %{SOURCE3}; do | |
81 | install -p -m 0755 $i $RPM_BUILD_ROOT/etc/rc.d/init.d | |
82 | done | |
83 | ||
84 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir | |
85 | ||
86 | # All this stuff is pushed into doc/contrib directories | |
87 | rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name} | |
88 | rm -f $RPM_BUILD_ROOT%{_sbindir}/cfdoc | |
89 | ||
90 | %clean | |
91 | rm -rf $RPM_BUILD_ROOT | |
92 | ||
93 | %post | |
94 | [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1 | |
95 | ||
96 | # cfagent won't run nicely, unless your host has keys. | |
97 | if [ ! -d /mnt/sysimage -a ! -f %{_var}/%{name}/ppkeys/localhost.priv ]; then | |
98 | %{_sbindir}/cf-key >/dev/null || : | |
99 | fi | |
100 | ||
101 | # add init files to chkconfig | |
102 | /sbin/chkconfig --add cf-monitord | |
103 | /sbin/chkconfig --add cf-execd | |
104 | /sbin/chkconfig --add cf-serverd | |
105 | %service cf-monitord restart | |
106 | %service cf-execd restart | |
107 | %service cf-serverd restart | |
108 | ||
109 | %preun | |
110 | if [ "$1" = "0" ]; then | |
111 | %service cf-monitord stop | |
112 | %service cf-execd stop | |
113 | %service cf-serverd stop | |
114 | /sbin/chkconfig --del cf-monitord | |
115 | /sbin/chkconfig --del cf-execd | |
116 | /sbin/chkconfig --del cf-serverd | |
117 | fi | |
118 | ||
119 | %postun | |
120 | [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1 | |
121 | ||
122 | %files | |
123 | %defattr(644,root,root,755) | |
124 | %doc AUTHORS ChangeLog README TODO | |
125 | %attr(755,root,root) %{_sbindir}/* | |
126 | %{_libdir}/libpromises* | |
127 | %{_mandir}/man8/* | |
128 | %attr(754,root,root) /etc/rc.d/init.d/cf-monitord | |
129 | %attr(754,root,root) /etc/rc.d/init.d/cf-execd | |
130 | %attr(754,root,root) /etc/rc.d/init.d/cf-serverd | |
131 | %{_var}/%{name} | |
132 | ||
133 | %files doc | |
134 | %defattr(644,root,root,755) | |
135 | %doc inputs | |
136 | %doc docs/*html | |
137 | %doc docs/*pdf |