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:
parent
72c1d757e2
commit
e675c4f5cb
12
cf-execd
12
cf-execd
@ -69,6 +69,18 @@ test -x $CF_EXE_BIN || { echo "$CF_EXE_BIN not installed";
|
|||||||
## Read config
|
## Read config
|
||||||
#. $FOO_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
|
# some VARS
|
||||||
CF_PIDFILE="/var/run/cf-execd.pid"
|
CF_PIDFILE="/var/run/cf-execd.pid"
|
||||||
SVC_NAME="cfengine's execution agent"
|
SVC_NAME="cfengine's execution agent"
|
||||||
|
12
cf-monitord
12
cf-monitord
@ -70,6 +70,18 @@ test -x $CF_MON_BIN || { echo "$CF_MON_BIN not installed";
|
|||||||
## Read config
|
## Read config
|
||||||
#. $FOO_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
|
# some VARS
|
||||||
CF_PIDFILE="/var/run/cf-monitord.pid"
|
CF_PIDFILE="/var/run/cf-monitord.pid"
|
||||||
SVC_NAME="cfengine's monitoring agent"
|
SVC_NAME="cfengine's monitoring agent"
|
||||||
|
12
cf-serverd
12
cf-serverd
@ -69,6 +69,18 @@ test -x $CF_SRV_BIN || { echo "$CF_SRV_BIN not installed";
|
|||||||
## Read config
|
## Read config
|
||||||
#. $FOO_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
|
# some VARS
|
||||||
CF_PIDFILE="/var/run/cf-serverd.pid"
|
CF_PIDFILE="/var/run/cf-serverd.pid"
|
||||||
SVC_NAME="cfengine's server agent"
|
SVC_NAME="cfengine's server agent"
|
||||||
|
@ -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
|
Tue Nov 15 15:02:19 UTC 2011 - chris@computersalat.de
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package cfengine
|
# 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
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -16,16 +16,16 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Name: cfengine
|
Name: cfengine
|
||||||
%define libname libpromises
|
%define libname libpromises
|
||||||
%define libsoname %{libname}1
|
%define libsoname %{libname}1
|
||||||
|
%define workdir /var/lib/%{name}
|
||||||
|
|
||||||
Summary: A Tool to Maintain Complicated Networks
|
Summary: A Tool to Maintain Complicated Networks
|
||||||
Version: 3.2.3
|
License: GPL-3.0
|
||||||
Release: 1
|
|
||||||
License: GPLv3
|
|
||||||
Group: Productivity/Networking/System
|
Group: Productivity/Networking/System
|
||||||
|
Version: 3.2.3
|
||||||
|
Release: 0
|
||||||
Url: http://www.cfengine.org/
|
Url: http://www.cfengine.org/
|
||||||
Source: %{name}-%{version}.tar.gz
|
Source: %{name}-%{version}.tar.gz
|
||||||
Source1: http://www.cfengine.org/manuals/cf3-Reference.pdf
|
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
|
Group: Productivity/Networking/System
|
||||||
%if 0%{?rhel_version} || 0%{?centos_version}
|
%if 0%{?rhel_version} || 0%{?centos_version}
|
||||||
BuildRequires: texinfo
|
BuildRequires: texinfo
|
||||||
BuildRequires: tetex tetex-dvips tetex-latex
|
BuildRequires: tetex
|
||||||
|
BuildRequires: tetex-dvips
|
||||||
|
BuildRequires: tetex-latex
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%description doc
|
%description doc
|
||||||
Full documentation for cfengine
|
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
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
@ -92,6 +102,15 @@ Full documentation for cfengine
|
|||||||
### http://www.fsf.org/about/contact/
|
### 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|' {} \;
|
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
|
%build
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
%{suse_update_config -f}
|
%{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
|
#autoreconf -fi
|
||||||
CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
|
CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
|
||||||
%configure \
|
%configure \
|
||||||
--disable-static \
|
--disable-static \
|
||||||
--docdir=%{_docdir}/%{name} \
|
--datadir=/var/lib \
|
||||||
--with-workdir=/var/lib/%{name}
|
--docdir=%{_docdir}/%{name} \
|
||||||
|
--with-workdir=%{workdir}
|
||||||
%{__make} %{?_smp_mflags}
|
%{__make} %{?_smp_mflags}
|
||||||
|
|
||||||
# --datadir=/var/lib/%{name}/inputs \
|
# --datadir=/var/lib/%{name}/inputs \
|
||||||
@ -111,7 +131,7 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
|
|||||||
[ -d %{buildroot} ] && [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
|
[ -d %{buildroot} ] && [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
|
||||||
%endif
|
%endif
|
||||||
%{__make} "DESTDIR=%{buildroot}" install
|
%{__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 missing AUTHORS LICENSE {S:1}
|
||||||
%{__install} -m0644 AUTHORS LICENSE %{S:1} %{buildroot}/%{_docdir}/%{name}/
|
%{__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-monitord %{buildroot}/%{_sbindir}/rccf-monitord
|
||||||
%{__ln_s} -f ../../etc/init.d/cf-execd %{buildroot}/%{_sbindir}/rccf-execd
|
%{__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 ../../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 ?
|
## FIXME: what is the purpose of theses libs ?
|
||||||
## are they really needed ?
|
## are they really needed ?
|
||||||
@ -130,7 +160,6 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
|
|||||||
|
|
||||||
%preun
|
%preun
|
||||||
%stop_on_removal cf-monitord
|
%stop_on_removal cf-monitord
|
||||||
%stop_on_removal cf-serverd
|
|
||||||
%stop_on_removal cf-execd
|
%stop_on_removal cf-execd
|
||||||
|
|
||||||
%post
|
%post
|
||||||
@ -161,6 +190,12 @@ for i in execd monitord serverd; do
|
|||||||
%restart_on_update cf-${i}
|
%restart_on_update cf-${i}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
%preun server
|
||||||
|
%stop_on_removal cf-serverd
|
||||||
|
|
||||||
|
%postun server
|
||||||
|
%restart_on_update cf-serverd
|
||||||
|
|
||||||
%post -n %{libsoname} -p /sbin/ldconfig
|
%post -n %{libsoname} -p /sbin/ldconfig
|
||||||
|
|
||||||
%postun -n %{libsoname} -p /sbin/ldconfig
|
%postun -n %{libsoname} -p /sbin/ldconfig
|
||||||
@ -174,11 +209,14 @@ done
|
|||||||
%exclude %{_docdir}/%{name}/example_config
|
%exclude %{_docdir}/%{name}/example_config
|
||||||
%exclude %{_docdir}/%{name}/examples
|
%exclude %{_docdir}/%{name}/examples
|
||||||
/usr/sbin/*
|
/usr/sbin/*
|
||||||
%{_datadir}/%{name}
|
%exclude /usr/sbin/cf-serverd
|
||||||
|
%exclude /usr/sbin/rccf-serverd
|
||||||
%{_mandir}/man?/*
|
%{_mandir}/man?/*
|
||||||
%dir /var/lib/%{name}
|
%dir %{workdir}
|
||||||
/var/lib/%{name}/*
|
%{workdir}/*
|
||||||
|
%exclude %{workdir}/bin/cf-serverd
|
||||||
%config %attr(0755,root,root) /etc/init.d/*
|
%config %attr(0755,root,root) /etc/init.d/*
|
||||||
|
%exclude /etc/init.d/cf-serverd
|
||||||
|
|
||||||
%files -n %{libsoname}
|
%files -n %{libsoname}
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
@ -194,4 +232,11 @@ done
|
|||||||
%{_docdir}/%{name}
|
%{_docdir}/%{name}
|
||||||
%exclude %{_docdir}/%{name}/LICENSE
|
%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
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user