Accepting request 101360 from home:computersalat:devel:sysmgmnt

fix init scripts, subpkg server

OBS-URL: https://build.opensuse.org/request/show/101360
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=12
This commit is contained in:
Christian Wittmer 2012-01-24 14:32:07 +00:00 committed by Git OBS Bridge
parent 72c1d757e2
commit e675c4f5cb
5 changed files with 108 additions and 15 deletions

View File

@ -69,6 +69,18 @@ test -x $CF_EXE_BIN || { echo "$CF_EXE_BIN not installed";
## Read config
#. $FOO_CONFIG
## Check for promises file
CF_PROMISES=/var/lib/cfengine/inputs/promises.cf
test -r $CF_PROMISES || { echo "$CF_PROMISES not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
## Check for failsafe file
CF_FAILSAFE=/var/lib/cfengine/inputs/failsafe.cf
test -r $CF_FAILSAFE || { echo "$CF_FAILSAFE not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# some VARS
CF_PIDFILE="/var/run/cf-execd.pid"
SVC_NAME="cfengine's execution agent"

View File

@ -70,6 +70,18 @@ test -x $CF_MON_BIN || { echo "$CF_MON_BIN not installed";
## Read config
#. $FOO_CONFIG
## Check for promises file
CF_PROMISES=/var/lib/cfengine/inputs/promises.cf
test -r $CF_PROMISES || { echo "$CF_PROMISES not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
## Check for failsafe file
CF_FAILSAFE=/var/lib/cfengine/inputs/failsafe.cf
test -r $CF_FAILSAFE || { echo "$CF_FAILSAFE not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# some VARS
CF_PIDFILE="/var/run/cf-monitord.pid"
SVC_NAME="cfengine's monitoring agent"

View File

@ -69,6 +69,18 @@ test -x $CF_SRV_BIN || { echo "$CF_SRV_BIN not installed";
## Read config
#. $FOO_CONFIG
## Check for promises file
CF_PROMISES=/var/lib/cfengine/inputs/promises.cf
test -r $CF_PROMISES || { echo "$CF_PROMISES not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
## Check for failsafe file
CF_FAILSAFE=/var/lib/cfengine/inputs/failsafe.cf
test -r $CF_FAILSAFE || { echo "$CF_FAILSAFE not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# some VARS
CF_PIDFILE="/var/run/cf-serverd.pid"
SVC_NAME="cfengine's server agent"

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Jan 24 14:27:49 UTC 2012 - chris@computersalat.de
- move "server" stuff to subpkg
-------------------------------------------------------------------
Fri Jan 13 13:34:32 UTC 2012 - chris@computersalat.de
- fix init scripts
* check for existing "promises.cf, failsafe.cf"
- create symlinks for sbin_PROGRAMS
-------------------------------------------------------------------
Tue Nov 15 15:02:19 UTC 2011 - chris@computersalat.de

View File

@ -1,7 +1,7 @@
#
# spec file for package cfengine
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,16 +16,16 @@
#
Name: cfengine
%define libname libpromises
%define libsoname %{libname}1
%define workdir /var/lib/%{name}
Summary: A Tool to Maintain Complicated Networks
Version: 3.2.3
Release: 1
License: GPLv3
License: GPL-3.0
Group: Productivity/Networking/System
Version: 3.2.3
Release: 0
Url: http://www.cfengine.org/
Source: %{name}-%{version}.tar.gz
Source1: http://www.cfengine.org/manuals/cf3-Reference.pdf
@ -77,12 +77,22 @@ Summary: A Tool to Maintain Complicated Networks (docs)
Group: Productivity/Networking/System
%if 0%{?rhel_version} || 0%{?centos_version}
BuildRequires: texinfo
BuildRequires: tetex tetex-dvips tetex-latex
BuildRequires: tetex
BuildRequires: tetex-dvips
BuildRequires: tetex-latex
%endif
%description doc
Full documentation for cfengine
%package server
Summary: Files needed for cfengine server
Group: Productivity/Networking/System
Requires: %{name} = %{version}-%{release}
%description server
This package contains the files of the cfengine server.
%prep
%setup -q
@ -92,6 +102,15 @@ Full documentation for cfengine
### http://www.fsf.org/about/contact/
find ./examples -type f -name "*.cf" -exec perl -p -i -e 's|\r\n|\n|,s|^# Foundation.*|# Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA|' {} \;
### FIXME
# there are 3 different cfengine_stdlib.cf
## as of 3.2.3
# ./examples/cfengine_stdlib.cf - Rev: 95
# ./examples/example_config/cfengine_stdlib.cf - Rev: 61
# ./masterfiles/cfengine_stdlib.cf - Rev: 84
%{__cp} -a ./examples/cfengine_stdlib.cf ./examples/example_config/
%{__cp} -a ./examples/cfengine_stdlib.cf ./masterfiles/
%build
%if 0%{?suse_version}
%{suse_update_config -f}
@ -99,9 +118,10 @@ find ./examples -type f -name "*.cf" -exec perl -p -i -e 's|\r\n|\n|,s|^# Founda
#autoreconf -fi
CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
%configure \
--disable-static \
--docdir=%{_docdir}/%{name} \
--with-workdir=/var/lib/%{name}
--disable-static \
--datadir=/var/lib \
--docdir=%{_docdir}/%{name} \
--with-workdir=%{workdir}
%{__make} %{?_smp_mflags}
# --datadir=/var/lib/%{name}/inputs \
@ -111,7 +131,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,etc/init.d,/var/lib/%{name}/bin}
%{__install} -d %{buildroot}/{usr/sbin,etc/init.d,%{workdir}/bin}
# install missing AUTHORS LICENSE {S:1}
%{__install} -m0644 AUTHORS LICENSE %{S:1} %{buildroot}/%{_docdir}/%{name}/
@ -121,7 +141,17 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
%{__ln_s} -f ../../etc/init.d/cf-monitord %{buildroot}/%{_sbindir}/rccf-monitord
%{__ln_s} -f ../../etc/init.d/cf-execd %{buildroot}/%{_sbindir}/rccf-execd
%{__ln_s} -f ../../etc/init.d/cf-serverd %{buildroot}/%{_sbindir}/rccf-serverd
%{__ln_s} -f ../../../..%{_sbindir}/cf-promises %{buildroot}/var/lib/%{name}/bin/cf-promises
# create symlinks for sbin_PROGRAMS
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
# mv all masterfiles/*.cf to masterfiles/*.cf.default
pushd %{buildroot}%{workdir}/masterfiles
for j in $(ls -1); do
mv ${j} ${j}.default
done
## FIXME: what is the purpose of theses libs ?
## are they really needed ?
@ -130,7 +160,6 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
%preun
%stop_on_removal cf-monitord
%stop_on_removal cf-serverd
%stop_on_removal cf-execd
%post
@ -161,6 +190,12 @@ for i in execd monitord serverd; do
%restart_on_update cf-${i}
done
%preun server
%stop_on_removal cf-serverd
%postun server
%restart_on_update cf-serverd
%post -n %{libsoname} -p /sbin/ldconfig
%postun -n %{libsoname} -p /sbin/ldconfig
@ -174,11 +209,14 @@ done
%exclude %{_docdir}/%{name}/example_config
%exclude %{_docdir}/%{name}/examples
/usr/sbin/*
%{_datadir}/%{name}
%exclude /usr/sbin/cf-serverd
%exclude /usr/sbin/rccf-serverd
%{_mandir}/man?/*
%dir /var/lib/%{name}
/var/lib/%{name}/*
%dir %{workdir}
%{workdir}/*
%exclude %{workdir}/bin/cf-serverd
%config %attr(0755,root,root) /etc/init.d/*
%exclude /etc/init.d/cf-serverd
%files -n %{libsoname}
%defattr(-,root,root)
@ -194,4 +232,11 @@ done
%{_docdir}/%{name}
%exclude %{_docdir}/%{name}/LICENSE
%files server
%defattr(-,root,root)
/usr/sbin/cf-serverd
/usr/sbin/rccf-serverd
%{workdir}/bin/cf-serverd
/etc/init.d/cf-serverd
%changelog