]> git.pld-linux.org Git - packages/cfengine.git/blame - cfengine.spec
- new, based on fedora package
[packages/cfengine.git] / cfengine.spec
CommitLineData
95d0617b
ER
1# TODO
2# - precise texinfo deps
3# - pldize initscript
4# - FHS
5Summary: A systems administration tool for networks
6Name: cfengine
7Version: 3.0.5p1
8Release: 0.1
9License: GPL v3
10Group: Applications/System
11Source0: http://www.cfengine.org/tarballs/%{name}-%{version}.tar.gz
12# Source0-md5: b74af23928253e11dcce3d98510f1066
13Source1: cf-execd
14Source2: cf-serverd
15Source3: cf-monitord
16URL: http://www.cfengine.org/
17BuildRequires: acl-devel
18BuildRequires: bison
19BuildRequires: db-devel
20BuildRequires: flex
21BuildRequires: libselinux-devel
22BuildRequires: m4
23BuildRequires: openssl-devel
24BuildRequires: pcre-devel
25BuildRequires: tetex-dvips
26Requires(post,preun): /sbin/chkconfig
27Requires: rc-scripts
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%description
31Cfengine, or the configuration engine is an agent/software robot and a
32very high level language for building expert systems to administrate
33and configure large computer networks. Cfengine uses the idea of
34classes and a primitive form of intelligence to define and automate
35the configuration and maintenance of system state, for small to huge
36configurations. Cfengine is designed to be a part of a computer immune
37system.
38
39%package doc
40Summary: Documentation for cfengine
41Group: Documentation
42Requires: %{name} = %{version}-%{release}
43
44%description doc
45This 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
58rm -rf $RPM_BUILD_ROOT
59install -d $RPM_BUILD_ROOT{%{_sbindir},%{_datadir}/%{name}}
60%{__make} install \
61 DESTDIR=$RPM_BUILD_ROOT
62
63# make directory tree for cfengine configs
64install -d $RPM_BUILD_ROOT%{_var}/%{name}
65for i in ppkeys inputs outputs; do
66 mkdir -m 0700 $RPM_BUILD_ROOT%{_var}/%{name}/$i
67done
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
74install -d $RPM_BUILD_ROOT%{_var}/%{name}/bin
75ln -sf %{_sbindir}/cf-agent $RPM_BUILD_ROOT%{_var}/%{name}/bin
76ln -sf %{_sbindir}/cf-promises $RPM_BUILD_ROOT%{_var}/%{name}/bin
77
78# init scripts
79install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
80for i in %{SOURCE1} %{SOURCE2} %{SOURCE3}; do
81 install -p -m 0755 $i $RPM_BUILD_ROOT/etc/rc.d/init.d
82done
83
84rm -f $RPM_BUILD_ROOT%{_infodir}/dir
85
86# All this stuff is pushed into doc/contrib directories
87rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}
88rm -f $RPM_BUILD_ROOT%{_sbindir}/cfdoc
89
90%clean
91rm -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.
97if [ ! -d /mnt/sysimage -a ! -f %{_var}/%{name}/ppkeys/localhost.priv ]; then
98 %{_sbindir}/cf-key >/dev/null || :
99fi
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
110if [ "$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
117fi
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
This page took 0.127814 seconds and 4 git commands to generate.