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
#
2020-02-03 13:20:07 +01:00
# Copyright (c) 2020 SUSE LLC
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.
2019-12-16 14:49:02 +01:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2007-01-16 00:06:50 +01:00
#
2015-03-18 15:27:40 +01:00
%define libname libpromises
%define libsoname %{libname}3
2012-10-08 15:04:19 +02:00
# Yes, its not FHS conformant but in sync with cfengine documentation
2012-12-14 09:31:14 +01:00
# reported upstream as https://cfengine.com/dev/issues/1896
2015-03-17 14:41:48 +01:00
%define basedir %{_localstatedir}/%{name}
2012-10-08 15:04:19 +02:00
%define workdir %{basedir}
2020-02-11 08:09:36 +01:00
# This is the place where workdir should be
#define basedir /var/lib/%%{name}
#define workdir %%{basedir}/work
2019-07-24 15:29:45 +02:00
%if 0%{?suse_version} <= 150100
%define with_sfw2 1
%else
%define with_sfw2 0
%endif
2015-03-18 15:27:40 +01:00
# pass --with-bla to enable the build
%bcond_with mysql
%bcond_with postgresql
%bcond_with libvirt
2020-02-11 08:09:36 +01:00
2015-03-17 14:41:48 +01:00
Name : cfengine
2019-12-16 14:49:02 +01:00
Version : 3.14.0.2
2015-03-17 14:41:48 +01:00
Release : 0
2017-06-28 13:38:23 +02:00
Summary : Configuration management framework
2018-06-19 12:58:23 +02:00
License : GPL-3.0-only
2007-01-16 00:06:50 +01:00
Group : Productivity/Networking/System
2019-12-16 14:49:02 +01:00
URL : http://www.cfengine.org/
2019-03-15 10:35:55 +01:00
Source : https://cfengine-package-repos.s3.amazonaws.com/tarballs/cfengine-%{version} .tar.gz
2014-04-03 15:11:06 +02:00
Source1 : %{name} .SuSEfirewall2
2017-12-12 07:37:19 +01:00
Source2 : cf-execd.service
Source3 : cf-monitord.service
Source4 : cf-serverd.service
Source5 : cf-monitord
Source6 : cf-execd
Source7 : cf-serverd
2012-01-30 20:10:38 +01:00
Source10 : %{name} .cron
2013-05-15 13:58:34 +02:00
Source11 : %{name} -rpmlintrc
2014-02-21 01:13:10 +01:00
# docs
Source101 : http://www.cfengine.org/manuals/cf3-Reference.pdf
Source102 : http://www.cfengine.org/manuals/cf3-conceptguide.pdf
Source103 : http://www.cfengine.org/manuals/cf3-glossary.pdf
Source104 : http://www.cfengine.org/manuals/cf3-quickstart.pdf
Source105 : http://www.cfengine.org/manuals/cf3-solutions.pdf
Source106 : http://www.cfengine.org/manuals/cf3-tutorial.pdf
Source107 : http://www.verticalsysadmin.com/cfengine/primer.pdf
2016-12-29 10:56:49 +01:00
2014-05-02 14:07:23 +02:00
# PATCH-FIX-SUSE
2017-08-11 19:49:23 +02:00
# set cfengine's notion of bindir to /usr/bin instead of /var/cfengine/bin
2014-05-02 14:07:23 +02:00
# kkaempf@suse.de
2019-12-16 14:49:02 +01:00
#Patch1: 0001-Set-sys.bindir-to-usr-sbin-expect-cf-components-ther.patch
2016-12-29 10:56:49 +01:00
# PATCH-FIX-UPSTREAM add 'suse' class for consistency with other vendor classes
# PATCH-FEATURE-UPSTREAM better /etc/SuSE-release parsing, upstream #5423
# kkaempf@suse.de
2019-12-16 14:49:02 +01:00
Patch2 : 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch
2018-07-03 10:05:49 +02:00
# PATCH-FIX-SUSE reduce "string truncated" (in strncpy) warnings
2019-12-16 14:49:02 +01:00
Patch3 : 0002-Reduce-string-truncation-warnings.patch
2018-07-03 10:05:49 +02:00
# PATCH-FIX-SUSE BNC#1016848, adam.majer
2019-12-16 14:49:02 +01:00
Patch10 : 0003-make-home-dir-for-tests.patch
- Update to 3.7.0
See https://github.com/cfengine/core/blob/3.7.x/ChangeLog for
full changelog
New features:
- New package promise implementation.
The syntax is much simpler, to try it out, check out the syntax:
packages:
"mypackage"
policy => "absent/present",
# Optional, default taken from common control
package_module => apt_get,
# Optional, will only match exact version. May be
# "latest".
version => "32.0",
# Optional.
architecture => "x86_64";
- Full systemd support for all relevant platforms
- New classes to determine whether certain features are enabled:
* feature_yaml
* feature_xml
For the official CFEngine packages, these are always enabled, but
packages from other sources may be built without the support.
- New readdata() support for generic data input (CSV, YAML, JSON, or auto)
- YAML support: new readyaml() function and in readdata()
- CSV support: new readcsv() function and in readdata()
- New string_mustache() function
- New data_regextract() function
- eval() can now be called with "class" as the "mode" argument, which
will cause it to return true ("any") if the calculated result is
non-zero, and false ("!any") if it is zero.
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=131
2015-07-30 12:12:28 +02:00
2011-10-06 17:21:12 +02:00
BuildRequires : bison
BuildRequires : db-devel
BuildRequires : flex
2015-03-17 14:41:48 +01:00
BuildRequires : libacl-devel
2011-10-06 17:21:12 +02:00
BuildRequires : libtool
2012-10-05 14:21:25 +02:00
BuildRequires : libxml2-devel
2016-02-01 15:28:47 +01:00
BuildRequires : lmdb-devel >= 0.9.17
BuildRequires : openssl-devel >= 1.0.2e
2014-02-03 19:31:18 +01:00
BuildRequires : pam-devel
2016-02-01 15:28:47 +01:00
BuildRequires : pcre-devel >= 8.38
2017-03-31 09:43:07 +02:00
# for flock
BuildRequires : util-linux
2018-07-03 10:05:49 +02:00
# for llzma
BuildRequires : xz-devel
2015-03-17 14:41:48 +01:00
Requires : %{libsoname} = %{version}
2015-03-18 15:27:40 +01:00
%if %{with mysql}
2011-10-06 17:21:12 +02:00
BuildRequires : mysql-devel
2012-10-05 14:43:48 +02:00
%endif
2015-03-18 15:27:40 +01:00
%if %{with libvirt}
2013-04-26 11:21:54 +02:00
BuildRequires : libvirt-devel
2014-07-03 15:41:44 +02:00
%endif
2015-03-18 15:27:40 +01:00
%if %{with postgresql}
2011-10-06 17:21:12 +02:00
BuildRequires : postgresql-devel
2014-07-03 15:41:44 +02:00
%endif
2020-02-03 13:20:07 +01:00
BuildRequires : pkgconfig(systemd)
2012-10-04 10:52:41 +02:00
%{?systemd_requires}
2015-06-17 15:29:35 +02:00
BuildRequires : fdupes
2015-06-17 17:20:39 +02:00
%if 0%{?fedora_version} == 20
2015-06-17 16:22:50 +02:00
BuildRequires : perl-Exporter
%endif
2015-06-17 15:29:35 +02:00
2007-01-16 00:06:50 +01:00
%description
2017-06-28 13:38:23 +02:00
CFEngine is the core of a configuration management system. It
combines modeling and monitoring to move a system into compliance
with a user-defined model (the Desired State). A domain-specific
language is used for setting this up.
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
2014-03-19 19:23:19 +01:00
Provides : %{libname} 1 = %{version}
Obsoletes : %{libname} 1 < %{version}
2011-10-06 17:21:12 +02:00
%description -n %{libsoname}
This package contains the shared libpromises (cfengine) library.
2013-12-11 08:28:27 +01:00
%package -n %{libname}-devel
Summary : Development package for libpromises
2011-10-06 17:21:12 +02:00
Group : Development/Libraries/C and C++
Requires : %{libsoname} = %{version}
Requires : glibc-devel
2015-03-17 14:41:48 +01:00
Provides : %{name} -devel = %{version}
Obsoletes : %{name} -devel < %{version}
2007-01-16 00:06:50 +01:00
2013-12-11 08:28:27 +01:00
%description -n %{libname}-devel
2017-06-28 13:38:23 +02:00
A character set detection library.
2015-03-17 14:41:48 +01:00
2011-10-06 17:21:12 +02:00
This package contains the files needed to compile programs that use the
2013-12-11 08:28:27 +01:00
libpromises library.
2011-10-06 17:21:12 +02:00
%package doc
2017-06-28 13:38:23 +02:00
Summary : Documentation for CFEngine, a config management framework
2014-02-04 08:10:43 +01:00
Group : Documentation/Other
2020-06-12 16:33:32 +02:00
BuildArch : noarch
2011-10-06 17:21:12 +02:00
%description doc
2017-06-28 13:38:23 +02:00
Documentation for cfengine.
2007-01-16 00:06:50 +01:00
2014-02-04 08:10:43 +01:00
%package examples
Summary : CFEngine example promises
Group : Documentation/Other
2020-06-12 16:33:32 +02:00
BuildArch : noarch
2014-02-04 08:10:43 +01:00
%description examples
2017-06-28 13:38:23 +02:00
Lots of example promises for CFEngine.
2014-02-04 08:10:43 +01:00
2007-01-16 00:06:50 +01:00
%prep
2019-12-16 14:49:02 +01:00
%setup -q -n core-3.14.0-2
2013-08-02 10:46:05 +02:00
%patch2 -p1
2017-07-03 11:56:35 +02:00
%patch3 -p1
2016-12-31 10:51:36 +01:00
%patch10 -p1
2013-08-02 10:46:05 +02:00
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
2014-02-21 01:13:10 +01:00
### install extra docs
2015-03-17 14:41:48 +01:00
install -d docs
2014-02-21 01:13:10 +01:00
cp -a $RPM_SOURCE_DIR /*pdf docs/
2007-01-16 00:06:50 +01:00
%build
2016-06-15 14:45:40 +02:00
EXPLICIT_VERSION=%{version} autoreconf -fvi -I m4
2015-03-18 15:27:40 +01:00
CC=cc CFLAGS=" %{optflags} - f n o - s t r i c t - a l i a s i n g " \
2011-10-06 17:21:12 +02:00
%configure \
2012-01-24 15:32:07 +01:00
--disable-static \
2015-03-18 15:32:21 +01:00
--disable-silent-rules \
2012-10-05 14:21:25 +02:00
--enable-fhs \
2012-10-08 15:04:19 +02:00
--datadir=/var \
2013-07-09 09:37:13 +02:00
--with-workdir=%{workdir} \
2015-03-18 15:27:40 +01:00
%if %{with postgresql}
2013-07-09 09:37:13 +02:00
--with-postgresql \
2014-07-03 15:41:44 +02:00
%endif
2015-03-18 15:27:40 +01:00
%if %{with mysql}
2014-02-09 13:02:43 +01:00
--with-mysql \
2014-02-21 01:13:10 +01:00
%endif
2014-02-09 13:02:43 +01:00
--without-qdbm \
--without-tokyocabinet \
--with-lmdb \
2013-07-09 09:37:13 +02:00
--with-pthreads \
--with-openssl \
--with-pcre \
2015-03-18 15:27:40 +01:00
%if %{with libvirt}
2013-07-09 09:37:13 +02:00
--with-libvirt \
2014-07-03 15:41:44 +02:00
%endif
2016-11-16 10:13:16 +01:00
--without-libacl \
2013-08-02 10:46:05 +02:00
--with-libxml2 \
2015-06-18 08:36:54 +02:00
%if 0%{?rhel_version} > 0 && 0%{?rhel_version} < 700
--docdir=%{_docdir} /%{name} -%{version} \
%else
2015-03-18 15:32:21 +01:00
--docdir=%{_docdir} /%{name} \
2015-06-18 08:36:54 +02:00
%endif
2015-03-18 15:32:21 +01:00
--with-pam
2013-08-02 10:46:05 +02:00
2015-03-17 14:41:48 +01:00
make %{?_smp_mflags}
2007-01-16 00:06:50 +01:00
2015-03-18 15:33:46 +01:00
%check
# FAIL: process_test
2017-05-10 14:20:31 +02:00
make check %{?_smp_mflags} || :
2015-03-18 15:33:46 +01:00
2007-01-16 00:06:50 +01:00
%install
2012-12-14 09:30:38 +01:00
chmod -x ChangeLog
2015-03-17 14:41:48 +01:00
make " D E S T D I R = %{buildroot} " install
2014-03-19 19:23:19 +01:00
# will appear in cfengine-examples
rm -rf %{buildroot} /%{_docdir} /%{name} /examples
2017-08-11 19:49:23 +02:00
install -d %{buildroot} /{%{_bindir} ,%{_sbindir} ,%{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
2015-03-17 14:41:48 +01:00
install -d %{buildroot} /%{basedir} /{backup,failsafe,config,plugins}
2012-01-30 20:10:38 +01:00
2017-05-10 14:19:59 +02:00
# systemd: install sample cron file in docdir
cp %{SOURCE10} %{buildroot} /%{_docdir} /%{name}
2012-01-30 20:10:38 +01:00
2012-10-04 10:52:41 +02:00
# install systemd scripts
2017-12-12 08:42:35 +01:00
install -d %{buildroot} %{_unitdir}
2017-12-12 07:37:19 +01:00
install -m 0644 %{SOURCE2} %{SOURCE3} %{SOURCE4} %{buildroot} /%{_unitdir}
2015-03-18 15:27:40 +01:00
ln -s -f service %{buildroot} /%{_sbindir} /rccf-monitord
ln -s -f service %{buildroot} /%{_sbindir} /rccf-execd
ln -s -f service %{buildroot} /%{_sbindir} /rccf-serverd
2012-01-24 15:32:07 +01:00
2017-08-11 19:49:23 +02:00
# create symlinks for bin_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
2014-04-04 21:37:14 +02:00
for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd cf-upgrade; do
2017-08-11 19:49:23 +02:00
ln -s -f ../../..%{_bindir} /${i} %{buildroot} %{workdir} /bin/${i}
2012-10-08 15:04:19 +02:00
done
2012-10-05 14:21:25 +02:00
rm -rf %{buildroot} /%{_libdir} /%{name} /libpromises.la
2011-10-06 17:21:12 +02:00
2012-12-14 09:30:38 +01: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
2014-03-19 19:23:19 +01:00
# create man pages, see https://cfengine.com/dev/issues/2989
2015-03-17 14:41:48 +01:00
install -d %{buildroot} /%{_mandir} /man8
2014-03-19 19:23:19 +01:00
for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd
do
2017-08-11 19:49:23 +02:00
LD_LIBRARY_PATH=%{buildroot} %{_libdir} /%{name} %{buildroot} %{_bindir} /$i -M > %{buildroot} %{_mandir} /man8/$i.8
2017-07-03 11:56:35 +02:00
gzip -n9 %{buildroot} %{_mandir} /man8/$i.8
2014-03-19 19:23:19 +01:00
done
2015-03-18 15:27:40 +01:00
# Firewall
2019-07-24 15:29:45 +02:00
%if %{with_sfw2}
2015-03-17 14:41:48 +01:00
install -D -m 644 %{SOURCE1} %{buildroot} %{_sysconfdir} /sysconfig/SuSEfirewall2.d/services/cfengine
2019-07-24 15:29:45 +02:00
%endif
2014-04-03 15:11:06 +02:00
2015-03-18 15:27:40 +01:00
# Ckeabyo dyoes
2015-03-17 14:41:48 +01:00
%fdupes %{buildroot} %{_datadir} /cfengine
2014-04-04 21:37:14 +02:00
2012-10-04 10:52:41 +02:00
%pre
2014-04-04 21:37:14 +02:00
%service_add_pre cf-execd.service cf-monitord.service cf-serverd.service
2012-10-04 10:52:41 +02:00
%post
2014-04-04 21:37:14 +02:00
%service_add_post cf-execd.service cf-monitord.service cf-serverd.service
2013-04-26 11:21:54 +02:00
if [ $1 -lt 2 ]; then
2014-04-04 21:37:14 +02:00
# first install, generate key pair
2013-04-16 12:12:34 +02:00
cf-key
2013-04-26 11:21:54 +02:00
fi
2012-10-04 10:52:41 +02:00
%preun
2014-04-04 21:37:14 +02:00
%service_del_preun cf-execd.service cf-monitord.service cf-serverd.service
2012-10-04 10:52:41 +02:00
%postun
2014-04-04 21:37:14 +02:00
%service_del_postun cf-execd.service cf-monitord.service cf-serverd.service
if [ $1 -eq 0 ]; then
# clean up inputs cache dir on removal
rm -rf %{basedir} /inputs/*
fi
2012-10-04 10:52:41 +02:00
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)
2018-06-19 13:00:02 +02:00
%doc ChangeLog README.md
%license LICENSE
2017-08-11 19:49:23 +02:00
%{_bindir} /cf-agent
2019-03-15 10:35:55 +01:00
%{_bindir} /cf-check
2017-08-11 19:49:23 +02:00
%{_bindir} /cf-execd
%{_bindir} /cf-key
%{_bindir} /cf-net
%{_bindir} /cf-monitord
%{_bindir} /cf-promises
%{_bindir} /cf-serverd
%{_bindir} /cf-upgrade
%{_bindir} /cf-runagent
%{_bindir} /rpmvercmp
2015-03-17 14:41:48 +01:00
%{_unitdir} /cf-execd.service
%{_unitdir} /cf-monitord.service
%{_unitdir} /cf-serverd.service
2012-10-05 14:43:48 +02:00
%{_sbindir} /rccf-execd
%{_sbindir} /rccf-monitord
2014-04-04 21:37:14 +02:00
%{_sbindir} /rccf-serverd
2019-07-24 15:29:45 +02:00
%if %{with_sfw2}
2014-04-04 21:37:14 +02:00
%config %{_sysconfdir} /sysconfig/SuSEfirewall2.d/services/cfengine
2019-07-24 15:29:45 +02:00
%endif
2014-03-19 19:23:19 +01:00
%{_mandir} /man8/*
2012-01-30 20:10:38 +01:00
%dir %{basedir}
2012-10-08 15:04:19 +02:00
%dir %{workdir}
%{workdir} /*
2017-02-03 10:23:39 +01:00
%{_docdir} /%{name} /cfengine.cron
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
2013-12-11 08:28:27 +01:00
%files -n %{libname}-devel
2011-10-06 17:21:12 +02:00
%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)
2014-02-21 01:13:10 +01:00
%doc docs/*.pdf
2014-02-04 08:10:43 +01:00
%files examples
%defattr (-,root,root)
2014-02-21 01:13:10 +01:00
%doc examples/*cf
2007-11-26 20:28:30 +01:00
2007-04-01 12:04:29 +02:00
%changelog