2007-01-16 00:06:50 +01:00
#
2011-10-06 17:21:12 +02:00
# spec file for package cfengine
2007-01-16 00:06:50 +01:00
#
2012-01-24 15:32:07 +01:00
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
2007-01-16 00:06:50 +01:00
#
2008-09-12 23:31:39 +02:00
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2007-01-16 00:06:50 +01:00
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name : cfengine
2011-10-06 17:21:12 +02:00
%define libname libpromises
%define libsoname %{libname}1
2012-10-08 15:04:19 +02:00
# Yes, its not FHS conformant but in sync with cfengine documentation
%define basedir /var/%{name}
%define workdir %{basedir}
2011-10-06 17:21:12 +02:00
2012-10-04 10:52:41 +02:00
Summary : CFEngine automates large-scale IT computing infrastructure
2012-01-24 15:32:07 +01:00
License : GPL-3.0
2007-01-16 00:06:50 +01:00
Group : Productivity/Networking/System
2012-12-14 09:07:06 +01:00
Version : 3.4.1
2012-01-24 15:32:07 +01:00
Release : 0
2007-11-21 22:09:52 +01:00
Url : http://www.cfengine.org/
2012-10-04 10:52:41 +02:00
Source : %{name} -%{version} .tar.bz2
2011-10-06 17:21:12 +02:00
Source1 : http://www.cfengine.org/manuals/cf3-Reference.pdf
2012-10-04 10:52:41 +02:00
Source2 : http://www.cfengine.org/manuals/cf3-conceptguide.pdf
Source3 : http://www.cfengine.org/manuals/cf3-glossary.pdf
Source4 : http://www.cfengine.org/manuals/cf3-quickstart.pdf
Source5 : http://www.cfengine.org/manuals/cf3-solutions.pdf
Source6 : http://www.cfengine.org/manuals/cf3-tutorial.pdf
%if 0%{?suse_version} >= 1210
Source7 : cf-execd.service
Source8 : cf-monitord.service
Source9 : cf-serverd.service
%else
Source7 : cf-monitord
Source8 : cf-execd
Source9 : cf-serverd
%endif
2012-01-30 20:10:38 +01:00
Source10 : %{name} .cron
2007-01-16 00:06:50 +01:00
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2011-10-06 17:21:12 +02:00
BuildRequires : bison
BuildRequires : db-devel
BuildRequires : flex
2012-10-04 10:52:41 +02:00
BuildRequires : libtokyocabinet-devel
2011-10-06 17:21:12 +02:00
BuildRequires : libtool
2012-10-05 14:21:25 +02:00
BuildRequires : libxml2-devel
2012-10-05 14:43:48 +02:00
# Disable mysql for SLE_11:
# configure: error: MySQL client library exports symbols clashing with
# OpenSSL. Get the update from distribution provider, recompile MySQL
# library or disable MySQL connector. See
# http://bugs.mysql.com/bug.php?id=65055 for details.
%if 0%{?suse_version} != 1110
2011-10-06 17:21:12 +02:00
BuildRequires : mysql-devel
2012-10-05 14:43:48 +02:00
%endif
2011-10-06 17:21:12 +02:00
BuildRequires : openssl-devel
BuildRequires : pcre-devel
BuildRequires : postgresql-devel
2012-02-07 13:27:12 +01:00
%if 0%{?centos_version} || 0%{?rhel_version}
Requires : vixie-cron
%else
2012-01-30 20:10:38 +01:00
Requires : cron
2012-02-07 13:27:12 +01:00
%endif
2011-10-06 17:21:12 +02:00
%if 0%{?suse_version}
2008-09-12 23:31:39 +02:00
PreReq : %install_info_prereq
2011-10-06 17:21:12 +02:00
BuildRequires : texlive
%endif
2007-01-16 00:06:50 +01:00
2012-10-04 10:52:41 +02:00
%if 0%{?suse_version} >= 1210
BuildRequires : systemd
%{?systemd_requires}
%endif
2007-01-16 00:06:50 +01:00
%description
2012-10-04 10:52:41 +02:00
CFEngine automates large-scale IT computing infrastructure: ensuring
the availability, security and compliance of mission-critical
applications and services. Based on popular and flexible open source
configuration management software, CFEngine configuration management
products are highly scalable through decentralized, autonomous agents
that can continuously monitor, self-repair, and update the IT
infrastructure of a global multi-site enterprise - with negligible
impact on system resources or performance.
2007-01-16 00:06:50 +01:00
2011-10-06 17:21:12 +02:00
%package -n %{libsoname}
Summary : Shared library of cfengine
Group : System/Libraries
2012-02-15 16:14:26 +01:00
%if 0%{?suse_version} == 1010
Requires : glibc
%endif
2011-10-06 17:21:12 +02:00
%description -n %{libsoname}
This package contains the shared libpromises (cfengine) library.
%package devel
Summary : Development package for cfengine
Group : Development/Libraries/C and C++
Requires : %{libsoname} = %{version}
Requires : glibc-devel
2007-01-16 00:06:50 +01:00
2011-10-06 17:21:12 +02:00
%description devel
A high-speed character set detection library
This package contains the files needed to compile programs that use the
libguess library.
%package doc
2012-10-04 10:52:41 +02:00
Summary : CFEngine automates large-scale IT computing infrastructure - documentation
2011-10-06 17:21:12 +02:00
Group : Productivity/Networking/System
%if 0%{?rhel_version} || 0%{?centos_version}
2012-01-24 15:32:07 +01:00
BuildRequires : tetex
BuildRequires : tetex-dvips
BuildRequires : tetex-latex
2012-10-04 10:52:41 +02:00
BuildRequires : texinfo
2011-10-06 17:21:12 +02:00
%endif
%description doc
Full documentation for cfengine
2007-01-16 00:06:50 +01:00
2012-01-24 15:32:07 +01:00
%package server
2012-10-04 10:52:41 +02:00
Summary : CFEngine automates large-scale IT computing infrastructure - server
2012-01-24 15:32:07 +01:00
Group : Productivity/Networking/System
Requires : %{name} = %{version} -%{release}
%description server
This package contains the files of the cfengine server.
2007-01-16 00:06:50 +01:00
%prep
%setup -q
2011-10-06 17:21:12 +02:00
##### rpmlint
#### wrong-file-end-of-line-encoding
#### incorrect-fsf-address
### http://www.fsf.org/about/contact/
find ./examples -type f -name " * . c f " -exec perl -p -i -e 's|\r\n|\n|,s|^# Foundation.*|# Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA|' {} \;
2007-01-16 00:06:50 +01:00
%build
2011-10-06 17:21:12 +02:00
%if 0%{?suse_version}
2007-01-16 00:06:50 +01:00
%{suse_update_config -f}
2011-10-06 17:21:12 +02:00
%endif
#autoreconf -fi
CC=gcc CFLAGS=" $RPM_OPT_FLAGS - f n o - s t r i c t - a l i a s i n g " \
%configure \
2012-01-24 15:32:07 +01:00
--disable-static \
2012-10-05 14:21:25 +02:00
--enable-fhs \
--with-libxml2 \
2012-10-08 15:04:19 +02:00
--datadir=/var \
2012-01-24 15:32:07 +01:00
--docdir=%{_docdir} /%{name} \
--with-workdir=%{workdir}
2011-10-06 17:21:12 +02:00
%{__make} %{?_smp_mflags}
# --datadir=/var/lib/%{name}/inputs \
2007-01-16 00:06:50 +01:00
%install
2011-10-06 17:21:12 +02:00
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
[ -d %{buildroot} ] && [ " %{buildroot} " != " / " ] && %{__rm} -rf %{buildroot}
%endif
%{__make} " D E S T D I R = %{buildroot} " install
2012-10-08 15:04:19 +02:00
%{__install} -d %{buildroot} /{usr/sbin,%{workdir} /{bin,inputs,reports}}
2011-10-06 17:21:12 +02:00
2012-01-30 20:10:38 +01:00
# create dirs needed for better organizing dirs and files
%{__install} -d %{buildroot} /%{basedir} /{backup,failsafe,config}
#%{__install} -d %{buildroot}/%{basedir}/config/{development,production}
# install cron file
%{__install} -D -m0644 %{S:10} %{buildroot} /%{_sysconfdir} /cron.d/%{name}
2012-10-21 12:08:48 +02:00
%if 0%{?suse_version} >= 1210
2012-10-04 10:52:41 +02:00
# install systemd scripts
%{__install} -D -m 0644 %{S:7} %{buildroot} /%_unitdir /cf-execd.service
%{__install} -D -m 0644 %{S:8} %{buildroot} /%_unitdir /cf-monitord.service
%{__install} -D -m 0644 %{S:9} %{buildroot} /%_unitdir /cf-serverd.service
%else
2011-10-06 17:21:12 +02:00
# install init scripts
2012-10-05 14:21:25 +02:00
%{__install} -d %{buildroot} /etc/init.d
2012-10-04 10:52:41 +02:00
%{__install} -m 0755 %{S:7} %{S:8} %{S:9} %{buildroot} /etc/init.d/
2011-10-06 17:21:12 +02:00
%{__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
2012-01-30 20:10:38 +01:00
# sed @workdir@ in initscripts/cron.d
sed -i\
-e " s , @ w o r k d i r @ , %{workdir} , g " \
-e " s , @ b a s e d i r @ , %{basedir} , g " \
%{buildroot} /etc/init.d/cf-* %{buildroot} /etc/cron.d/%{name}
2012-10-04 10:52:41 +02:00
%endif
2012-01-24 15:32:07 +01:00
2012-10-05 14:21:25 +02:00
# install docs
2012-10-05 14:43:48 +02:00
%{__install} -d %{buildroot} /%{_datadir} /doc/%{name}
%{__install} -m 0644 %{S:1} %{S:2} %{S:3} %{S:4} %{S:5} %{S:6} %{buildroot} /%{_datadir} /doc/%{name}
2012-10-05 14:21:25 +02:00
2012-01-24 15:32:07 +01:00
# create symlinks for sbin_PROGRAMS
2012-10-08 15:04:19 +02:00
# 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
# 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
2011-10-06 17:21:12 +02:00
2012-10-05 14:21:25 +02:00
rm -rf %{buildroot} /%{_libdir} /%{name} /libpromises.la
2011-10-06 17:21:12 +02:00
2012-10-08 15:04:19 +02:00
# will appear in %docdir
2012-10-05 14:21:25 +02:00
rm -rf %{buildroot} /%{_datadir} /%{name} /ChangeLog
rm -rf %{buildroot} /%{_datadir} /%{name} /README
2012-10-04 10:52:41 +02:00
# systemd
%if 0%{?suse_version} >= 1210
%pre
%service_add_pre cf-execd.service cf-monitord.service
%post
%service_add_post cf-execd.service cf-monitord.service
%if 0%{?suse_version} > 1010
%install _info --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz
%endif
/sbin/ldconfig
%preun
%service_del_preun cf-execd.service cf-monitord.service
%postun
%service_del_postun cf-execd.service cf-monitord.service
%if 0%{?suse_version} > 1010
%install _info_delete --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz
%endif
/sbin/ldconfig
%pre server
%service_add_pre cf-serverd.service
%post server
2012-10-08 15:04:19 +02:00
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
2012-10-04 10:52:41 +02:00
%service_add_post cf-serverd.service
%preun server
%service_del_preun cf-serverd.service
%postun server
%service_del_postun cf-serverd.service
%else # !systemd
2011-10-06 17:21:12 +02:00
%preun
2012-02-08 13:40:10 +01:00
%if 0%{?suse_version}
2011-10-06 17:21:12 +02:00
%stop_on_removal cf-monitord
%stop_on_removal cf-execd
2012-02-08 13:40:10 +01:00
%else
/etc/init.d/cf-execd stop
/etc/init.d/cf-monitord stop
%endif
2007-01-16 00:06:50 +01:00
2008-09-12 23:31:39 +02:00
%post
2012-02-15 16:14:26 +01:00
%if 0%{?suse_version} > 1010
2011-10-06 17:21:12 +02:00
%install _info --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz
%endif
/sbin/ldconfig
2008-09-12 23:31:39 +02:00
2007-01-16 00:06:50 +01:00
%postun
2012-02-15 16:14:26 +01:00
%if 0%{?suse_version} > 1010
2011-10-06 17:21:12 +02:00
%install _info_delete --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz
2012-02-08 16:13:48 +01:00
%insserv_cleanup
for i in execd monitord; do
%restart_on_update cf-${i}
done
2011-10-06 17:21:12 +02:00
%else
2012-02-08 16:13:48 +01:00
# Update ?
if [ ${1:-0} -eq 1 ]; then
for i in execd monitord; do
/etc/init.d/cf-${i} restart
done
else
2011-10-06 17:21:12 +02:00
:
2012-02-08 16:13:48 +01:00
fi
2011-10-06 17:21:12 +02:00
%endif
/sbin/ldconfig
2007-01-16 00:06:50 +01:00
2012-01-24 15:32:07 +01:00
%preun server
2012-02-08 13:40:10 +01:00
%if 0%{?suse_version}
2012-01-24 15:32:07 +01:00
%stop_on_removal cf-serverd
2012-02-08 13:40:10 +01:00
%else
/etc/init.d/cf-serverd stop
%endif
2012-01-24 15:32:07 +01:00
%postun server
2012-02-08 13:40:10 +01:00
%if 0%{?suse_version}
2012-01-24 15:32:07 +01:00
%restart_on_update cf-serverd
2012-02-08 13:40:10 +01:00
%else
2012-02-08 16:13:48 +01:00
# Update ?
if [ ${1:-0} -eq 1 ]; then
/etc/init.d/cf-serverd restart
else
:
fi
2012-02-08 13:40:10 +01:00
%endif
2012-01-24 15:32:07 +01:00
2012-10-04 10:52:41 +02:00
%endif # !systemd
2011-10-06 17:21:12 +02:00
%post -n %{libsoname} -p /sbin/ldconfig
%postun -n %{libsoname} -p /sbin/ldconfig
2007-11-21 22:09:52 +01:00
2007-01-16 00:06:50 +01:00
%files
%defattr (-,root,root)
2012-10-04 10:52:41 +02:00
%doc LICENSE
%doc README
2012-10-05 14:21:25 +02:00
%doc ChangeLog
%{_sbindir} /cf-agent
%{_sbindir} /cf-execd
%{_sbindir} /cf-key
%{_sbindir} /cf-monitord
%{_sbindir} /cf-promises
%{_sbindir} /cf-report
%{_sbindir} /cf-runagent
2012-11-29 09:18:22 +01:00
%{_sbindir} /rpmvercmp
2012-10-04 10:52:41 +02:00
%if 0%{?suse_version} >= 1210
%_unitdir /cf-execd.service
%_unitdir /cf-monitord.service
%else
%exclude /etc/init.d/cf-serverd
%config %attr (0755,root,root) /etc/init.d/*
2012-10-05 14:43:48 +02:00
%{_sbindir} /rccf-execd
%{_sbindir} /rccf-monitord
2012-10-04 10:52:41 +02:00
%endif
2008-09-12 23:31:39 +02:00
%{_mandir} /man?/*
2012-01-30 20:10:38 +01:00
%dir %{basedir}
2012-10-08 15:04:19 +02:00
/var/%{name}
2012-01-30 20:10:38 +01:00
%exclude %{basedir} /backup
%exclude %{basedir} /config
#%exclude %{basedir}/failsafe
2012-10-08 15:04:19 +02:00
%dir %{_datadir} /%{name}
%{_datadir} /%{name} /*
%dir %{workdir}
%{workdir} /*
%exclude %{workdir} /bin/cf-serverd
2012-01-30 20:10:38 +01:00
%config (noreplace) /etc/cron.d/%{name}
2011-10-06 17:21:12 +02:00
2012-10-08 15:04:19 +02:00
%dir %{basedir} /masterfiles
%config (noreplace) %{basedir} /masterfiles/*.cf
2011-10-06 17:21:12 +02:00
%files -n %{libsoname}
%defattr (-,root,root)
2012-10-05 14:21:25 +02:00
%dir %{_libdir} /%{name}
%{_libdir} /%{name} /%{libname} .so.*
2011-10-06 17:21:12 +02:00
%files devel
%defattr (-,root,root)
2012-10-05 14:21:25 +02:00
%{_libdir} /%{name} /%{libname} .so
2011-10-06 17:21:12 +02:00
%files doc
%defattr (-,root,root)
2012-10-05 14:21:25 +02:00
%dir %{_datadir} /doc/%{name}
%{_datadir} /doc/%{name} /*
2007-11-26 20:28:30 +01:00
2012-01-24 15:32:07 +01:00
%files server
%defattr (-,root,root)
2012-01-30 20:10:38 +01:00
%{basedir} /backup
%{basedir} /config
2012-10-05 14:21:25 +02:00
%{_sbindir} /cf-serverd
2012-10-08 15:04:19 +02:00
%{workdir} /bin/cf-serverd
2012-10-04 10:52:41 +02:00
%if 0%{?suse_version} >= 1210
%_unitdir /cf-serverd.service
%else
2012-01-24 15:32:07 +01:00
/etc/init.d/cf-serverd
2012-10-05 14:43:48 +02:00
%{_sbindir} /rccf-serverd
2012-10-04 10:52:41 +02:00
%endif
2012-01-24 15:32:07 +01:00
2007-04-01 12:04:29 +02:00
%changelog