diff --git a/cfengine.changes b/cfengine.changes index 6fbe2bf..4f33e73 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,7 +1,13 @@ ------------------------------------------------------------------- Thu Oct 4 08:48:10 UTC 2012 - kkaempf@suse.com -- honor filesystem hierachy standard (FHS): build with --enable-fhs +- honor filesystem hierachy standard (FHS): + - build with --enable-fhs + +- honor documentation + - install in /var/cfengine + +- support systemd where applicable - update to 3.0.4b2 New features: diff --git a/cfengine.spec b/cfengine.spec index c41e636..dd4f257 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -19,8 +19,10 @@ Name: cfengine %define libname libpromises %define libsoname %{libname}1 -%define basedir /var/lib/%{name} -%define workdir %{basedir}/work + +# Yes, its not FHS conformant but in sync with cfengine documentation +%define basedir /var/%{name} +%define workdir %{basedir} Summary: CFEngine automates large-scale IT computing infrastructure License: GPL-3.0 @@ -151,7 +153,7 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ --disable-static \ --enable-fhs \ --with-libxml2 \ - --datadir=/var/lib \ + --datadir=/var \ --docdir=%{_docdir}/%{name} \ --with-workdir=%{workdir} %{__make} %{?_smp_mflags} @@ -163,7 +165,7 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ [ -d %{buildroot} ] && [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} %endif %{__make} "DESTDIR=%{buildroot}" install -%{__install} -d %{buildroot}/{usr/sbin,%{workdir}/{bin,inputs}} +%{__install} -d %{buildroot}/{usr/sbin,%{workdir}/{bin,inputs,reports}} # create dirs needed for better organizing dirs and files %{__install} -d %{buildroot}/%{basedir}/{backup,failsafe,config} @@ -196,21 +198,21 @@ sed -i\ %{__install} -m 0644 %{S:1} %{S:2} %{S:3} %{S:4} %{S:5} %{S:6} %{buildroot}/%{_datadir}/doc/%{name} # create symlinks for sbin_PROGRAMS -# WHY ? -#for i in cf-agent cf-execd cf-key cf-know cf-monitord cf-promises cf-report cf-runagent cf-serverd; do -# %{__ln_s} -f ../../../../..%{_sbindir}/${i} %{buildroot}%{workdir}/bin/${i} -#done +# because: cf-promises needs to be installed in /var/cfengine/work/bin for pre-validation of full configuration +for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-report cf-runagent cf-serverd; do + %{__ln_s} -f ../../..%{_sbindir}/${i} %{buildroot}%{workdir}/bin/${i} +done -# mv all masterfiles/*.cf to masterfiles/*.cf.default -#pushd %{buildroot}%{basedir}/masterfiles -#for j in $(ls -1); do -# cp -a * ../work/inputs/ -# mv ${j} ${j}.default -#done +# Install masterfiles (as %config(noreplace) ) +%{__install} -d %{buildroot}/%{basedir}/masterfiles +%{__install} -m 0644 masterfiles/def.cf %{buildroot}/%{basedir}/masterfiles +%{__install} -m 0644 masterfiles/promises.cf %{buildroot}/%{basedir}/masterfiles +%{__install} -m 0644 masterfiles/libraries/cfengine_stdlib.cf %{buildroot}/%{basedir}/masterfiles +%{__install} -m 0644 masterfiles/failsafe/failsafe.cf %{buildroot}/%{basedir}/masterfiles rm -rf %{buildroot}/%{_libdir}/%{name}/libpromises.la -#{__rm} -rf %{buildroot}/%{_libdir}/libpromises.a +# will appear in %docdir rm -rf %{buildroot}/%{_datadir}/%{name}/ChangeLog rm -rf %{buildroot}/%{_datadir}/%{name}/README @@ -241,6 +243,11 @@ rm -rf %{buildroot}/%{_datadir}/%{name}/README %service_add_pre cf-serverd.service %post server +if [ ${1:-0} -ne 1 ]; then + cp -a /usr/share/cfengine/CoreBase/controls /var/cfengine/inputs + cp -a /usr/share/cfengine/CoreBase/libraries /var/cfengine/inputs + cp -a /usr/share/cfengine/CoreBase/services /var/cfengine/inputs +fi %service_add_post cf-serverd.service %preun server @@ -334,16 +341,23 @@ rm -rf %{buildroot}/%{_datadir}/%{name}/README %{_mandir}/man?/* %dir %{basedir} -%dir %{_datadir}/%{name} -%{_datadir}/%{name}/* -#%dir %{workdir} -#%{workdir}/* +/var/%{name} %exclude %{basedir}/backup %exclude %{basedir}/config #%exclude %{basedir}/failsafe -#%exclude %{workdir}/bin/cf-serverd + +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/* + +%dir %{workdir} +%{workdir}/* +%exclude %{workdir}/bin/cf-serverd + %config(noreplace) /etc/cron.d/%{name} +%dir %{basedir}/masterfiles +%config(noreplace) %{basedir}/masterfiles/*.cf + %files -n %{libsoname} %defattr(-,root,root) %dir %{_libdir}/%{name} @@ -363,6 +377,7 @@ rm -rf %{buildroot}/%{_datadir}/%{name}/README %{basedir}/backup %{basedir}/config %{_sbindir}/cf-serverd +%{workdir}/bin/cf-serverd %if 0%{?suse_version} >= 1210 %_unitdir/cf-serverd.service %else