From 04203f2cf0de089035db8e64155d553e9c055b02c06ff93b91376b57796f1f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Mon, 3 Feb 2014 18:31:18 +0000 Subject: [PATCH 01/26] - Upgrade to 3.6.0b1 - New promise type "users" for managing local user accounts. - TLS authentication and fully encrypted network protocol - New attributes in 'bundle server access_rules' - New variable type 'data' for handling of structured data - Tagging of classes and variables with meta data - Many new built-in variables - Many new functions - Replace tokyocabinet with lmdb database OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=66 --- cfengine-3.5.3.tar.gz | 3 --- cfengine-3.6.0b1.tar.gz | 3 +++ cfengine.changes | 14 ++++++++++++++ cfengine.spec | 27 ++++++++++++++++++--------- masterfiles-3.6.0b1.tar.gz | 3 +++ 5 files changed, 38 insertions(+), 12 deletions(-) delete mode 100644 cfengine-3.5.3.tar.gz create mode 100644 cfengine-3.6.0b1.tar.gz create mode 100644 masterfiles-3.6.0b1.tar.gz diff --git a/cfengine-3.5.3.tar.gz b/cfengine-3.5.3.tar.gz deleted file mode 100644 index 71f14be..0000000 --- a/cfengine-3.5.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e2d13ba1d75f826bf15411912ce21075734796a35e8fb8ecf545d70d60f41e1 -size 1542468 diff --git a/cfengine-3.6.0b1.tar.gz b/cfengine-3.6.0b1.tar.gz new file mode 100644 index 0000000..e37098f --- /dev/null +++ b/cfengine-3.6.0b1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d4208a2459a17bd108a059c5fd3fb8dd3ce965ae764b81d8fd187193a1dae6a +size 1338409 diff --git a/cfengine.changes b/cfengine.changes index 25e4b03..484ff13 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Mon Feb 3 18:30:23 UTC 2014 - kkaempf@suse.com + +- Upgrade to 3.6.0b1 + - New promise type "users" for managing local user accounts. + - TLS authentication and fully encrypted network protocol + - New attributes in 'bundle server access_rules' + - New variable type 'data' for handling of structured data + - Tagging of classes and variables with meta data + - Many new built-in variables + - Many new functions + + - Replace tokyocabinet with lmdb database + ------------------------------------------------------------------- Wed Dec 11 07:25:59 UTC 2013 - kkaempf@suse.com diff --git a/cfengine.spec b/cfengine.spec index a4b9c71..9df45fc 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -1,7 +1,7 @@ # # spec file for package cfengine # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 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 @@ -17,6 +17,7 @@ Name: cfengine +%define srcname core %define libname libpromises %define libsoname %{libname}3 @@ -28,10 +29,11 @@ Name: cfengine Summary: CFEngine automates large-scale IT computing infrastructure License: GPL-3.0 Group: Productivity/Networking/System -Version: 3.5.3 +Version: 3.6.0b1 Release: 0 Url: http://www.cfengine.org/ Source: %{name}-%{version}.tar.gz + # there's no /usr/include/acl.h in SUSE or Fedora, kkaempf@suse.de Patch1: libacl-headers.patch # SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, kkaempf@suse.de @@ -58,13 +60,16 @@ Source9: cf-serverd %endif Source10: %{name}.cron Source11: %{name}-rpmlintrc +Source12: masterfiles-%{version}.tar.gz + BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: db-devel BuildRequires: flex -BuildRequires: libtokyocabinet-devel BuildRequires: libtool BuildRequires: libxml2-devel +BuildRequires: lmdb-devel +BuildRequires: pam-devel # # Disable mysql for SLE_11: # @@ -160,7 +165,7 @@ This package contains the files of the cfengine server. %prep -%setup -q -n %{name}-%{version} +%setup -q -n %{srcname}-%{version} %if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel_version} %patch1 -p1 %endif @@ -251,9 +256,12 @@ 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 +tar xf %{S:12} +cd masterfiles-%{version} +make install DESTDIR=%{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 rm -rf %{buildroot}/%{_libdir}/%{name}/libpromises.la @@ -380,6 +388,7 @@ fi %{_sbindir}/cf-monitord %{_sbindir}/cf-promises %{_sbindir}/cf-runagent +%{_sbindir}/cf-upgrade %{_sbindir}/rpmvercmp %if 0%{?suse_version} >= 1210 %_unitdir/cf-execd.service @@ -398,8 +407,8 @@ fi %exclude %{basedir}/config #%%exclude %%{basedir}/failsafe -%dir %{_datadir}/%{name} -%{_datadir}/%{name}/* +# %dir %{_datadir}/%{name} +# %{_datadir}/%{name}/* %dir %{workdir} %{workdir}/* diff --git a/masterfiles-3.6.0b1.tar.gz b/masterfiles-3.6.0b1.tar.gz new file mode 100644 index 0000000..ca0f81e --- /dev/null +++ b/masterfiles-3.6.0b1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:276b760241cd722801f79db163f2d4c7477a89af2338e03509c0005629c4f9d2 +size 167598 From 404a42c4d2ae45d334b6c0474329c3782d44c0b166a647be7acbd124f2cd94e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Tue, 4 Feb 2014 07:10:43 +0000 Subject: [PATCH 02/26] fix build OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=67 --- cfengine.spec | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/cfengine.spec b/cfengine.spec index 9df45fc..5573643 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -144,7 +144,7 @@ libpromises library. %package doc Summary: CFEngine automates large-scale IT computing infrastructure - documentation -Group: Productivity/Networking/System +Group: Documentation/Other %if 0%{?rhel_version} || 0%{?centos_version} BuildRequires: tetex BuildRequires: tetex-dvips @@ -155,6 +155,13 @@ BuildRequires: texinfo %description doc Full documentation for cfengine +%package examples +Summary: CFEngine example promises +Group: Documentation/Other + +%description examples +Lots of examples promises for CFEngine. + %package server Summary: CFEngine automates large-scale IT computing infrastructure - server Group: Productivity/Networking/System @@ -245,8 +252,8 @@ sed -i\ %endif # install docs -%{__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} +%{__install} -d %{buildroot}/%{_docdir}/%{name} +%{__install} -m 0644 %{S:1} %{S:2} %{S:3} %{S:4} %{S:5} %{S:6} %{buildroot}/%{_docdir}/%{name} # create symlinks for sbin_PROGRAMS # because: cf-promises needs to be installed in /var/cfengine/work/bin for pre-validation of full configuration @@ -303,11 +310,11 @@ fi %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 +#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 @@ -382,6 +389,8 @@ fi %doc LICENSE # %doc README %doc ChangeLog +%exclude %{_docdir}/%{name}/examples +%exclude %{_docdir}/%{name}/*.pdf %{_sbindir}/cf-agent %{_sbindir}/cf-execd %{_sbindir}/cf-key @@ -430,8 +439,13 @@ fi %files doc %defattr(-,root,root) -%dir %{_datadir}/doc/%{name} -%{_datadir}/doc/%{name}/* +%doc %{_docdir}/%{name}/*.pdf +%exclude %{_docdir}/%{name}/examples + +%files examples +%defattr(-,root,root) +%dir %{_docdir}/%{name}/examples +%doc %{_docdir}/%{name}/examples %files server %defattr(-,root,root) From dec81046202f7780bb6dbf8a04c0f85d2d39db3b3591a64007b0d536c06d0504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Tue, 4 Feb 2014 07:11:07 +0000 Subject: [PATCH 03/26] - split off -examples sub-package OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=68 --- cfengine.changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cfengine.changes b/cfengine.changes index 484ff13..0735a63 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Feb 4 07:10:49 UTC 2014 - kkaempf@suse.com + +- split off -examples sub-package + ------------------------------------------------------------------- Mon Feb 3 18:30:23 UTC 2014 - kkaempf@suse.com From 07323632ae7f739487479cce14a43ba9c9026c513fcb84ce186403115ae1a657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Tue, 4 Feb 2014 11:35:26 +0000 Subject: [PATCH 04/26] use upstream released tarball OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=69 --- cfengine-3.6.0b1.tar.gz | 4 ++-- cfengine.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cfengine-3.6.0b1.tar.gz b/cfengine-3.6.0b1.tar.gz index e37098f..28156c7 100644 --- a/cfengine-3.6.0b1.tar.gz +++ b/cfengine-3.6.0b1.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5d4208a2459a17bd108a059c5fd3fb8dd3ce965ae764b81d8fd187193a1dae6a -size 1338409 +oid sha256:597c47bfebf7b6b25e65a790ab2782efc624fc7aa727066ffa7f68e37bd11bdd +size 1787137 diff --git a/cfengine.spec b/cfengine.spec index 5573643..d8545ce 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -17,7 +17,7 @@ Name: cfengine -%define srcname core +%define srcname %{name} %define libname libpromises %define libsoname %{libname}3 From 10b6742df977fc8fb51d1e79c8af719bf4936e8646e2e1de70d5120d79a59c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Sun, 9 Feb 2014 12:02:43 +0000 Subject: [PATCH 05/26] build against lmdb OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=70 --- cfengine.spec | 6 +++++- primer.pdf | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 primer.pdf diff --git a/cfengine.spec b/cfengine.spec index d8545ce..2c24e6f 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -61,6 +61,7 @@ Source9: cf-serverd Source10: %{name}.cron Source11: %{name}-rpmlintrc Source12: masterfiles-%{version}.tar.gz +Source13: http://www.verticalsysadmin.com/cfengine/primer.pdf BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison @@ -196,10 +197,13 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ %configure \ --disable-static \ --enable-fhs \ - --with-libxml2 \ --datadir=/var \ --with-workdir=%{workdir} \ --with-postgresql \ + --with-mysql \ + --without-qdbm \ + --without-tokyocabinet \ + --with-lmdb \ --with-pthreads \ --with-openssl \ --with-pcre \ diff --git a/primer.pdf b/primer.pdf new file mode 100644 index 0000000..e026b4d --- /dev/null +++ b/primer.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf1a0385d355136810cd278ab70033c7402fc31437c763305c1836f7690813ad +size 23415 From bb2763a1a4728b2792bab19fbeb4fe97f5174d21b9b1106a5dd4a4dbcd148123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Sun, 9 Feb 2014 12:03:12 +0000 Subject: [PATCH 06/26] - use lmdb instead of tokyocabinet - add primer.pdf OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=71 --- cfengine.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cfengine.changes b/cfengine.changes index 0735a63..05311b1 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Feb 9 12:02:45 UTC 2014 - kkaempf@suse.com + +- use lmdb instead of tokyocabinet +- add primer.pdf + ------------------------------------------------------------------- Tue Feb 4 07:10:49 UTC 2014 - kkaempf@suse.com From bf6e1ab870d230d8ca05408d07a0cd4f63c302f9fd1807494713a4539c787ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Sun, 9 Feb 2014 12:07:50 +0000 Subject: [PATCH 07/26] require libpromises3 explicitly OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=72 --- cfengine.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cfengine.spec b/cfengine.spec index 2c24e6f..917ad44 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -107,6 +107,8 @@ BuildRequires: systemd BuildRequires: fdupes %endif +Requires: %{libsoname} = %{version} + %description CFEngine is the core of a configuration management system: ensuring the availability, security and compliance of mission-critical From 1abcaf4097c15bab0c05c13ba168a3d62a6dc50c47f3f5bc64aab2f5a9b862ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Sun, 9 Feb 2014 18:58:26 +0000 Subject: [PATCH 08/26] add primer.pdf OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=73 --- cfengine.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cfengine.spec b/cfengine.spec index 917ad44..8140f18 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -259,7 +259,7 @@ sed -i\ # install docs %{__install} -d %{buildroot}/%{_docdir}/%{name} -%{__install} -m 0644 %{S:1} %{S:2} %{S:3} %{S:4} %{S:5} %{S:6} %{buildroot}/%{_docdir}/%{name} +%{__install} -m 0644 %{S:1} %{S:2} %{S:3} %{S:4} %{S:5} %{S:6} %{S:13} %{buildroot}/%{_docdir}/%{name} # create symlinks for sbin_PROGRAMS # because: cf-promises needs to be installed in /var/cfengine/work/bin for pre-validation of full configuration From 219fbac8e4f35a342505d2ef30020ed7f4547a109f9b25299a1ef8525444288a Mon Sep 17 00:00:00 2001 From: Christian Wittmer Date: Fri, 21 Feb 2014 00:13:10 +0000 Subject: [PATCH 09/26] Accepting request 223319 from home:computersalat:devel:sysmgmnt fix build for SLES OBS-URL: https://build.opensuse.org/request/show/223319 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=74 --- cfengine-bootstrap.patch | 22 ++++++++++++++++ cfengine.changes | 18 ++++++++++++- cfengine.spec | 57 +++++++++++++++++++++------------------- libacl-headers.patch | 9 ++++--- 4 files changed, 74 insertions(+), 32 deletions(-) create mode 100644 cfengine-bootstrap.patch diff --git a/cfengine-bootstrap.patch b/cfengine-bootstrap.patch new file mode 100644 index 0000000..7ee18fe --- /dev/null +++ b/cfengine-bootstrap.patch @@ -0,0 +1,22 @@ +Index: libpromises/bootstrap.c +=================================================================== +--- libpromises/bootstrap.c.orig ++++ libpromises/bootstrap.c +@@ -332,7 +332,7 @@ bool WriteBuiltinFailsafePolicyToPath(co + " handle => \"cfe_internal_bootstrap_update_files_sys_workdir_inputs_not_windows\",\n" + #ifdef __MINGW32__ + // This section is needed because Windows attempts to copy from "C:\Program Files\Cfengine\masterfiles". +- " copy_from => u_scp(\"/var/cfengine/masterfiles\"),\n" ++ " copy_from => u_scp(\"$(sys.workdir)/masterfiles\"),\n" + #else + " copy_from => u_scp(\"$(sys.masterdir)\"),\n" + #endif /* !__MINGW32__ */ +@@ -344,7 +344,7 @@ bool WriteBuiltinFailsafePolicyToPath(co + " handle => \"cfe_internal_bootstrap_update_files_sys_workdir_inputs_windows\",\n" + #ifdef __MINGW32__ + // This section is needed because Windows attempts to copy from "C:\Program Files\Cfengine\masterfiles". +- " copy_from => u_scp(\"/var/cfengine/masterfiles\"),\n" ++ " copy_from => u_scp(\"$(sys.workdir)/masterfiles\"),\n" + #else + " copy_from => u_scp(\"$(sys.masterdir)\"),\n" + #endif /* !__MINGW32__ */ diff --git a/cfengine.changes b/cfengine.changes index 05311b1..6696f1b 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Feb 20 23:54:22 UTC 2014 - chris@computersalat.de + +- merge with my last (not committed changes) + * bootstrap patch +- fix changes file + * update 3.0.4b2 -> 3.4.0b2 +- fix docs install +- fix build for SLE_11 (MySQL connector: disabled) + ------------------------------------------------------------------- Sun Feb 9 12:02:45 UTC 2014 - kkaempf@suse.com @@ -302,7 +312,7 @@ Thu Oct 4 08:48:10 UTC 2012 - kkaempf@suse.com - support systemd where applicable -- update to 3.0.4b2 +- update to 3.4.0b2 New features: - XML editing capabilities. See the documentation for edit_xml body. Note the new dependency: libxml2. @@ -341,6 +351,12 @@ Thu Oct 4 08:48:10 UTC 2012 - kkaempf@suse.com easier to run from systemd, launchd and other supervision systems. +------------------------------------------------------------------- +Wed Mar 7 13:02:30 UTC 2012 - chris@computersalat.de + +- add bootstrap patch + * set correct "workdir" + ------------------------------------------------------------------- Wed Feb 15 13:49:18 UTC 2012 - chris@computersalat.de diff --git a/cfengine.spec b/cfengine.spec index 8140f18..1336e0d 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -25,6 +25,9 @@ Name: cfengine # reported upstream as https://cfengine.com/dev/issues/1896 %define basedir /var/%{name} %define workdir %{basedir} +# This is the place where workdir should be +#define basedir /var/lib/%{name} +#define workdir %{basedir}/work Summary: CFEngine automates large-scale IT computing infrastructure License: GPL-3.0 @@ -34,17 +37,6 @@ Release: 0 Url: http://www.cfengine.org/ Source: %{name}-%{version}.tar.gz -# there's no /usr/include/acl.h in SUSE or Fedora, kkaempf@suse.de -Patch1: libacl-headers.patch -# SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, kkaempf@suse.de -Patch2: remove-am_subst_notmake.patch - -Source1: http://www.cfengine.org/manuals/cf3-Reference.pdf -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 # wtf? SLE_11 does not honor rpmlintrc %if 0%{?suse_version} <= 1130 BuildRequires: -post-build-checks @@ -61,7 +53,21 @@ Source9: cf-serverd Source10: %{name}.cron Source11: %{name}-rpmlintrc Source12: masterfiles-%{version}.tar.gz -Source13: http://www.verticalsysadmin.com/cfengine/primer.pdf +# 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 + +# FIX-4-UPSTREAM: fix workdir while bootstrapping +Patch0: %{name}-bootstrap.patch +# there's no /usr/include/acl.h in SUSE or Fedora, kkaempf@suse.de +Patch1: libacl-headers.patch +# SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, kkaempf@suse.de +Patch2: remove-am_subst_notmake.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison @@ -176,10 +182,11 @@ This package contains the files of the cfengine server. %prep %setup -q -n %{srcname}-%{version} +%patch0 %if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel_version} -%patch1 -p1 +%patch1 %endif -%if 0%{?suse_version} > 0 && 0%{?suse_version} <= 1110 +%if 0%{?suse_version} <= 1110 %patch2 -p1 %endif %if 0%{?rhel_version} >= 500 && 0%{?rhel_version} < 600 @@ -192,6 +199,10 @@ This package contains the files of the cfengine server. ### 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|' {} \; +### install extra docs +%{__install} -d docs +cp -a $RPM_SOURCE_DIR/*pdf docs/ + %build autoreconf -fi # /usr/include/sys for acl.h @@ -202,7 +213,9 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ --datadir=/var \ --with-workdir=%{workdir} \ --with-postgresql \ +%if 0%{?suse_version} != 1110 --with-mysql \ +%endif --without-qdbm \ --without-tokyocabinet \ --with-lmdb \ @@ -257,10 +270,6 @@ sed -i\ %{buildroot}/etc/init.d/cf-* %{buildroot}/etc/cron.d/%{name} %endif -# install docs -%{__install} -d %{buildroot}/%{_docdir}/%{name} -%{__install} -m 0644 %{S:1} %{S:2} %{S:3} %{S:4} %{S:5} %{S:6} %{S:13} %{buildroot}/%{_docdir}/%{name} - # create symlinks for sbin_PROGRAMS # 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-runagent cf-serverd; do @@ -392,11 +401,7 @@ fi %files %defattr(-,root,root) -%doc LICENSE -# %doc README -%doc ChangeLog -%exclude %{_docdir}/%{name}/examples -%exclude %{_docdir}/%{name}/*.pdf +%doc ChangeLog LICENSE README.md %{_sbindir}/cf-agent %{_sbindir}/cf-execd %{_sbindir}/cf-key @@ -445,13 +450,11 @@ fi %files doc %defattr(-,root,root) -%doc %{_docdir}/%{name}/*.pdf -%exclude %{_docdir}/%{name}/examples +%doc docs/*.pdf %files examples %defattr(-,root,root) -%dir %{_docdir}/%{name}/examples -%doc %{_docdir}/%{name}/examples +%doc examples/*cf %files server %defattr(-,root,root) diff --git a/libacl-headers.patch b/libacl-headers.patch index 49fd5af..a93f1c7 100644 --- a/libacl-headers.patch +++ b/libacl-headers.patch @@ -1,7 +1,8 @@ -diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-cfengine-3.5.0/configure.ac ./configure.ac ---- ../orig-cfengine-3.5.0/configure.ac 2013-06-12 15:09:56.000000000 +0200 -+++ ./configure.ac 2013-07-09 09:11:22.387724353 +0200 -@@ -350,7 +350,7 @@ +Index: configure.ac +=================================================================== +--- configure.ac.orig ++++ configure.ac +@@ -396,7 +396,7 @@ AC_ARG_WITH([libacl], if test "x$with_libacl" != xno; then CF3_WITH_LIBRARY(libacl, [ AC_CHECK_LIB(acl, acl_init, [], [if test "x$with_libacl" != xcheck; then AC_MSG_ERROR(Cannot find libacl library); fi]) From 5bb1965c97593049fd47a6154c5c2eaae5345d79d71dc933d856df24adca72c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Wed, 19 Mar 2014 14:06:37 +0000 Subject: [PATCH 10/26] Accepting request 226604 from home:aeszter:branches:systemsmanagement - fix build for RHEL * MySQL connector: disabled * docs go into versioned directory OBS-URL: https://build.opensuse.org/request/show/226604 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=75 --- cfengine.changes | 7 +++++++ cfengine.spec | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cfengine.changes b/cfengine.changes index 6696f1b..2595c66 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Mar 18 10:20:55 UTC 2014 - aeszter@gwdg.de + +- fix build for RHEL + * MySQL connector: disabled + * docs go into versioned directory + ------------------------------------------------------------------- Thu Feb 20 23:54:22 UTC 2014 - chris@computersalat.de diff --git a/cfengine.spec b/cfengine.spec index 1336e0d..39f3119 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -85,7 +85,7 @@ BuildRequires: pam-devel # library or disable MySQL connector. See # http://bugs.mysql.com/bug.php?id=65055 for details. # -%if 0%{?suse_version} != 1110 +%if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0 BuildRequires: mysql-devel %endif BuildRequires: libacl-devel @@ -213,7 +213,7 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ --datadir=/var \ --with-workdir=%{workdir} \ --with-postgresql \ -%if 0%{?suse_version} != 1110 +%if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0 --with-mysql \ %endif --without-qdbm \ @@ -225,8 +225,10 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ --with-libvirt \ --with-libacl \ --with-libxml2 \ -%if 0%{?suse_version} >= 1110 || 0%{?rhel_version} >= 600 +%if 0%{?suse_version} >= 1110 --docdir=%{_docdir}/%{name} +%else if 0%{?rhel_version} >= 600 + --docdir=%{_docdir}/%{name}-%{version} %endif # SLE 10 and RHEL5 don't recognize --docdir From ead513fd57378701fe0dc2ea968936103ef19aac939f389eaa9ab50e9e88e04e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Wed, 19 Mar 2014 18:23:19 +0000 Subject: [PATCH 11/26] - Update to 3.6.0b2 - performance has been significantly improved, with a 10-20% speed increase over 3.5 when using the default masterfiles - agents support the legacy protocol without TLS envelope This allows upgrading of an agent before the policy server. - several general improvements and bug fixes too numerous to list here. - remove cfengine-bootstrap.patch, included upstream - split masterfiles off as cfengine-masterfiles package OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=76 --- cfengine-3.6.0b1.tar.gz | 3 -- cfengine.changes | 15 ++++++++ cfengine.spec | 71 ++++++++++++++++++++------------------ core-3.6.0b2.tar.gz | 3 ++ masterfiles-3.6.0b1.tar.gz | 3 -- 5 files changed, 56 insertions(+), 39 deletions(-) delete mode 100644 cfengine-3.6.0b1.tar.gz create mode 100644 core-3.6.0b2.tar.gz delete mode 100644 masterfiles-3.6.0b1.tar.gz diff --git a/cfengine-3.6.0b1.tar.gz b/cfengine-3.6.0b1.tar.gz deleted file mode 100644 index 28156c7..0000000 --- a/cfengine-3.6.0b1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:597c47bfebf7b6b25e65a790ab2782efc624fc7aa727066ffa7f68e37bd11bdd -size 1787137 diff --git a/cfengine.changes b/cfengine.changes index 2595c66..0a26a99 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Tue Mar 18 11:30:23 UTC 2014 - kkaempf@suse.com + +- Update to 3.6.0b2 + - performance has been significantly improved, with a 10-20% speed + increase over 3.5 when using the default masterfiles + - agents support the legacy protocol without TLS envelope + This allows upgrading of an agent before the policy server. + - several general improvements and bug fixes too numerous to list + here. + +- remove cfengine-bootstrap.patch, included upstream + +- split masterfiles off as cfengine-masterfiles package + ------------------------------------------------------------------- Tue Mar 18 10:20:55 UTC 2014 - aeszter@gwdg.de diff --git a/cfengine.spec b/cfengine.spec index 39f3119..25c7cea 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -17,9 +17,10 @@ Name: cfengine -%define srcname %{name} +%define srcname core %define libname libpromises %define libsoname %{libname}3 +%define masterdirname masterfiles-%{version} # Yes, its not FHS conformant but in sync with cfengine documentation # reported upstream as https://cfengine.com/dev/issues/1896 @@ -32,10 +33,13 @@ Name: cfengine Summary: CFEngine automates large-scale IT computing infrastructure License: GPL-3.0 Group: Productivity/Networking/System -Version: 3.6.0b1 +Version: 3.6.0b2 Release: 0 Url: http://www.cfengine.org/ -Source: %{name}-%{version}.tar.gz +Source: %{srcname}-%{version}.tar.gz + +BuildRequires: %{name}-masterfiles = %{version} +Requires: %{name}-masterfiles = %{version} # wtf? SLE_11 does not honor rpmlintrc %if 0%{?suse_version} <= 1130 @@ -52,7 +56,7 @@ Source9: cf-serverd %endif Source10: %{name}.cron Source11: %{name}-rpmlintrc -Source12: masterfiles-%{version}.tar.gz + # docs Source101: http://www.cfengine.org/manuals/cf3-Reference.pdf Source102: http://www.cfengine.org/manuals/cf3-conceptguide.pdf @@ -62,8 +66,6 @@ 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 -# FIX-4-UPSTREAM: fix workdir while bootstrapping -Patch0: %{name}-bootstrap.patch # there's no /usr/include/acl.h in SUSE or Fedora, kkaempf@suse.de Patch1: libacl-headers.patch # SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, kkaempf@suse.de @@ -128,8 +130,8 @@ impact on system resources or performance. %package -n %{libsoname} Summary: Shared library of cfengine Group: System/Libraries -Provides: %{libname}1 -Obsoletes: %{libname}1 +Provides: %{libname}1 = %{version} +Obsoletes: %{libname}1 < %{version} %if 0%{?suse_version} == 1010 Requires: glibc %endif @@ -140,7 +142,7 @@ This package contains the shared libpromises (cfengine) library. %package -n %{libname}-devel Summary: Development package for libpromises Group: Development/Libraries/C and C++ -Provides: %{name}-devel < %{version} +Provides: %{name}-devel = %{version} Obsoletes: %{name}-devel < %{version} Requires: %{libsoname} = %{version} Requires: glibc-devel @@ -182,7 +184,6 @@ This package contains the files of the cfengine server. %prep %setup -q -n %{srcname}-%{version} -%patch0 %if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel_version} %patch1 %endif @@ -204,7 +205,7 @@ find ./examples -type f -name "*.cf" -exec perl -p -i -e 's|\r\n|\n|,s|^# Founda cp -a $RPM_SOURCE_DIR/*pdf docs/ %build -autoreconf -fi +autoreconf -fi -I m4 # /usr/include/sys for acl.h CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ %configure \ @@ -244,6 +245,12 @@ chmod -x ChangeLog [ -d %{buildroot} ] && [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} %endif %{__make} "DESTDIR=%{buildroot}" install + +%if 0%{?suse_version} >= 1110 || 0%{?rhel_version} >= 600 +# will appear in cfengine-examples +rm -rf %{buildroot}/%{_docdir}/%{name}/examples +%endif + %{__install} -d %{buildroot}/{usr/sbin,%{workdir}/{bin,inputs,reports}} # create dirs needed for better organizing dirs and files @@ -278,21 +285,22 @@ for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd %{__ln_s} -f ../../..%{_sbindir}/${i} %{buildroot}%{workdir}/bin/${i} done -# Install masterfiles (as %%config(noreplace) ) -%{__install} -d %{buildroot}/%{basedir}/masterfiles -tar xf %{S:12} -cd masterfiles-%{version} -make install DESTDIR=%{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 - rm -rf %{buildroot}/%{_libdir}/%{name}/libpromises.la # will appear in %%docdir rm -rf %{buildroot}/%{_datadir}/%{name}/ChangeLog rm -rf %{buildroot}/%{_datadir}/%{name}/README +# create man pages, see https://cfengine.com/dev/issues/2989 +%{__install} -d %{buildroot}/%{_mandir}/man8 +for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd +do + LD_LIBRARY_PATH=%{buildroot}%{_libdir}/%{name} %{buildroot}%{_sbindir}/$i -M > %{buildroot}%{_mandir}/man8/$i.8 + gzip %{buildroot}%{_mandir}/man8/$i.8 +done + +# populate inputs for %ghost +cp -a %{basedir}/masterfiles/* %{buildroot}%{basedir}/inputs %if 0%{?suse_version} > 01020 %fdupes %{buildroot}/usr/share/cfengine %endif @@ -312,6 +320,10 @@ rm -rf %{buildroot}/%{_datadir}/%{name}/README if [ $1 -lt 2 ]; then cf-key fi +# only populate /var/cfengine/inputs on install, not on upgrade +if [ ${1:-0} -ne 1 ]; then + cp -a %{basedir}/masterfiles/* %{basedir}/inputs +fi %preun %service_del_preun cf-execd.service cf-monitord.service @@ -327,11 +339,6 @@ fi %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 @@ -422,25 +429,22 @@ fi %{_sbindir}/rccf-monitord %endif -# %{_mandir}/man?/* +%{_mandir}/man8/* +%exclude %{_mandir}/man8/cf-serverd.8.* %dir %{basedir} -/var/%{name} +%config %ghost %{basedir}/inputs/*.cf +%config %ghost %{basedir}/inputs/*/*.cf +%config %ghost %{basedir}/inputs/*/*/*.cf %exclude %{basedir}/backup %exclude %{basedir}/config #%%exclude %%{basedir}/failsafe -# %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} @@ -470,5 +474,6 @@ fi /etc/init.d/cf-serverd %{_sbindir}/rccf-serverd %endif +%{_mandir}/man8/cf-serverd.8.* %changelog diff --git a/core-3.6.0b2.tar.gz b/core-3.6.0b2.tar.gz new file mode 100644 index 0000000..e429cb0 --- /dev/null +++ b/core-3.6.0b2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79915acb1e43a24fe8bb5bbe98b875f3dc71dc0fbae88c47818ddec1c3bc99ec +size 1376269 diff --git a/masterfiles-3.6.0b1.tar.gz b/masterfiles-3.6.0b1.tar.gz deleted file mode 100644 index ca0f81e..0000000 --- a/masterfiles-3.6.0b1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:276b760241cd722801f79db163f2d4c7477a89af2338e03509c0005629c4f9d2 -size 167598 From 35ed2c7da9f165ecfcfec5759a36b1504389535d610f56e0713a5f4236df4173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Mon, 24 Mar 2014 13:31:21 +0000 Subject: [PATCH 12/26] don't populate /inputs, it's a cache filled by --bootstrap OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=77 --- cfengine.spec | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cfengine.spec b/cfengine.spec index 25c7cea..12ae35d 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -299,8 +299,6 @@ do gzip %{buildroot}%{_mandir}/man8/$i.8 done -# populate inputs for %ghost -cp -a %{basedir}/masterfiles/* %{buildroot}%{basedir}/inputs %if 0%{?suse_version} > 01020 %fdupes %{buildroot}/usr/share/cfengine %endif @@ -320,10 +318,6 @@ cp -a %{basedir}/masterfiles/* %{buildroot}%{basedir}/inputs if [ $1 -lt 2 ]; then cf-key fi -# only populate /var/cfengine/inputs on install, not on upgrade -if [ ${1:-0} -ne 1 ]; then - cp -a %{basedir}/masterfiles/* %{basedir}/inputs -fi %preun %service_del_preun cf-execd.service cf-monitord.service @@ -432,9 +426,6 @@ fi %{_mandir}/man8/* %exclude %{_mandir}/man8/cf-serverd.8.* %dir %{basedir} -%config %ghost %{basedir}/inputs/*.cf -%config %ghost %{basedir}/inputs/*/*.cf -%config %ghost %{basedir}/inputs/*/*/*.cf %exclude %{basedir}/backup %exclude %{basedir}/config #%%exclude %%{basedir}/failsafe From 79da141433343dedeed065b5503b083a10558f4dfb81deb60a919aa829904208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Wed, 26 Mar 2014 08:24:32 +0000 Subject: [PATCH 13/26] - Fix cf-serverd.service file, type is forking. OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=78 --- cf-serverd.service | 1 + cfengine.changes | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cf-serverd.service b/cf-serverd.service index c112715..13d236c 100644 --- a/cf-serverd.service +++ b/cf-serverd.service @@ -3,6 +3,7 @@ Description=CFEngine Server Daemon After=syslog.target [Service] +Type=forking ExecStart=/usr/sbin/cf-serverd [Install] diff --git a/cfengine.changes b/cfengine.changes index 0a26a99..602d28a 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Mar 26 08:24:00 UTC 2014 - kkaempf@suse.com + +- Fix cf-serverd.service file, type is forking. + ------------------------------------------------------------------- Tue Mar 18 11:30:23 UTC 2014 - kkaempf@suse.com From 9f143562074b6b5c8d53bd2ebcd7e8234a0684f3da6f600ab2d2ee2a4a7d9294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Wed, 26 Mar 2014 08:40:13 +0000 Subject: [PATCH 14/26] drop obsolete patch OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=79 --- cfengine-bootstrap.patch | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 cfengine-bootstrap.patch diff --git a/cfengine-bootstrap.patch b/cfengine-bootstrap.patch deleted file mode 100644 index 7ee18fe..0000000 --- a/cfengine-bootstrap.patch +++ /dev/null @@ -1,22 +0,0 @@ -Index: libpromises/bootstrap.c -=================================================================== ---- libpromises/bootstrap.c.orig -+++ libpromises/bootstrap.c -@@ -332,7 +332,7 @@ bool WriteBuiltinFailsafePolicyToPath(co - " handle => \"cfe_internal_bootstrap_update_files_sys_workdir_inputs_not_windows\",\n" - #ifdef __MINGW32__ - // This section is needed because Windows attempts to copy from "C:\Program Files\Cfengine\masterfiles". -- " copy_from => u_scp(\"/var/cfengine/masterfiles\"),\n" -+ " copy_from => u_scp(\"$(sys.workdir)/masterfiles\"),\n" - #else - " copy_from => u_scp(\"$(sys.masterdir)\"),\n" - #endif /* !__MINGW32__ */ -@@ -344,7 +344,7 @@ bool WriteBuiltinFailsafePolicyToPath(co - " handle => \"cfe_internal_bootstrap_update_files_sys_workdir_inputs_windows\",\n" - #ifdef __MINGW32__ - // This section is needed because Windows attempts to copy from "C:\Program Files\Cfengine\masterfiles". -- " copy_from => u_scp(\"/var/cfengine/masterfiles\"),\n" -+ " copy_from => u_scp(\"$(sys.workdir)/masterfiles\"),\n" - #else - " copy_from => u_scp(\"$(sys.masterdir)\"),\n" - #endif /* !__MINGW32__ */ From ba55277191eb80c67d38a631af8f9d2eb4019c8f957ec4f71f0ba0625eddb6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Wed, 26 Mar 2014 16:08:38 +0000 Subject: [PATCH 15/26] - remove '.unknown' from reported version add drop-revision.patch OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=80 --- cfengine.changes | 6 ++++++ cfengine.spec | 5 +++++ drop-revision.patch | 12 ++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 drop-revision.patch diff --git a/cfengine.changes b/cfengine.changes index 602d28a..95fd356 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Mar 26 16:08:16 UTC 2014 - kkaempf@suse.com + +- remove '.unknown' from reported version + add drop-revision.patch + ------------------------------------------------------------------- Wed Mar 26 08:24:00 UTC 2014 - kkaempf@suse.com diff --git a/cfengine.spec b/cfengine.spec index 12ae35d..ef6716a 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -71,6 +71,10 @@ Patch1: libacl-headers.patch # SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, kkaempf@suse.de Patch2: remove-am_subst_notmake.patch +# drop revision from configure.ac, autotools will evaluate it as 'unkwown' +# kkaempf@suse.de +Patch3: drop-revision.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: db-devel @@ -193,6 +197,7 @@ This package contains the files of the cfengine server. %if 0%{?rhel_version} >= 500 && 0%{?rhel_version} < 600 %patch2 -p1 %endif +%patch3 -p1 ##### rpmlint #### wrong-file-end-of-line-encoding diff --git a/drop-revision.patch b/drop-revision.patch new file mode 100644 index 0000000..7137105 --- /dev/null +++ b/drop-revision.patch @@ -0,0 +1,12 @@ +diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/configure.ac ./configure.ac +--- ../orig-core-3.6.0b2/configure.ac 2014-03-17 17:37:49.000000000 +0100 ++++ ./configure.ac 2014-03-26 17:06:24.343406133 +0100 +@@ -25,7 +25,7 @@ + dnl + + _AM_SET_OPTION([tar-ustar]) +-AM_INIT_AUTOMAKE(cfengine, 3.6.0b2.revision) ++AM_INIT_AUTOMAKE(cfengine, 3.6.0b2) + AM_MAINTAINER_MODE([enable]) + + AC_DEFINE(BUILD_YEAR, esyscmd([date +%Y | tr -d '\n']), "Software build year") From 264b2dd02403b9183bd6003c9de604cf41d1cf1026ebf1de2afde6de9037e2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Wed, 26 Mar 2014 16:12:54 +0000 Subject: [PATCH 16/26] - Fix all .service files, type is forking. OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=81 --- cf-execd.service | 1 + cf-monitord.service | 1 + cfengine.changes | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cf-execd.service b/cf-execd.service index 9c77067..0336159 100644 --- a/cf-execd.service +++ b/cf-execd.service @@ -3,6 +3,7 @@ Description=CFEngine Execution Daemon After=syslog.target [Service] +Type=forking ExecStart=/usr/sbin/cf-execd [Install] diff --git a/cf-monitord.service b/cf-monitord.service index 5d2670c..34db31b 100644 --- a/cf-monitord.service +++ b/cf-monitord.service @@ -3,6 +3,7 @@ Description=CFEngine Monitoring Daemon After=syslog.target [Service] +Type=forking ExecStart=/usr/sbin/cf-monitord [Install] diff --git a/cfengine.changes b/cfengine.changes index 95fd356..bd02423 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -7,7 +7,7 @@ Wed Mar 26 16:08:16 UTC 2014 - kkaempf@suse.com ------------------------------------------------------------------- Wed Mar 26 08:24:00 UTC 2014 - kkaempf@suse.com -- Fix cf-serverd.service file, type is forking. +- Fix all .service files, type is forking. ------------------------------------------------------------------- Tue Mar 18 11:30:23 UTC 2014 - kkaempf@suse.com From 9fcecd26b43b44907c4bfc19b54ef86bb34a9c67bf26c2943afba55a909cb678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Wed, 2 Apr 2014 13:15:07 +0000 Subject: [PATCH 17/26] - clean up /var/cfengine/inputs cache on removal. OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=82 --- cfengine.changes | 5 +++++ cfengine.spec | 2 ++ 2 files changed, 7 insertions(+) diff --git a/cfengine.changes b/cfengine.changes index bd02423..b2e77b2 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 2 13:14:34 UTC 2014 - kkaempf@suse.com + +- clean up /var/cfengine/inputs cache on removal. + ------------------------------------------------------------------- Wed Mar 26 16:08:16 UTC 2014 - kkaempf@suse.com diff --git a/cfengine.spec b/cfengine.spec index ef6716a..85f4a6c 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -332,6 +332,8 @@ fi %if 0%{?suse_version} > 1010 %install_info_delete --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz %endif +# clean up inputs cache dir +rm -rf %{basedir}/inputs /sbin/ldconfig %pre server From f5b1275d99f45df7b2be103897a50dba0905dfc4c98a40bfb3fe296df96dee9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Thu, 3 Apr 2014 12:52:10 +0000 Subject: [PATCH 18/26] - install cfengine-masterfiles together with cfengine-server only. A cfengine client will get the masterfiles from the server. OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=83 --- cfengine.changes | 6 ++++++ cfengine.spec | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cfengine.changes b/cfengine.changes index b2e77b2..1b629c8 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 3 12:41:44 UTC 2014 - kkaempf@suse.com + +- install cfengine-masterfiles together with cfengine-server only. + A cfengine client will get the masterfiles from the server. + ------------------------------------------------------------------- Wed Apr 2 13:14:34 UTC 2014 - kkaempf@suse.com diff --git a/cfengine.spec b/cfengine.spec index 85f4a6c..43a581e 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -39,7 +39,6 @@ Url: http://www.cfengine.org/ Source: %{srcname}-%{version}.tar.gz BuildRequires: %{name}-masterfiles = %{version} -Requires: %{name}-masterfiles = %{version} # wtf? SLE_11 does not honor rpmlintrc %if 0%{?suse_version} <= 1130 @@ -181,6 +180,7 @@ Lots of examples promises for CFEngine. Summary: CFEngine automates large-scale IT computing infrastructure - server Group: Productivity/Networking/System Requires: %{name} = %{version}-%{release} +Requires: %{name}-masterfiles = %{version} %description server This package contains the files of the cfengine server. @@ -333,7 +333,7 @@ fi %install_info_delete --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz %endif # clean up inputs cache dir -rm -rf %{basedir}/inputs +rm -rf %{basedir}/inputs/* /sbin/ldconfig %pre server From 9cfdbac5b745e414da791e7ea7ace41e90fa5800ecf1fe667ffeeea29a239020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Thu, 3 Apr 2014 13:11:06 +0000 Subject: [PATCH 19/26] - install cfengine.SuSEfirewall2 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=84 --- cfengine.SuSEfirewall2 | 6 ++++++ cfengine.changes | 5 +++++ cfengine.spec | 5 +++++ 3 files changed, 16 insertions(+) create mode 100644 cfengine.SuSEfirewall2 diff --git a/cfengine.SuSEfirewall2 b/cfengine.SuSEfirewall2 new file mode 100644 index 0000000..decd296 --- /dev/null +++ b/cfengine.SuSEfirewall2 @@ -0,0 +1,6 @@ +## Name: CFEngine server +## Description: opens ports for CFEngine server in order to be used as a policy hub + +# space separated list of allowed ports +TCP="5308" + diff --git a/cfengine.changes b/cfengine.changes index 1b629c8..a8a156b 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Apr 3 13:10:56 UTC 2014 - kkaempf@suse.com + +- install cfengine.SuSEfirewall2 + ------------------------------------------------------------------- Thu Apr 3 12:41:44 UTC 2014 - kkaempf@suse.com diff --git a/cfengine.spec b/cfengine.spec index 43a581e..9d9ccd4 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -37,6 +37,7 @@ Version: 3.6.0b2 Release: 0 Url: http://www.cfengine.org/ Source: %{srcname}-%{version}.tar.gz +Source1: %{name}.SuSEfirewall2 BuildRequires: %{name}-masterfiles = %{version} @@ -304,6 +305,10 @@ do gzip %{buildroot}%{_mandir}/man8/$i.8 done +%if 0%{?suse_version} > 1010 +install -D -m 644 %{S:1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine +%endif + %if 0%{?suse_version} > 01020 %fdupes %{buildroot}/usr/share/cfengine %endif From ecb8b74fe303a4aec75bfcd8d2a3fbca233cc08137f524fb2ba83ff1d93de251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Thu, 3 Apr 2014 13:13:30 +0000 Subject: [PATCH 20/26] add firewall config to %files OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=85 --- cfengine.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cfengine.spec b/cfengine.spec index 9d9ccd4..0840280 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -478,5 +478,8 @@ rm -rf %{basedir}/inputs/* %{_sbindir}/rccf-serverd %endif %{_mandir}/man8/cf-serverd.8.* +%if 0%{?suse_version} > 1010 +%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine +%endif %changelog From 76f1d50926f21c87e4b4d3e4b7ee7460af9b2520d30a71bfa21a736bf5bdc9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Fri, 4 Apr 2014 19:37:14 +0000 Subject: [PATCH 21/26] - move cf-serverd to cfengine, required for bootstrap - Parse /etc/os-release for product and version Add patch 0001-Check-etc-os-release-for-distribution-information.patch OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=86 --- ...release-for-distribution-information.patch | 188 ++++++++++++++++++ cfengine.changes | 11 + cfengine.spec | 96 ++++----- 3 files changed, 238 insertions(+), 57 deletions(-) create mode 100644 0001-Check-etc-os-release-for-distribution-information.patch diff --git a/0001-Check-etc-os-release-for-distribution-information.patch b/0001-Check-etc-os-release-for-distribution-information.patch new file mode 100644 index 0000000..4ff217b --- /dev/null +++ b/0001-Check-etc-os-release-for-distribution-information.patch @@ -0,0 +1,188 @@ +From 5edafd6237e80109f5d1ca8410ff9772dbc41635 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= +Date: Fri, 4 Apr 2014 21:20:48 +0200 +Subject: [PATCH] Check /etc/os-release for distribution information + +Vendor specific -release files are deprecated in favor of +generic /etc/os-release files. + +This patch extracts product and version information from /etc/os-release +and creates respective classes. +--- + libenv/sysinfo.c | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 146 insertions(+) + +diff --git a/libenv/sysinfo.c b/libenv/sysinfo.c +index 9c89c57cbf5e..901791220855 100644 +--- a/libenv/sysinfo.c ++++ b/libenv/sysinfo.c +@@ -114,6 +114,7 @@ static time_t GetBootTimeFromUptimeCommand(time_t); // Last resort + void CalculateDomainName(const char *nodename, const char *dnsname, char *fqname, char *uqname, char *domain); + + #ifdef __linux__ ++static int Linux_Os_Release(EvalContext *ctx); + static int Linux_Fedora_Version(EvalContext *ctx); + static int Linux_Redhat_Version(EvalContext *ctx); + static void Linux_Oracle_VM_Server_Version(EvalContext *ctx); +@@ -931,6 +932,11 @@ static void OSClasses(EvalContext *ctx) + /* Mandrake/Mandriva, Fedora and Oracle VM Server supply /etc/redhat-release, so + we test for those distributions first */ + ++ if (stat("/etc/os-release", &statbuf) != -1) ++ { ++ Linux_Os_Release(ctx); ++ } ++ + if (stat("/etc/mandriva-release", &statbuf) != -1) + { + Linux_Mandriva_Version(ctx); +@@ -1213,6 +1219,146 @@ static void OSClasses(EvalContext *ctx) + /*********************************************************************************/ + + #ifdef __linux__ ++ ++static int Linux_Os_Release(EvalContext *ctx) ++{ ++#define OS_REL_FILENAME "/etc/os-release" ++ ++ char classbuf[CF_MAXVARSIZE]; ++ ++ Log(LOG_LEVEL_VERBOSE, "This appears to have an os-release."); ++ ++ FILE *fp = fopen(OS_REL_FILENAME, "r"); ++ if (fp == NULL) ++ { ++ return 1; ++ } ++ ++ char vbuf[CF_BUFSIZE], strid[CF_MAXVARSIZE], strversion[CF_MAXVARSIZE]; ++ ++ int major = -1, minor = -1; ++ char *strmajor = NULL, *strminor = NULL; ++ while (fgets(vbuf, sizeof(vbuf), fp) != NULL) ++ { ++ char *nptr, *vptr; /* name, value ptrs */ ++ ++ nptr = strrchr(vbuf, '='); ++ if (nptr == NULL) ++ { ++ continue; ++ } ++ vptr = nptr; ++ /* search left of '=' for non-blank char */ ++ while (isspace(*(nptr-1))) ++ { ++ nptr--; ++ } ++ *nptr = '\0'; ++ /* search right of '=' for non-blank char */ ++ do ++ { ++ vptr++; ++ } ++ while (isspace(*vptr)); ++ /* value could be enclosed in " */ ++ if (*vptr == '"') ++ { ++ char *eos; ++ eos = ++vptr; ++ /* find closing " and remove it */ ++ while (*eos && *eos != '"') ++ { ++ eos++; ++ } ++ *eos = '\0'; ++ } ++ else ++ { ++ char *eos = vptr + strlen(vptr); ++ while (eos > vptr && isspace(*(eos-1))) ++ { ++ eos--; ++ } ++ *eos = '\0'; ++ } ++ Log(LOG_LEVEL_VERBOSE, "Discovered nptr >%s<, vptr >%s<", vbuf, vptr); ++ if (strcmp(vbuf, "ID") == 0) ++ { ++ strlcpy(strid, vptr, sizeof(strid)); ++ Log(LOG_LEVEL_VERBOSE, "Discovered ID '%s'", strid); ++ } ++ ++ if (strcmp(vbuf, "VERSION_ID") == 0) ++ { ++ strlcpy(strversion, vptr, sizeof(strversion)); ++ switch (sscanf(strversion, "%d.%d", &major, &minor)) ++ { ++ case 1: ++ strmajor = strversion; ++ minor = -1; ++ strminor = NULL; ++ break; ++ case 2: ++ strmajor = strversion; ++ strminor = strchr(strversion, '.'); ++ *strminor++ = '\0'; ++ break; ++ default: ++ UnexpectedError("Non-numeric VERSION_ID in /etc/os-release"); ++ strmajor = strminor = NULL; ++ break; ++ } ++ Log(LOG_LEVEL_VERBOSE, "Discovered VERSION_ID '%s', strmajor '%s', strminor '%s'", strversion, strmajor, strminor); ++ } ++ } ++ if (ferror(fp)) ++ { ++ UnexpectedError("Failed to read line from stream"); ++ } ++ else ++ { ++ assert(feof(fp)); ++ } ++ ++ fclose(fp); ++ ++ EvalContextClassPutHard(ctx, strid, "inventory,attribute_name=none,source=agent"); ++ int i; ++ char *cptr; ++ for (i = 0; i < strlen(strid); i++) ++ { ++ classbuf[i] = toupper(strid[i]); ++ } ++ if (strcmp(classbuf, "OPENSUSE") == 0) ++ { ++ strcpy(classbuf, "openSUSE"); ++ } ++ cptr = classbuf + i; ++ ++ Log(LOG_LEVEL_VERBOSE, "Discovered %s version %s.%s", classbuf, strmajor, strminor?strminor:""); ++ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); ++ if (strmajor != NULL) ++ { ++ *cptr++ = '_'; ++ strcpy(cptr, strmajor); ++ cptr += strlen(strmajor); ++ Log(LOG_LEVEL_VERBOSE, "Classbuf >%s<", classbuf); ++ SetFlavour(ctx, classbuf); ++ if (strminor != NULL) ++ { ++ *cptr++ = '_'; ++ strcpy(cptr, strminor); ++ Log(LOG_LEVEL_VERBOSE, "Classbuf >%s<", classbuf); ++ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); ++ } ++ } ++ else ++ { ++ Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", OS_REL_FILENAME); ++ } ++ return 0; ++} ++ + static void Linux_Oracle_VM_Server_Version(EvalContext *ctx) + { + char relstring[CF_MAXVARSIZE]; +-- +1.8.4.5 + diff --git a/cfengine.changes b/cfengine.changes index a8a156b..9ed5331 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Apr 4 19:36:47 UTC 2014 - kkaempf@suse.com + +- move cf-serverd to cfengine, required for bootstrap + +------------------------------------------------------------------- +Fri Apr 4 19:30:04 UTC 2014 - kkaempf@suse.com + +- Parse /etc/os-release for product and version + Add patch 0001-Check-etc-os-release-for-distribution-information.patch + ------------------------------------------------------------------- Thu Apr 3 13:10:56 UTC 2014 - kkaempf@suse.com diff --git a/cfengine.spec b/cfengine.spec index 0840280..245f65a 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -75,6 +75,9 @@ Patch2: remove-am_subst_notmake.patch # kkaempf@suse.de Patch3: drop-revision.patch +# parse /etc/os-release for product and version information, kkaempf@suse.de +Patch4: 0001-Check-etc-os-release-for-distribution-information.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: db-devel @@ -199,6 +202,7 @@ This package contains the files of the cfengine server. %patch2 -p1 %endif %patch3 -p1 +%patch4 -p1 ##### rpmlint #### wrong-file-end-of-line-encoding @@ -260,7 +264,7 @@ rm -rf %{buildroot}/%{_docdir}/%{name}/examples %{__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} +%{__install} -d %{buildroot}/%{basedir}/{backup,failsafe,config,plugins} #%%{__install} -d %{buildroot}/%%{basedir}/config/{development,production} # install cron file @@ -287,7 +291,7 @@ sed -i\ # create symlinks for sbin_PROGRAMS # 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-runagent cf-serverd; do +for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd cf-upgrade; do %{__ln_s} -f ../../..%{_sbindir}/${i} %{buildroot}%{workdir}/bin/${i} done @@ -316,52 +320,53 @@ install -D -m 644 %{S:1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d # systemd %if 0%{?suse_version} >= 1210 +#################################################################### +# Systemd +#################################################################### + %pre -%service_add_pre cf-execd.service cf-monitord.service +%service_add_pre cf-execd.service cf-monitord.service cf-serverd.service %post -%service_add_post cf-execd.service cf-monitord.service +%service_add_post cf-execd.service cf-monitord.service cf-serverd.service %if 0%{?suse_version} > 1010 %install_info --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz %endif /sbin/ldconfig if [ $1 -lt 2 ]; then + # first install, generate key pair cf-key fi %preun -%service_del_preun cf-execd.service cf-monitord.service +%service_del_preun cf-execd.service cf-monitord.service cf-serverd.service %postun -%service_del_postun cf-execd.service cf-monitord.service +%service_del_postun cf-execd.service cf-monitord.service cf-serverd.service %if 0%{?suse_version} > 1010 %install_info_delete --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz %endif -# clean up inputs cache dir -rm -rf %{basedir}/inputs/* +if [ $1 -eq 0 ]; then + # clean up inputs cache dir on removal + rm -rf %{basedir}/inputs/* +fi /sbin/ldconfig -%pre server -%service_add_pre cf-serverd.service - -%post server -%service_add_post cf-serverd.service - -%preun server -%service_del_preun cf-serverd.service - -%postun server -%service_del_postun cf-serverd.service - %else # !systemd +#################################################################### +# Non-systemd +#################################################################### + %preun %if 0%{?suse_version} %stop_on_removal cf-monitord %stop_on_removal cf-execd +%stop_on_removal cf-serverd %else /etc/init.d/cf-execd stop /etc/init.d/cf-monitord stop +/etc/init.d/cf-serverd stop %endif %post @@ -374,13 +379,13 @@ rm -rf %{basedir}/inputs/* %if 0%{?suse_version} > 1010 %install_info_delete --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz %insserv_cleanup - for i in execd monitord; do + for i in execd monitord serverd; do %restart_on_update cf-${i} done %else # Update ? if [ ${1:-0} -eq 1 ]; then - for i in execd monitord; do + for i in execd monitord serverd; do /etc/init.d/cf-${i} restart done else @@ -389,25 +394,6 @@ rm -rf %{basedir}/inputs/* %endif /sbin/ldconfig -%preun server -%if 0%{?suse_version} -%stop_on_removal cf-serverd -%else -/etc/init.d/cf-serverd stop -%endif - -%postun server -%if 0%{?suse_version} -%restart_on_update cf-serverd -%else - # Update ? - if [ ${1:-0} -eq 1 ]; then - /etc/init.d/cf-serverd restart - else -: - fi -%endif - %endif # !systemd %post -n %{libsoname} -p /sbin/ldconfig @@ -422,21 +408,26 @@ rm -rf %{basedir}/inputs/* %{_sbindir}/cf-key %{_sbindir}/cf-monitord %{_sbindir}/cf-promises -%{_sbindir}/cf-runagent +%{_sbindir}/cf-serverd %{_sbindir}/cf-upgrade %{_sbindir}/rpmvercmp %if 0%{?suse_version} >= 1210 %_unitdir/cf-execd.service %_unitdir/cf-monitord.service +%_unitdir/cf-serverd.service %else -%exclude /etc/init.d/cf-serverd %config %attr(0755,root,root) /etc/init.d/* %{_sbindir}/rccf-execd %{_sbindir}/rccf-monitord +%{_sbindir}/rccf-serverd +%endif +%{_mandir}/man8/cf-serverd.8.* +%if 0%{?suse_version} > 1010 +%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine %endif %{_mandir}/man8/* -%exclude %{_mandir}/man8/cf-serverd.8.* +%exclude %{_mandir}/man8/cf-runagent.8.* %dir %{basedir} %exclude %{basedir}/backup %exclude %{basedir}/config @@ -444,7 +435,7 @@ rm -rf %{basedir}/inputs/* %dir %{workdir} %{workdir}/* -%exclude %{workdir}/bin/cf-serverd +%exclude %{workdir}/bin/cf-runagent %config(noreplace) /etc/cron.d/%{name} @@ -469,17 +460,8 @@ rm -rf %{basedir}/inputs/* %defattr(-,root,root) %{basedir}/backup %{basedir}/config -%{_sbindir}/cf-serverd -%{workdir}/bin/cf-serverd -%if 0%{?suse_version} >= 1210 -%_unitdir/cf-serverd.service -%else -/etc/init.d/cf-serverd -%{_sbindir}/rccf-serverd -%endif -%{_mandir}/man8/cf-serverd.8.* -%if 0%{?suse_version} > 1010 -%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine -%endif +%{_sbindir}/cf-runagent +%{workdir}/bin/cf-runagent +%{_mandir}/man8/cf-runagent.8.* %changelog From fbc1f08371266a4459b7c70d3612aba21b62cd3540ab3f89b24efafa916db73b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Fri, 4 Apr 2014 20:08:15 +0000 Subject: [PATCH 22/26] - Parse /proc/1/cmdline to detect systemd 0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=87 --- ...proc-1-cmdline-and-check-for-systemd.patch | 96 +++++++++++++++++++ cfengine.changes | 3 + cfengine.spec | 4 + 3 files changed, 103 insertions(+) create mode 100644 0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch diff --git a/0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch b/0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch new file mode 100644 index 0000000..9565f49 --- /dev/null +++ b/0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch @@ -0,0 +1,96 @@ +From 66cfed74c4a14d89c9c7078c7ce1c16d26af5d1e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= +Date: Fri, 4 Apr 2014 22:03:29 +0200 +Subject: [PATCH] Evaluate /proc/1/cmdline and check for systemd + +Set 'systemd' class eventually. +--- + libenv/sysinfo.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 50 insertions(+), 2 deletions(-) + +diff --git a/libenv/sysinfo.c b/libenv/sysinfo.c +index 901791220855..64ca0aa5a880 100644 +--- a/libenv/sysinfo.c ++++ b/libenv/sysinfo.c +@@ -114,6 +114,7 @@ static time_t GetBootTimeFromUptimeCommand(time_t); // Last resort + void CalculateDomainName(const char *nodename, const char *dnsname, char *fqname, char *uqname, char *domain); + + #ifdef __linux__ ++static void Linux_Systemd(EvalContext *ctx); + static int Linux_Os_Release(EvalContext *ctx); + static int Linux_Fedora_Version(EvalContext *ctx); + static int Linux_Redhat_Version(EvalContext *ctx); +@@ -929,14 +930,17 @@ static void OSClasses(EvalContext *ctx) + #ifdef __linux__ + struct stat statbuf; + +-/* Mandrake/Mandriva, Fedora and Oracle VM Server supply /etc/redhat-release, so +- we test for those distributions first */ ++ /* check for systemd init process */ ++ Linux_Systemd(ctx); + + if (stat("/etc/os-release", &statbuf) != -1) + { + Linux_Os_Release(ctx); + } + ++/* Mandrake/Mandriva, Fedora and Oracle VM Server supply /etc/redhat-release, so ++ we test for those distributions first */ ++ + if (stat("/etc/mandriva-release", &statbuf) != -1) + { + Linux_Mandriva_Version(ctx); +@@ -1220,6 +1224,50 @@ static void OSClasses(EvalContext *ctx) + + #ifdef __linux__ + ++static void Linux_Systemd(EvalContext *ctx) ++{ ++ char proc1[CF_MAXVARSIZE]; ++ struct stat statbuf; ++ char *slash; ++ ++ if (!ReadLine("/proc/1/cmdline", proc1, sizeof(proc1))) ++ { ++ UnexpectedError("Failed to read /proc/1/cmdline"); ++ return; ++ } ++ ++ if (lstat(proc1, &statbuf) != 0) ++ { ++ UnexpectedError("Failed to stat %s", proc1); ++ return; ++ } ++ if (S_ISLNK(statbuf.st_mode)) ++ { ++ int len; ++ len = readlink(proc1, proc1, sizeof(proc1)); ++ if (len <= 0) ++ { ++ UnexpectedError("Failed to readlink %s", proc1); ++ return; ++ } ++ *(proc1 + len) = '\0'; ++ } ++ Log(LOG_LEVEL_VERBOSE, "Init process: %s", proc1); ++ slash = strrchr(proc1, '/'); ++ if (slash == NULL) ++ { ++ slash = proc1; ++ } ++ else ++ { ++ slash++; ++ } ++ if (strcmp(slash, "systemd") == 0) ++ { ++ EvalContextClassPutHard(ctx, slash, "inventory,attribute_name=none,source=agent"); ++ } ++} ++ + static int Linux_Os_Release(EvalContext *ctx) + { + #define OS_REL_FILENAME "/etc/os-release" +-- +1.8.4.5 + diff --git a/cfengine.changes b/cfengine.changes index 9ed5331..112d665 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -9,6 +9,9 @@ Fri Apr 4 19:30:04 UTC 2014 - kkaempf@suse.com - Parse /etc/os-release for product and version Add patch 0001-Check-etc-os-release-for-distribution-information.patch +- Parse /proc/1/cmdline to detect systemd + 0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch + ------------------------------------------------------------------- Thu Apr 3 13:10:56 UTC 2014 - kkaempf@suse.com diff --git a/cfengine.spec b/cfengine.spec index 245f65a..2085972 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -78,6 +78,9 @@ Patch3: drop-revision.patch # parse /etc/os-release for product and version information, kkaempf@suse.de Patch4: 0001-Check-etc-os-release-for-distribution-information.patch +# parse /proc/1/cmdline to detect systemd +Patch5: 0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: db-devel @@ -203,6 +206,7 @@ This package contains the files of the cfengine server. %endif %patch3 -p1 %patch4 -p1 +%patch5 -p1 ##### rpmlint #### wrong-file-end-of-line-encoding From 3b8d16732ab012dd78e8656ac6f43c50bb677e7bb2f8fae5b47896a88e7af0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Mon, 7 Apr 2014 12:51:53 +0000 Subject: [PATCH 23/26] fix summary and description of cfengine-server OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=88 --- cfengine.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfengine.spec b/cfengine.spec index 2085972..e0b130c 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -184,13 +184,13 @@ Group: Documentation/Other Lots of examples promises for CFEngine. %package server -Summary: CFEngine automates large-scale IT computing infrastructure - server +Summary: CFEngine policy server master package Group: Productivity/Networking/System Requires: %{name} = %{version}-%{release} Requires: %{name}-masterfiles = %{version} %description server -This package contains the files of the cfengine server. +This package contains the files and requirements of the cfengine policy server. %prep From fac2b5148b1ee8f493fb047f25e95edfd431fbcbacd8046e295a80a3f7c921cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Thu, 10 Apr 2014 14:31:27 +0000 Subject: [PATCH 24/26] - add 0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch to prevent crash on syntax error - add 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch * add 'suse' class for consistency with other vendor classes (fixes #5417) * distinction between "SUSE Linux Enterprise Server" (sles) and "... Desktop" (sled) * distinction between SUSE Linux Enterprise products (suse) and openSUSE (opensuse) * extract version from VERSION and PATCHLEVEL lines instead of first line of /etc/SuSE-release - merge cfengine-server with cfengine. A policy server only gets cfengine-masterfiles but is otherwise identical to a client. OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=89 --- ...release-for-distribution-information.patch | 188 ----------- ...proc-1-cmdline-and-check-for-systemd.patch | 96 ------ ...segfault-on-type-checking-NULL-Rvals.patch | 84 +++++ ...-parsing-of-etc-SuSE-release-fixes-i.patch | 304 ++++++++++++++++++ cfengine.changes | 29 +- cfengine.spec | 37 +-- 6 files changed, 414 insertions(+), 324 deletions(-) delete mode 100644 0001-Check-etc-os-release-for-distribution-information.patch delete mode 100644 0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch create mode 100644 0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch create mode 100644 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch diff --git a/0001-Check-etc-os-release-for-distribution-information.patch b/0001-Check-etc-os-release-for-distribution-information.patch deleted file mode 100644 index 4ff217b..0000000 --- a/0001-Check-etc-os-release-for-distribution-information.patch +++ /dev/null @@ -1,188 +0,0 @@ -From 5edafd6237e80109f5d1ca8410ff9772dbc41635 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= -Date: Fri, 4 Apr 2014 21:20:48 +0200 -Subject: [PATCH] Check /etc/os-release for distribution information - -Vendor specific -release files are deprecated in favor of -generic /etc/os-release files. - -This patch extracts product and version information from /etc/os-release -and creates respective classes. ---- - libenv/sysinfo.c | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 146 insertions(+) - -diff --git a/libenv/sysinfo.c b/libenv/sysinfo.c -index 9c89c57cbf5e..901791220855 100644 ---- a/libenv/sysinfo.c -+++ b/libenv/sysinfo.c -@@ -114,6 +114,7 @@ static time_t GetBootTimeFromUptimeCommand(time_t); // Last resort - void CalculateDomainName(const char *nodename, const char *dnsname, char *fqname, char *uqname, char *domain); - - #ifdef __linux__ -+static int Linux_Os_Release(EvalContext *ctx); - static int Linux_Fedora_Version(EvalContext *ctx); - static int Linux_Redhat_Version(EvalContext *ctx); - static void Linux_Oracle_VM_Server_Version(EvalContext *ctx); -@@ -931,6 +932,11 @@ static void OSClasses(EvalContext *ctx) - /* Mandrake/Mandriva, Fedora and Oracle VM Server supply /etc/redhat-release, so - we test for those distributions first */ - -+ if (stat("/etc/os-release", &statbuf) != -1) -+ { -+ Linux_Os_Release(ctx); -+ } -+ - if (stat("/etc/mandriva-release", &statbuf) != -1) - { - Linux_Mandriva_Version(ctx); -@@ -1213,6 +1219,146 @@ static void OSClasses(EvalContext *ctx) - /*********************************************************************************/ - - #ifdef __linux__ -+ -+static int Linux_Os_Release(EvalContext *ctx) -+{ -+#define OS_REL_FILENAME "/etc/os-release" -+ -+ char classbuf[CF_MAXVARSIZE]; -+ -+ Log(LOG_LEVEL_VERBOSE, "This appears to have an os-release."); -+ -+ FILE *fp = fopen(OS_REL_FILENAME, "r"); -+ if (fp == NULL) -+ { -+ return 1; -+ } -+ -+ char vbuf[CF_BUFSIZE], strid[CF_MAXVARSIZE], strversion[CF_MAXVARSIZE]; -+ -+ int major = -1, minor = -1; -+ char *strmajor = NULL, *strminor = NULL; -+ while (fgets(vbuf, sizeof(vbuf), fp) != NULL) -+ { -+ char *nptr, *vptr; /* name, value ptrs */ -+ -+ nptr = strrchr(vbuf, '='); -+ if (nptr == NULL) -+ { -+ continue; -+ } -+ vptr = nptr; -+ /* search left of '=' for non-blank char */ -+ while (isspace(*(nptr-1))) -+ { -+ nptr--; -+ } -+ *nptr = '\0'; -+ /* search right of '=' for non-blank char */ -+ do -+ { -+ vptr++; -+ } -+ while (isspace(*vptr)); -+ /* value could be enclosed in " */ -+ if (*vptr == '"') -+ { -+ char *eos; -+ eos = ++vptr; -+ /* find closing " and remove it */ -+ while (*eos && *eos != '"') -+ { -+ eos++; -+ } -+ *eos = '\0'; -+ } -+ else -+ { -+ char *eos = vptr + strlen(vptr); -+ while (eos > vptr && isspace(*(eos-1))) -+ { -+ eos--; -+ } -+ *eos = '\0'; -+ } -+ Log(LOG_LEVEL_VERBOSE, "Discovered nptr >%s<, vptr >%s<", vbuf, vptr); -+ if (strcmp(vbuf, "ID") == 0) -+ { -+ strlcpy(strid, vptr, sizeof(strid)); -+ Log(LOG_LEVEL_VERBOSE, "Discovered ID '%s'", strid); -+ } -+ -+ if (strcmp(vbuf, "VERSION_ID") == 0) -+ { -+ strlcpy(strversion, vptr, sizeof(strversion)); -+ switch (sscanf(strversion, "%d.%d", &major, &minor)) -+ { -+ case 1: -+ strmajor = strversion; -+ minor = -1; -+ strminor = NULL; -+ break; -+ case 2: -+ strmajor = strversion; -+ strminor = strchr(strversion, '.'); -+ *strminor++ = '\0'; -+ break; -+ default: -+ UnexpectedError("Non-numeric VERSION_ID in /etc/os-release"); -+ strmajor = strminor = NULL; -+ break; -+ } -+ Log(LOG_LEVEL_VERBOSE, "Discovered VERSION_ID '%s', strmajor '%s', strminor '%s'", strversion, strmajor, strminor); -+ } -+ } -+ if (ferror(fp)) -+ { -+ UnexpectedError("Failed to read line from stream"); -+ } -+ else -+ { -+ assert(feof(fp)); -+ } -+ -+ fclose(fp); -+ -+ EvalContextClassPutHard(ctx, strid, "inventory,attribute_name=none,source=agent"); -+ int i; -+ char *cptr; -+ for (i = 0; i < strlen(strid); i++) -+ { -+ classbuf[i] = toupper(strid[i]); -+ } -+ if (strcmp(classbuf, "OPENSUSE") == 0) -+ { -+ strcpy(classbuf, "openSUSE"); -+ } -+ cptr = classbuf + i; -+ -+ Log(LOG_LEVEL_VERBOSE, "Discovered %s version %s.%s", classbuf, strmajor, strminor?strminor:""); -+ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); -+ if (strmajor != NULL) -+ { -+ *cptr++ = '_'; -+ strcpy(cptr, strmajor); -+ cptr += strlen(strmajor); -+ Log(LOG_LEVEL_VERBOSE, "Classbuf >%s<", classbuf); -+ SetFlavour(ctx, classbuf); -+ if (strminor != NULL) -+ { -+ *cptr++ = '_'; -+ strcpy(cptr, strminor); -+ Log(LOG_LEVEL_VERBOSE, "Classbuf >%s<", classbuf); -+ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); -+ } -+ } -+ else -+ { -+ Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", OS_REL_FILENAME); -+ } -+ return 0; -+} -+ - static void Linux_Oracle_VM_Server_Version(EvalContext *ctx) - { - char relstring[CF_MAXVARSIZE]; --- -1.8.4.5 - diff --git a/0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch b/0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch deleted file mode 100644 index 9565f49..0000000 --- a/0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 66cfed74c4a14d89c9c7078c7ce1c16d26af5d1e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= -Date: Fri, 4 Apr 2014 22:03:29 +0200 -Subject: [PATCH] Evaluate /proc/1/cmdline and check for systemd - -Set 'systemd' class eventually. ---- - libenv/sysinfo.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 50 insertions(+), 2 deletions(-) - -diff --git a/libenv/sysinfo.c b/libenv/sysinfo.c -index 901791220855..64ca0aa5a880 100644 ---- a/libenv/sysinfo.c -+++ b/libenv/sysinfo.c -@@ -114,6 +114,7 @@ static time_t GetBootTimeFromUptimeCommand(time_t); // Last resort - void CalculateDomainName(const char *nodename, const char *dnsname, char *fqname, char *uqname, char *domain); - - #ifdef __linux__ -+static void Linux_Systemd(EvalContext *ctx); - static int Linux_Os_Release(EvalContext *ctx); - static int Linux_Fedora_Version(EvalContext *ctx); - static int Linux_Redhat_Version(EvalContext *ctx); -@@ -929,14 +930,17 @@ static void OSClasses(EvalContext *ctx) - #ifdef __linux__ - struct stat statbuf; - --/* Mandrake/Mandriva, Fedora and Oracle VM Server supply /etc/redhat-release, so -- we test for those distributions first */ -+ /* check for systemd init process */ -+ Linux_Systemd(ctx); - - if (stat("/etc/os-release", &statbuf) != -1) - { - Linux_Os_Release(ctx); - } - -+/* Mandrake/Mandriva, Fedora and Oracle VM Server supply /etc/redhat-release, so -+ we test for those distributions first */ -+ - if (stat("/etc/mandriva-release", &statbuf) != -1) - { - Linux_Mandriva_Version(ctx); -@@ -1220,6 +1224,50 @@ static void OSClasses(EvalContext *ctx) - - #ifdef __linux__ - -+static void Linux_Systemd(EvalContext *ctx) -+{ -+ char proc1[CF_MAXVARSIZE]; -+ struct stat statbuf; -+ char *slash; -+ -+ if (!ReadLine("/proc/1/cmdline", proc1, sizeof(proc1))) -+ { -+ UnexpectedError("Failed to read /proc/1/cmdline"); -+ return; -+ } -+ -+ if (lstat(proc1, &statbuf) != 0) -+ { -+ UnexpectedError("Failed to stat %s", proc1); -+ return; -+ } -+ if (S_ISLNK(statbuf.st_mode)) -+ { -+ int len; -+ len = readlink(proc1, proc1, sizeof(proc1)); -+ if (len <= 0) -+ { -+ UnexpectedError("Failed to readlink %s", proc1); -+ return; -+ } -+ *(proc1 + len) = '\0'; -+ } -+ Log(LOG_LEVEL_VERBOSE, "Init process: %s", proc1); -+ slash = strrchr(proc1, '/'); -+ if (slash == NULL) -+ { -+ slash = proc1; -+ } -+ else -+ { -+ slash++; -+ } -+ if (strcmp(slash, "systemd") == 0) -+ { -+ EvalContextClassPutHard(ctx, slash, "inventory,attribute_name=none,source=agent"); -+ } -+} -+ - static int Linux_Os_Release(EvalContext *ctx) - { - #define OS_REL_FILENAME "/etc/os-release" --- -1.8.4.5 - diff --git a/0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch b/0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch new file mode 100644 index 0000000..bee5784 --- /dev/null +++ b/0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch @@ -0,0 +1,84 @@ +From cc963ee8af0408d902c7956414c4d1c54a902805 Mon Sep 17 00:00:00 2001 +From: Sigurd Teigen +Date: Tue, 8 Apr 2014 12:53:04 -0400 +Subject: [PATCH 2/7] Do not segfault on type checking NULL Rvals. + +Add unit test. Close #5416 +--- +diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/libpromises/syntax.c ./libpromises/syntax.c +--- ../orig-core-3.6.0b2/libpromises/syntax.c 2014-03-17 17:37:49.000000000 +0100 ++++ ./libpromises/syntax.c 2014-04-10 16:12:06.104406735 +0200 +@@ -253,10 +253,11 @@ + [SYNTAX_TYPE_MATCH_OK] = "OK", + + [SYNTAX_TYPE_MATCH_ERROR_UNEXPANDED] = "Cannot check unexpanded value", +- [SYNTAX_TYPE_MATCH_ERROR_RANGE_BRACKETED] = "Real range specification should not be enclosed in brackets - just \"a,b\"", +- [SYNTAX_TYPE_MATCH_ERROR_RANGE_MULTIPLE_ITEMS] = "Range format specifier should be of form \"a,b\" but got multiple items", ++ [SYNTAX_TYPE_MATCH_ERROR_RANGE_BRACKETED] = "Real range specification should not be enclosed in brackets - just 'a,b'", ++ [SYNTAX_TYPE_MATCH_ERROR_RANGE_MULTIPLE_ITEMS] = "Range format specifier should be of form 'a,b'' but got multiple items", + [SYNTAX_TYPE_MATCH_ERROR_GOT_SCALAR] = "Attempted to give a scalar to a non-scalar type", + [SYNTAX_TYPE_MATCH_ERROR_GOT_LIST] = "Attempted to give a list to a non-list type", ++ [SYNTAX_TYPE_MATCH_ERROR_GOT_NULL] = "Attempted to give a value of type null", + + [SYNTAX_TYPE_MATCH_ERROR_STRING_UNIX_PERMISSION] = "Error parsing Unix permission string", + +@@ -266,7 +267,7 @@ + [SYNTAX_TYPE_MATCH_ERROR_INT_PARSE] = "Cannot parse value as integer", + [SYNTAX_TYPE_MATCH_ERROR_INT_OUT_OF_RANGE] = "Integer is out of range", + +- [SYNTAX_TYPE_MATCH_ERROR_REAL_INF] = "Keyword \"inf\" has an integer value, cannot be used as real", ++ [SYNTAX_TYPE_MATCH_ERROR_REAL_INF] = "Keyword 'inf' has an integer value, cannot be used as real", + [SYNTAX_TYPE_MATCH_ERROR_REAL_OUT_OF_RANGE] = "Real value is out of range", + + [SYNTAX_TYPE_MATCH_ERROR_OPTS_OUT_OF_RANGE] = "Selection is out of bounds", +@@ -355,8 +356,10 @@ + return SYNTAX_TYPE_MATCH_OK; + + case RVAL_TYPE_CONTAINER: +- case RVAL_TYPE_NOPROMISEE: + break; ++ ++ case RVAL_TYPE_NOPROMISEE: ++ return SYNTAX_TYPE_MATCH_ERROR_GOT_NULL; + } + + /* If we get here, we have a literal scalar type */ +diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/libpromises/syntax.h ./libpromises/syntax.h +--- ../orig-core-3.6.0b2/libpromises/syntax.h 2014-03-17 17:37:49.000000000 +0100 ++++ ./libpromises/syntax.h 2014-04-10 16:12:06.104406735 +0200 +@@ -46,6 +46,7 @@ + SYNTAX_TYPE_MATCH_ERROR_RANGE_MULTIPLE_ITEMS, + SYNTAX_TYPE_MATCH_ERROR_GOT_SCALAR, + SYNTAX_TYPE_MATCH_ERROR_GOT_LIST, ++ SYNTAX_TYPE_MATCH_ERROR_GOT_NULL, + + SYNTAX_TYPE_MATCH_ERROR_SCALAR_OUT_OF_RANGE, + SYNTAX_TYPE_MATCH_ERROR_EMPTY_SCALAR_OUT_OF_RANGE, +diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/tests/unit/syntax_test.c ./tests/unit/syntax_test.c +--- ../orig-core-3.6.0b2/tests/unit/syntax_test.c 2014-03-17 17:37:49.000000000 +0100 ++++ ./tests/unit/syntax_test.c 2014-04-10 16:13:24.055666621 +0200 +@@ -88,6 +88,13 @@ + assert_string_equal("delete_if_startwith_from_list", y->lval); + } + ++static void test_typecheck_null_rval(void) ++{ ++ SyntaxTypeMatch err = CheckConstraintTypeMatch("whatever", (Rval) { NULL, RVAL_TYPE_NOPROMISEE }, ++ CF_DATA_TYPE_STRING, "abc", 0); ++ assert_int_equal(SYNTAX_TYPE_MATCH_ERROR_GOT_NULL, err); ++} ++ + int main() + { + PRINT_TEST_BANNER(); +@@ -105,7 +112,9 @@ + unit_test(test_lookup_body_process_count), + unit_test(test_lookup_body_delete_select), + +- unit_test(test_lookup_constraint_edit_xml_set_attribute_attribute_value) ++ unit_test(test_lookup_constraint_edit_xml_set_attribute_attribute_value), ++ ++ unit_test(test_typecheck_null_rval) + }; + + return run_tests(tests); diff --git a/0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch b/0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch new file mode 100644 index 0000000..d95d8b5 --- /dev/null +++ b/0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch @@ -0,0 +1,304 @@ +From 882bf55c88e3fb6c38e2952fad272607a0900198 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= +Date: Wed, 9 Apr 2014 17:00:23 +0200 +Subject: [PATCH 7/7] Simplify and fix parsing of /etc/SuSE-release (fixes + issue #5423) + +This patch is a simplification of sysinfo.c:Linux_Suse_Version() +to achieve the following + +- distinction between "SUSE Linux Enterprise Server" (sles) and "... Desktop" (sled) +- distinction between SUSE Linux Enterprise products (suse) and openSUSE (opensuse) +- extract version from VERSION and PATCHLEVEL lines instead of + first line of /etc/SuSE-release +- verified for sles version 9,10,11,12; sled versions 10,11,12, openSUSE 13.1 +--- +diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/libenv/sysinfo.c ./libenv/sysinfo.c +--- ../orig-core-3.6.0b2/libenv/sysinfo.c 2014-03-17 17:37:49.000000000 +0100 ++++ ./libenv/sysinfo.c 2014-04-10 16:26:49.389330253 +0200 +@@ -1639,221 +1639,143 @@ + #define SUSE_SLED_ID "suse linux enterprise desktop" + #define SUSE_RELEASE_FLAG "linux " + +-/* The full string read in from SuSE-release */ +- char relstring[CF_MAXVARSIZE]; + char classbuf[CF_MAXVARSIZE]; +- char vbuf[CF_BUFSIZE], strversion[CF_MAXVARSIZE], strpatch[CF_MAXVARSIZE]; +- +-/* Where the numerical release will be found */ +- char *release = NULL; +- int i, version; +- int major = -1; +- char strmajor[CF_MAXVARSIZE]; +- int minor = -1; +- char strminor[CF_MAXVARSIZE]; +- FILE *fp; ++ char *vendor = "suse"; + + Log(LOG_LEVEL_VERBOSE, "This appears to be a SUSE system."); + EvalContextClassPutHard(ctx, "SUSE", "inventory,attribute_name=none,source=agent"); ++ EvalContextClassPutHard(ctx, "suse", "inventory,attribute_name=none,source=agent"); + + /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". + * Keep this for backwards compatibility until CFEngine 3.7 + */ + EvalContextClassPutHard(ctx, "SuSE", "inventory,attribute_name=none,source=agent"); + +-/* Grab the first line from the file and then close it. */ ++ /* Grab the first line from the SuSE-release file and then close it. */ ++ char relstring[CF_MAXVARSIZE]; + +- fp = ReadFirstLine(SUSE_REL_FILENAME, relstring, sizeof(relstring)); ++ FILE *fp = ReadFirstLine(SUSE_REL_FILENAME, relstring, sizeof(relstring)); + if (fp == NULL) + { + return 1; + } + +- strversion[0] = '\0'; +- strpatch[0] = '\0'; ++ char vbuf[CF_BUFSIZE]; + +- for(;;) ++ int major = -1, minor = -1; ++ while (fgets(vbuf, sizeof(vbuf), fp) != NULL) + { +- if (fgets(vbuf, sizeof(vbuf), fp) == NULL) +- { +- if (ferror(fp)) ++ if (strncmp(vbuf, "VERSION", strlen("version")) == 0) + { +- UnexpectedError("Failed to read line from stream"); +- break; ++ int res; ++ res = sscanf(vbuf, "VERSION = %d.%d", &major, &minor); ++ Log(LOG_LEVEL_VERBOSE, "VERSION sscanf returned %d.", res); ++ if (res < 1) ++ major = -1; ++ else if (res < 2) ++ minor = -1; + } +- else /* feof */ ++ ++ if (strncmp(vbuf, "PATCH", strlen("PATCH")) == 0) + { +- break; ++ if (sscanf(vbuf, "PATCHLEVEL = %d", &minor) != 1) ++ minor = -1; + } + } +- +- if (strncmp(vbuf, "VERSION", strlen("version")) == 0) ++ if (ferror(fp)) + { +- strncpy(strversion, vbuf, sizeof(strversion)); +- sscanf(strversion, "VERSION = %d", &major); ++ UnexpectedError("Failed to read line from stream"); + } +- +- if (strncmp(vbuf, "PATCH", strlen("PATCH")) == 0) ++ else + { +- strncpy(strpatch, vbuf, sizeof(strpatch)); +- sscanf(strpatch, "PATCHLEVEL = %d", &minor); +- } ++ assert(feof(fp)); + } + + fclose(fp); + +- /* Check if it's a SUSE Enterprise version */ +- +- Log(LOG_LEVEL_VERBOSE, "Looking for SUSE enterprise info in '%s'", relstring); +- +- /* Convert relstring to lowercase to handle rename of SuSE to +- * SUSE with SUSE 10.0. +- */ +- +- for (i = 0; i < strlen(relstring); i++) +- { +- relstring[i] = tolower(relstring[i]); +- } ++ /* Check which SUSE/openSUSE product it is */ + +- /* Check if it's a SUSE Enterprise version (all in lowercase) */ ++ Log(LOG_LEVEL_VERBOSE, "Looking for SUSE product info in '%s'", relstring); + +- if (!strncmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID))) ++ if (!strncasecmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID))) + { + classbuf[0] = '\0'; + strcat(classbuf, "SLES8"); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + } +- else if (strncmp(relstring, "sles", 4) == 0) +- { +- Item *list, *ip; +- +- sscanf(relstring, "%[-_a-zA-Z0-9]", vbuf); +- EvalContextClassPutHard(ctx, vbuf, "inventory,attribute_name=none,source=agent"); +- +- list = SplitString(vbuf, '-'); +- +- for (ip = list; ip != NULL; ip = ip->next) +- { +- EvalContextClassPutHard(ctx, ip->name, "inventory,attribute_name=none,source=agent"); +- } +- +- DeleteItemList(list); +- } +- else ++ else if (!strncasecmp(relstring, SUSE_SLES_ID, strlen(SUSE_SLES_ID))) + { +- for (version = 9; version < 13; version++) ++ EvalContextClassPutHard(ctx, "sles", "inventory,attribute_name=none,source=agent"); ++ if (major != -1) + { +- snprintf(vbuf, CF_BUFSIZE, "%s %d ", SUSE_SLES_ID, version); +- Log(LOG_LEVEL_DEBUG, "Checking for SUSE [%s]", vbuf); +- +- if (!strncmp(relstring, vbuf, strlen(vbuf))) +- { +- snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", version); ++ snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", major); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + } +- else ++ } ++ else if (!strncasecmp(relstring, SUSE_SLED_ID, strlen(SUSE_SLED_ID))) + { +- snprintf(vbuf, CF_BUFSIZE, "%s %d ", SUSE_SLED_ID, version); +- Log(LOG_LEVEL_DEBUG, "Checking for SUSE [%s]", vbuf); +- +- if (!strncmp(relstring, vbuf, strlen(vbuf))) ++ EvalContextClassPutHard(ctx, "sled", "inventory,attribute_name=none,source=agent"); ++ if (major != -1) + { +- snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", version); ++ snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", major); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + } + } ++ else if (!strncasecmp(relstring, "opensuse", strlen("opensuse"))) ++ { ++ vendor = "opensuse"; ++ EvalContextClassPutHard(ctx, vendor, "inventory,attribute_name=none,source=agent"); + } +- } +- +- /* Determine release version. We assume that the version follows +- * the string "SuSE Linux" or "SUSE LINUX". +- */ ++ else if (strncasecmp(relstring, "sles", 4) == 0) ++ { ++ Item *list, *ip; + +- release = strstr(relstring, SUSE_RELEASE_FLAG); ++ sscanf(relstring, "%[-_a-zA-Z0-9]", vbuf); ++ EvalContextClassPutHard(ctx, vbuf, "inventory,attribute_name=none,source=agent"); + +- if (release == NULL) +- { +- release = strstr(relstring, "opensuse"); +- } ++ list = SplitString(vbuf, '-'); + +- if (release == NULL) ++ for (ip = list; ip != NULL; ip = ip->next) + { +- release = strversion; ++ EvalContextClassPutHard(ctx, ip->name, "inventory,attribute_name=none,source=agent"); + } + +- if (release == NULL) +- { +- Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME); +- return 2; ++ DeleteItemList(list); + } + else + { +- if (strchr(release, '.')) +- { +- sscanf(release, "%*s %d.%d", &major, &minor); +- sprintf(strmajor, "%d", major); +- sprintf(strminor, "%d", minor); ++ Log(LOG_LEVEL_WARNING, "Unknown product '%s' in /etc/SuSE-release", relstring); ++ } + +- if (major != -1 && minor != -1) ++ if (major != -1) + { +- strcpy(classbuf, "SUSE"); ++ strcpy(classbuf, vendor); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- strcat(classbuf, "_"); +- strcat(classbuf, strmajor); ++ sprintf(classbuf + strlen(classbuf), "_%d", major); + SetFlavour(ctx, classbuf); +- strcat(classbuf, "_"); +- strcat(classbuf, strminor); ++ if (minor != -1) ++ { ++ sprintf(classbuf + strlen(classbuf), "_%d", minor); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- ++ } + /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". + * Keep this for backwards compatibility until CFEngine 3.7 + */ + strcpy(classbuf, "SuSE"); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- strcat(classbuf, "_"); +- strcat(classbuf, strmajor); ++ sprintf(classbuf + strlen(classbuf), "_%d", major); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- strcat(classbuf, "_"); +- strcat(classbuf, strminor); ++ if (minor != -1) ++ { ++ sprintf(classbuf + strlen(classbuf), "_%d", minor); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- +- Log(LOG_LEVEL_VERBOSE, "Discovered SUSE version %s", classbuf); +- return 0; + } ++ Log(LOG_LEVEL_VERBOSE, "Discovered %s version %d.%d", vendor, major, minor); + } + else + { +- sscanf(strversion, "VERSION = %s", strmajor); +- sscanf(strpatch, "PATCHLEVEL = %s", strminor); +- +- if (major != -1 && minor != -1) +- { +- strcpy(classbuf, "SLES"); +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- strcat(classbuf, "_"); +- strcat(classbuf, strmajor); +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- strcat(classbuf, "_"); +- strcat(classbuf, strminor); +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- +- snprintf(classbuf, CF_MAXVARSIZE, "SUSE_%d", major); +- SetFlavour(ctx, classbuf); +- +- /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". +- * Keep this for backwards compatibility until CFEngine 3.7 +- */ +- snprintf(classbuf, CF_MAXVARSIZE, "SuSE_%d", major); +- EvalContextClassPutHard(ctx, classbuf, "source=agent"); +- +- Log(LOG_LEVEL_VERBOSE, "Discovered SUSE version %s", classbuf); +- return 0; +- } +- } +- } +- + Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME); +- ++ } + return 0; + } + diff --git a/cfengine.changes b/cfengine.changes index 112d665..8b5295a 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,16 +1,25 @@ +------------------------------------------------------------------- +Thu Apr 10 14:02:11 UTC 2014 - kkaempf@suse.com + +- add 0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch + to prevent crash on syntax error + +- add 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch + * add 'suse' class for consistency with other vendor classes + (fixes #5417) + * distinction between "SUSE Linux Enterprise Server" (sles) and + "... Desktop" (sled) + * distinction between SUSE Linux Enterprise products (suse) and + openSUSE (opensuse) + * extract version from VERSION and PATCHLEVEL lines instead of + first line of /etc/SuSE-release + ------------------------------------------------------------------- Fri Apr 4 19:36:47 UTC 2014 - kkaempf@suse.com -- move cf-serverd to cfengine, required for bootstrap - -------------------------------------------------------------------- -Fri Apr 4 19:30:04 UTC 2014 - kkaempf@suse.com - -- Parse /etc/os-release for product and version - Add patch 0001-Check-etc-os-release-for-distribution-information.patch - -- Parse /proc/1/cmdline to detect systemd - 0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch +- merge cfengine-server with cfengine. A policy server only + gets cfengine-masterfiles but is otherwise identical to + a client. ------------------------------------------------------------------- Thu Apr 3 13:10:56 UTC 2014 - kkaempf@suse.com diff --git a/cfengine.spec b/cfengine.spec index e0b130c..e5bed0b 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -75,11 +75,11 @@ Patch2: remove-am_subst_notmake.patch # kkaempf@suse.de Patch3: drop-revision.patch -# parse /etc/os-release for product and version information, kkaempf@suse.de -Patch4: 0001-Check-etc-os-release-for-distribution-information.patch - -# parse /proc/1/cmdline to detect systemd -Patch5: 0001-Evaluate-proc-1-cmdline-and-check-for-systemd.patch +# PATCH-FIX-UPSTREAM fix crash on syntax error +Patch4: 0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch +# PATCH-FIX-UPSTREAM add 'suse' class for consistency with other vendor classes +# PATCH-FEATURE-UPSTREAM better /etc/SuSE-release parsing, upstream #5423 +Patch5: 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison @@ -183,16 +183,6 @@ Group: Documentation/Other %description examples Lots of examples promises for CFEngine. -%package server -Summary: CFEngine policy server master package -Group: Productivity/Networking/System -Requires: %{name} = %{version}-%{release} -Requires: %{name}-masterfiles = %{version} - -%description server -This package contains the files and requirements of the cfengine policy server. - - %prep %setup -q -n %{srcname}-%{version} %if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel_version} @@ -228,7 +218,7 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ --datadir=/var \ --with-workdir=%{workdir} \ --with-postgresql \ -%if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0 +%if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0 && 0%{?fedora_version} != 20 --with-mysql \ %endif --without-qdbm \ @@ -414,6 +404,7 @@ fi %{_sbindir}/cf-promises %{_sbindir}/cf-serverd %{_sbindir}/cf-upgrade +%{_sbindir}/cf-runagent %{_sbindir}/rpmvercmp %if 0%{?suse_version} >= 1210 %_unitdir/cf-execd.service @@ -425,21 +416,15 @@ fi %{_sbindir}/rccf-monitord %{_sbindir}/rccf-serverd %endif -%{_mandir}/man8/cf-serverd.8.* %if 0%{?suse_version} > 1010 %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine %endif %{_mandir}/man8/* -%exclude %{_mandir}/man8/cf-runagent.8.* %dir %{basedir} -%exclude %{basedir}/backup -%exclude %{basedir}/config -#%%exclude %%{basedir}/failsafe %dir %{workdir} %{workdir}/* -%exclude %{workdir}/bin/cf-runagent %config(noreplace) /etc/cron.d/%{name} @@ -460,12 +445,4 @@ fi %defattr(-,root,root) %doc examples/*cf -%files server -%defattr(-,root,root) -%{basedir}/backup -%{basedir}/config -%{_sbindir}/cf-runagent -%{workdir}/bin/cf-runagent -%{_mandir}/man8/cf-runagent.8.* - %changelog From 0b2dd06478d01cec25e74209351801c25b7716a9af1b12d99641e23a62dd02b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Fri, 11 Apr 2014 07:32:56 +0000 Subject: [PATCH 25/26] - Upgrade to 3.6.0rc Bugfix release - add 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=90 --- ...-parsing-of-etc-SuSE-release-fixes-i.patch | 326 ++++++++---------- ...segfault-on-type-checking-NULL-Rvals.patch | 84 ----- cfengine.changes | 11 +- cfengine.spec | 15 +- core-3.6.0b2.tar.gz | 3 - core-3.6rc.tar.gz | 3 + drop-revision.patch | 10 +- libacl-headers.patch | 13 - 8 files changed, 161 insertions(+), 304 deletions(-) rename 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch => 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch (57%) delete mode 100644 0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch delete mode 100644 core-3.6.0b2.tar.gz create mode 100644 core-3.6rc.tar.gz delete mode 100644 libacl-headers.patch diff --git a/0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch b/0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch similarity index 57% rename from 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch rename to 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch index d95d8b5..0e1b64b 100644 --- a/0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch +++ b/0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch @@ -1,8 +1,8 @@ -From 882bf55c88e3fb6c38e2952fad272607a0900198 Mon Sep 17 00:00:00 2001 +From 2790065efcf484d5b51e2f5ab410983d9f37c74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= -Date: Wed, 9 Apr 2014 17:00:23 +0200 -Subject: [PATCH 7/7] Simplify and fix parsing of /etc/SuSE-release (fixes - issue #5423) +Date: Fri, 11 Apr 2014 09:25:05 +0200 +Subject: [PATCH] Simplify and fix parsing of /etc/SuSE-release (fixes issue + #5423) This patch is a simplification of sysinfo.c:Linux_Suse_Version() to achieve the following @@ -13,63 +13,37 @@ to achieve the following first line of /etc/SuSE-release - verified for sles version 9,10,11,12; sled versions 10,11,12, openSUSE 13.1 --- -diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/libenv/sysinfo.c ./libenv/sysinfo.c ---- ../orig-core-3.6.0b2/libenv/sysinfo.c 2014-03-17 17:37:49.000000000 +0100 -+++ ./libenv/sysinfo.c 2014-04-10 16:26:49.389330253 +0200 -@@ -1639,221 +1639,143 @@ - #define SUSE_SLED_ID "suse linux enterprise desktop" + libenv/sysinfo.c | 187 ++++++++++++++++++------------------------------------- + 1 file changed, 60 insertions(+), 127 deletions(-) + +diff --git a/libenv/sysinfo.c b/libenv/sysinfo.c +index 72eb71f75d8d..6f2a05fc4cdd 100644 +--- a/libenv/sysinfo.c ++++ b/libenv/sysinfo.c +@@ -1629,6 +1629,7 @@ static int Linux_Suse_Version(EvalContext *ctx) #define SUSE_RELEASE_FLAG "linux " --/* The full string read in from SuSE-release */ -- char relstring[CF_MAXVARSIZE]; char classbuf[CF_MAXVARSIZE]; -- char vbuf[CF_BUFSIZE], strversion[CF_MAXVARSIZE], strpatch[CF_MAXVARSIZE]; -- --/* Where the numerical release will be found */ -- char *release = NULL; -- int i, version; -- int major = -1; -- char strmajor[CF_MAXVARSIZE]; -- int minor = -1; -- char strminor[CF_MAXVARSIZE]; -- FILE *fp; + char *vendor = "suse"; Log(LOG_LEVEL_VERBOSE, "This appears to be a SUSE system."); EvalContextClassPutHard(ctx, "SUSE", "inventory,attribute_name=none,source=agent"); -+ EvalContextClassPutHard(ctx, "suse", "inventory,attribute_name=none,source=agent"); - - /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". - * Keep this for backwards compatibility until CFEngine 3.7 - */ - EvalContextClassPutHard(ctx, "SuSE", "inventory,attribute_name=none,source=agent"); - --/* Grab the first line from the file and then close it. */ -+ /* Grab the first line from the SuSE-release file and then close it. */ -+ char relstring[CF_MAXVARSIZE]; - -- fp = ReadFirstLine(SUSE_REL_FILENAME, relstring, sizeof(relstring)); -+ FILE *fp = ReadFirstLine(SUSE_REL_FILENAME, relstring, sizeof(relstring)); - if (fp == NULL) - { +@@ -1648,23 +1649,26 @@ static int Linux_Suse_Version(EvalContext *ctx) return 1; } +- char vbuf[CF_BUFSIZE], strversion[CF_MAXVARSIZE], strpatch[CF_MAXVARSIZE]; - strversion[0] = '\0'; - strpatch[0] = '\0'; + char vbuf[CF_BUFSIZE]; -- for(;;) -+ int major = -1, minor = -1; -+ while (fgets(vbuf, sizeof(vbuf), fp) != NULL) + int major = -1, minor = -1; + while (fgets(vbuf, sizeof(vbuf), fp) != NULL) { -- if (fgets(vbuf, sizeof(vbuf), fp) == NULL) -- { -- if (ferror(fp)) -+ if (strncmp(vbuf, "VERSION", strlen("version")) == 0) - { -- UnexpectedError("Failed to read line from stream"); -- break; + if (strncmp(vbuf, "VERSION", strlen("version")) == 0) + { +- strlcpy(strversion, vbuf, sizeof(strversion)); +- sscanf(vbuf, "VERSION = %d", &major); + int res; + res = sscanf(vbuf, "VERSION = %d.%d", &major, &minor); + Log(LOG_LEVEL_VERBOSE, "VERSION sscanf returned %d.", res); @@ -77,196 +51,181 @@ diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache + major = -1; + else if (res < 2) + minor = -1; - } -- else /* feof */ -+ -+ if (strncmp(vbuf, "PATCH", strlen("PATCH")) == 0) - { -- break; + } + + if (strncmp(vbuf, "PATCH", strlen("PATCH")) == 0) + { +- strlcpy(strpatch, vbuf, sizeof(strpatch)); +- sscanf(vbuf, "PATCHLEVEL = %d", &minor); + if (sscanf(vbuf, "PATCHLEVEL = %d", &minor) != 1) + minor = -1; - } } -- -- if (strncmp(vbuf, "VERSION", strlen("version")) == 0) -+ if (ferror(fp)) - { -- strncpy(strversion, vbuf, sizeof(strversion)); -- sscanf(strversion, "VERSION = %d", &major); -+ UnexpectedError("Failed to read line from stream"); - } -- -- if (strncmp(vbuf, "PATCH", strlen("PATCH")) == 0) -+ else - { -- strncpy(strpatch, vbuf, sizeof(strpatch)); -- sscanf(strpatch, "PATCHLEVEL = %d", &minor); -- } -+ assert(feof(fp)); } + if (ferror(fp)) +@@ -1678,28 +1682,38 @@ static int Linux_Suse_Version(EvalContext *ctx) fclose(fp); - /* Check if it's a SUSE Enterprise version */ -- ++ /* Check which SUSE/openSUSE product it is */ + - Log(LOG_LEVEL_VERBOSE, "Looking for SUSE enterprise info in '%s'", relstring); -- ++ Log(LOG_LEVEL_VERBOSE, "Looking for SUSE product info in '%s'", relstring); + - /* Convert relstring to lowercase to handle rename of SuSE to - * SUSE with SUSE 10.0. - */ - -- for (i = 0; i < strlen(relstring); i++) -- { -- relstring[i] = tolower(relstring[i]); -- } -+ /* Check which SUSE/openSUSE product it is */ - -- /* Check if it's a SUSE Enterprise version (all in lowercase) */ -+ Log(LOG_LEVEL_VERBOSE, "Looking for SUSE product info in '%s'", relstring); - -- if (!strncmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID))) +- for (int i = 0; i < strlen(relstring); i++) + if (!strncasecmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID))) { - classbuf[0] = '\0'; - strcat(classbuf, "SLES8"); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- relstring[i] = tolower(relstring[i]); ++ EvalContextClassPutHard(ctx, "SLES8", "inventory,attribute_name=none,source=agent"); } -- else if (strncmp(relstring, "sles", 4) == 0) -- { -- Item *list, *ip; - -- sscanf(relstring, "%[-_a-zA-Z0-9]", vbuf); -- EvalContextClassPutHard(ctx, vbuf, "inventory,attribute_name=none,source=agent"); +- /* Check if it's a SUSE Enterprise version (all in lowercase) */ - -- list = SplitString(vbuf, '-'); -- -- for (ip = list; ip != NULL; ip = ip->next) -- { -- EvalContextClassPutHard(ctx, ip->name, "inventory,attribute_name=none,source=agent"); -- } -- -- DeleteItemList(list); -- } -- else +- if (!strncmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID))) + else if (!strncasecmp(relstring, SUSE_SLES_ID, strlen(SUSE_SLES_ID))) { -- for (version = 9; version < 13; version++) +- classbuf[0] = '\0'; +- strcat(classbuf, "SLES8"); +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + EvalContextClassPutHard(ctx, "sles", "inventory,attribute_name=none,source=agent"); + if (major != -1) - { ++ { ++ snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", major); ++ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); ++ } ++ } ++ else if (!strncasecmp(relstring, SUSE_SLED_ID, strlen(SUSE_SLED_ID))) ++ { ++ EvalContextClassPutHard(ctx, "sled", "inventory,attribute_name=none,source=agent"); ++ if (major != -1) ++ { ++ snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", major); ++ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); ++ } ++ } ++ else if (!strncasecmp(relstring, "opensuse", strlen("opensuse"))) ++ { ++ vendor = "opensuse"; ++ EvalContextClassPutHard(ctx, vendor, "inventory,attribute_name=none,source=agent"); + } +- else if (strncmp(relstring, "sles", 4) == 0) ++ else if (strncasecmp(relstring, "sles", 4) == 0) + { + Item *list, *ip; + +@@ -1717,120 +1731,39 @@ static int Linux_Suse_Version(EvalContext *ctx) + } + else + { +- for (int version = 9; version < 13; version++) +- { - snprintf(vbuf, CF_BUFSIZE, "%s %d ", SUSE_SLES_ID, version); - Log(LOG_LEVEL_DEBUG, "Checking for SUSE [%s]", vbuf); - - if (!strncmp(relstring, vbuf, strlen(vbuf))) - { - snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", version); -+ snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", major); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - } +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- } - else -+ } -+ else if (!strncasecmp(relstring, SUSE_SLED_ID, strlen(SUSE_SLED_ID))) - { +- { - snprintf(vbuf, CF_BUFSIZE, "%s %d ", SUSE_SLED_ID, version); - Log(LOG_LEVEL_DEBUG, "Checking for SUSE [%s]", vbuf); - - if (!strncmp(relstring, vbuf, strlen(vbuf))) -+ EvalContextClassPutHard(ctx, "sled", "inventory,attribute_name=none,source=agent"); -+ if (major != -1) - { +- { - snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", version); -+ snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", major); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - } - } -+ else if (!strncasecmp(relstring, "opensuse", strlen("opensuse"))) -+ { -+ vendor = "opensuse"; -+ EvalContextClassPutHard(ctx, vendor, "inventory,attribute_name=none,source=agent"); - } -- } -- +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- } +- } +- } ++ Log(LOG_LEVEL_WARNING, "Unknown product '%s' in /etc/SuSE-release", relstring); + } + - /* Determine release version. We assume that the version follows - * the string "SuSE Linux" or "SUSE LINUX". - */ -+ else if (strncasecmp(relstring, "sles", 4) == 0) -+ { -+ Item *list, *ip; - -- release = strstr(relstring, SUSE_RELEASE_FLAG); -+ sscanf(relstring, "%[-_a-zA-Z0-9]", vbuf); -+ EvalContextClassPutHard(ctx, vbuf, "inventory,attribute_name=none,source=agent"); - +- +- char *release = strstr(relstring, SUSE_RELEASE_FLAG); - if (release == NULL) -- { -- release = strstr(relstring, "opensuse"); -- } -+ list = SplitString(vbuf, '-'); - -- if (release == NULL) -+ for (ip = list; ip != NULL; ip = ip->next) ++ if (major != -1) { -- release = strversion; -+ EvalContextClassPutHard(ctx, ip->name, "inventory,attribute_name=none,source=agent"); - } - +- release = strstr(relstring, "opensuse"); +- if (release == NULL) ++ strncpy(classbuf, vendor, CF_MAXVARSIZE); ++ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); ++ snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", major); ++ SetFlavour(ctx, classbuf); ++ if (minor != -1) + { +- release = strversion; ++ snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", minor); ++ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + } +- } +- - if (release == NULL) - { -- Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME); +- Log(LOG_LEVEL_VERBOSE, +- "Could not find a numeric OS release in %s", +- SUSE_REL_FILENAME); - return 2; -+ DeleteItemList(list); ++ /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". ++ * Keep this for backwards compatibility until CFEngine 3.7 ++ */ ++ strncpy(classbuf, "SuSE", CF_MAXVARSIZE); ++ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); ++ snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", major); ++ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); ++ if (minor != -1) ++ { ++ snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", minor); ++ EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); ++ } ++ Log(LOG_LEVEL_VERBOSE, "Discovered %s version %d.%d", vendor, major, minor); } else { +- char strmajor[PRINTSIZE(major)], strminor[PRINTSIZE(minor)]; - if (strchr(release, '.')) - { - sscanf(release, "%*s %d.%d", &major, &minor); - sprintf(strmajor, "%d", major); - sprintf(strminor, "%d", minor); -+ Log(LOG_LEVEL_WARNING, "Unknown product '%s' in /etc/SuSE-release", relstring); -+ } - -- if (major != -1 && minor != -1) -+ if (major != -1) - { -- strcpy(classbuf, "SUSE"); -+ strcpy(classbuf, vendor); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); -- strcat(classbuf, "_"); -- strcat(classbuf, strmajor); -+ sprintf(classbuf + strlen(classbuf), "_%d", major); - SetFlavour(ctx, classbuf); -- strcat(classbuf, "_"); -- strcat(classbuf, strminor); -+ if (minor != -1) -+ { -+ sprintf(classbuf + strlen(classbuf), "_%d", minor); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - -+ } - /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". - * Keep this for backwards compatibility until CFEngine 3.7 - */ - strcpy(classbuf, "SuSE"); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- if (major != -1 && minor != -1) +- { +- strcpy(classbuf, "SUSE"); +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - strcat(classbuf, "_"); - strcat(classbuf, strmajor); -+ sprintf(classbuf + strlen(classbuf), "_%d", major); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- SetFlavour(ctx, classbuf); - strcat(classbuf, "_"); - strcat(classbuf, strminor); -+ if (minor != -1) -+ { -+ sprintf(classbuf + strlen(classbuf), "_%d", minor); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- +- /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". +- * Keep this for backwards compatibility until CFEngine 3.7 +- */ +- strcpy(classbuf, "SuSE"); +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- strcat(classbuf, "_"); +- strcat(classbuf, strmajor); +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); +- strcat(classbuf, "_"); +- strcat(classbuf, strminor); +- EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - - Log(LOG_LEVEL_VERBOSE, "Discovered SUSE version %s", classbuf); - return 0; - } -+ Log(LOG_LEVEL_VERBOSE, "Discovered %s version %d.%d", vendor, major, minor); - } - else - { +- } +- } +- else +- { - sscanf(strversion, "VERSION = %s", strmajor); - sscanf(strpatch, "PATCHLEVEL = %s", strminor); - @@ -294,11 +253,14 @@ diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache - return 0; - } - } -- } ++ Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME); + } + +- Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME); - - Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME); -- -+ } return 0; } +-- +1.8.4.5 + diff --git a/0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch b/0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch deleted file mode 100644 index bee5784..0000000 --- a/0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch +++ /dev/null @@ -1,84 +0,0 @@ -From cc963ee8af0408d902c7956414c4d1c54a902805 Mon Sep 17 00:00:00 2001 -From: Sigurd Teigen -Date: Tue, 8 Apr 2014 12:53:04 -0400 -Subject: [PATCH 2/7] Do not segfault on type checking NULL Rvals. - -Add unit test. Close #5416 ---- -diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/libpromises/syntax.c ./libpromises/syntax.c ---- ../orig-core-3.6.0b2/libpromises/syntax.c 2014-03-17 17:37:49.000000000 +0100 -+++ ./libpromises/syntax.c 2014-04-10 16:12:06.104406735 +0200 -@@ -253,10 +253,11 @@ - [SYNTAX_TYPE_MATCH_OK] = "OK", - - [SYNTAX_TYPE_MATCH_ERROR_UNEXPANDED] = "Cannot check unexpanded value", -- [SYNTAX_TYPE_MATCH_ERROR_RANGE_BRACKETED] = "Real range specification should not be enclosed in brackets - just \"a,b\"", -- [SYNTAX_TYPE_MATCH_ERROR_RANGE_MULTIPLE_ITEMS] = "Range format specifier should be of form \"a,b\" but got multiple items", -+ [SYNTAX_TYPE_MATCH_ERROR_RANGE_BRACKETED] = "Real range specification should not be enclosed in brackets - just 'a,b'", -+ [SYNTAX_TYPE_MATCH_ERROR_RANGE_MULTIPLE_ITEMS] = "Range format specifier should be of form 'a,b'' but got multiple items", - [SYNTAX_TYPE_MATCH_ERROR_GOT_SCALAR] = "Attempted to give a scalar to a non-scalar type", - [SYNTAX_TYPE_MATCH_ERROR_GOT_LIST] = "Attempted to give a list to a non-list type", -+ [SYNTAX_TYPE_MATCH_ERROR_GOT_NULL] = "Attempted to give a value of type null", - - [SYNTAX_TYPE_MATCH_ERROR_STRING_UNIX_PERMISSION] = "Error parsing Unix permission string", - -@@ -266,7 +267,7 @@ - [SYNTAX_TYPE_MATCH_ERROR_INT_PARSE] = "Cannot parse value as integer", - [SYNTAX_TYPE_MATCH_ERROR_INT_OUT_OF_RANGE] = "Integer is out of range", - -- [SYNTAX_TYPE_MATCH_ERROR_REAL_INF] = "Keyword \"inf\" has an integer value, cannot be used as real", -+ [SYNTAX_TYPE_MATCH_ERROR_REAL_INF] = "Keyword 'inf' has an integer value, cannot be used as real", - [SYNTAX_TYPE_MATCH_ERROR_REAL_OUT_OF_RANGE] = "Real value is out of range", - - [SYNTAX_TYPE_MATCH_ERROR_OPTS_OUT_OF_RANGE] = "Selection is out of bounds", -@@ -355,8 +356,10 @@ - return SYNTAX_TYPE_MATCH_OK; - - case RVAL_TYPE_CONTAINER: -- case RVAL_TYPE_NOPROMISEE: - break; -+ -+ case RVAL_TYPE_NOPROMISEE: -+ return SYNTAX_TYPE_MATCH_ERROR_GOT_NULL; - } - - /* If we get here, we have a literal scalar type */ -diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/libpromises/syntax.h ./libpromises/syntax.h ---- ../orig-core-3.6.0b2/libpromises/syntax.h 2014-03-17 17:37:49.000000000 +0100 -+++ ./libpromises/syntax.h 2014-04-10 16:12:06.104406735 +0200 -@@ -46,6 +46,7 @@ - SYNTAX_TYPE_MATCH_ERROR_RANGE_MULTIPLE_ITEMS, - SYNTAX_TYPE_MATCH_ERROR_GOT_SCALAR, - SYNTAX_TYPE_MATCH_ERROR_GOT_LIST, -+ SYNTAX_TYPE_MATCH_ERROR_GOT_NULL, - - SYNTAX_TYPE_MATCH_ERROR_SCALAR_OUT_OF_RANGE, - SYNTAX_TYPE_MATCH_ERROR_EMPTY_SCALAR_OUT_OF_RANGE, -diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/tests/unit/syntax_test.c ./tests/unit/syntax_test.c ---- ../orig-core-3.6.0b2/tests/unit/syntax_test.c 2014-03-17 17:37:49.000000000 +0100 -+++ ./tests/unit/syntax_test.c 2014-04-10 16:13:24.055666621 +0200 -@@ -88,6 +88,13 @@ - assert_string_equal("delete_if_startwith_from_list", y->lval); - } - -+static void test_typecheck_null_rval(void) -+{ -+ SyntaxTypeMatch err = CheckConstraintTypeMatch("whatever", (Rval) { NULL, RVAL_TYPE_NOPROMISEE }, -+ CF_DATA_TYPE_STRING, "abc", 0); -+ assert_int_equal(SYNTAX_TYPE_MATCH_ERROR_GOT_NULL, err); -+} -+ - int main() - { - PRINT_TEST_BANNER(); -@@ -105,7 +112,9 @@ - unit_test(test_lookup_body_process_count), - unit_test(test_lookup_body_delete_select), - -- unit_test(test_lookup_constraint_edit_xml_set_attribute_attribute_value) -+ unit_test(test_lookup_constraint_edit_xml_set_attribute_attribute_value), -+ -+ unit_test(test_typecheck_null_rval) - }; - - return run_tests(tests); diff --git a/cfengine.changes b/cfengine.changes index 8b5295a..4767066 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,10 +1,13 @@ +------------------------------------------------------------------- +Fri Apr 11 07:32:08 UTC 2014 - kkaempf@suse.com + +- Upgrade to 3.6.0rc + Bugfix release + ------------------------------------------------------------------- Thu Apr 10 14:02:11 UTC 2014 - kkaempf@suse.com -- add 0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch - to prevent crash on syntax error - -- add 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch +- add 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch * add 'suse' class for consistency with other vendor classes (fixes #5417) * distinction between "SUSE Linux Enterprise Server" (sles) and diff --git a/cfengine.spec b/cfengine.spec index e5bed0b..f3a34bb 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -20,7 +20,6 @@ Name: cfengine %define srcname core %define libname libpromises %define libsoname %{libname}3 -%define masterdirname masterfiles-%{version} # Yes, its not FHS conformant but in sync with cfengine documentation # reported upstream as https://cfengine.com/dev/issues/1896 @@ -33,14 +32,12 @@ Name: cfengine Summary: CFEngine automates large-scale IT computing infrastructure License: GPL-3.0 Group: Productivity/Networking/System -Version: 3.6.0b2 +Version: 3.6rc Release: 0 Url: http://www.cfengine.org/ Source: %{srcname}-%{version}.tar.gz Source1: %{name}.SuSEfirewall2 -BuildRequires: %{name}-masterfiles = %{version} - # wtf? SLE_11 does not honor rpmlintrc %if 0%{?suse_version} <= 1130 BuildRequires: -post-build-checks @@ -66,8 +63,6 @@ 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 -# there's no /usr/include/acl.h in SUSE or Fedora, kkaempf@suse.de -Patch1: libacl-headers.patch # SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, kkaempf@suse.de Patch2: remove-am_subst_notmake.patch @@ -75,11 +70,9 @@ Patch2: remove-am_subst_notmake.patch # kkaempf@suse.de Patch3: drop-revision.patch -# PATCH-FIX-UPSTREAM fix crash on syntax error -Patch4: 0002-Do-not-segfault-on-type-checking-NULL-Rvals.patch # PATCH-FIX-UPSTREAM add 'suse' class for consistency with other vendor classes # PATCH-FEATURE-UPSTREAM better /etc/SuSE-release parsing, upstream #5423 -Patch5: 0007-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch +Patch5: 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison @@ -185,9 +178,6 @@ Lots of examples promises for CFEngine. %prep %setup -q -n %{srcname}-%{version} -%if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel_version} -%patch1 -%endif %if 0%{?suse_version} <= 1110 %patch2 -p1 %endif @@ -195,7 +185,6 @@ Lots of examples promises for CFEngine. %patch2 -p1 %endif %patch3 -p1 -%patch4 -p1 %patch5 -p1 ##### rpmlint diff --git a/core-3.6.0b2.tar.gz b/core-3.6.0b2.tar.gz deleted file mode 100644 index e429cb0..0000000 --- a/core-3.6.0b2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:79915acb1e43a24fe8bb5bbe98b875f3dc71dc0fbae88c47818ddec1c3bc99ec -size 1376269 diff --git a/core-3.6rc.tar.gz b/core-3.6rc.tar.gz new file mode 100644 index 0000000..5f915b5 --- /dev/null +++ b/core-3.6rc.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2128b34f6cf4a3d8a3a7b8f2f31c8f7d818a15dc4445e44623e4ef0c961cbbdc +size 1412258 diff --git a/drop-revision.patch b/drop-revision.patch index 7137105..77c3e35 100644 --- a/drop-revision.patch +++ b/drop-revision.patch @@ -1,12 +1,12 @@ -diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6.0b2/configure.ac ./configure.ac ---- ../orig-core-3.6.0b2/configure.ac 2014-03-17 17:37:49.000000000 +0100 -+++ ./configure.ac 2014-03-26 17:06:24.343406133 +0100 +diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6rc/configure.ac ./configure.ac +--- ../orig-core-3.6rc/configure.ac 2014-04-10 14:27:57.000000000 +0200 ++++ ./configure.ac 2014-04-11 09:30:17.105777237 +0200 @@ -25,7 +25,7 @@ dnl _AM_SET_OPTION([tar-ustar]) --AM_INIT_AUTOMAKE(cfengine, 3.6.0b2.revision) -+AM_INIT_AUTOMAKE(cfengine, 3.6.0b2) +-AM_INIT_AUTOMAKE(cfengine, 3.6.0rc.revision) ++AM_INIT_AUTOMAKE(cfengine, 3.6.0rc) AM_MAINTAINER_MODE([enable]) AC_DEFINE(BUILD_YEAR, esyscmd([date +%Y | tr -d '\n']), "Software build year") diff --git a/libacl-headers.patch b/libacl-headers.patch deleted file mode 100644 index a93f1c7..0000000 --- a/libacl-headers.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: configure.ac -=================================================================== ---- configure.ac.orig -+++ configure.ac -@@ -396,7 +396,7 @@ AC_ARG_WITH([libacl], - if test "x$with_libacl" != xno; then - CF3_WITH_LIBRARY(libacl, [ - AC_CHECK_LIB(acl, acl_init, [], [if test "x$with_libacl" != xcheck; then AC_MSG_ERROR(Cannot find libacl library); fi]) -- AC_CHECK_HEADERS([acl.h sys/acl.h acl/libacl.h], [], [if test "x$with_libacl" != xcheck; then AC_MSG_ERROR(Cannot find libacl library headers); fi]) -+ AC_CHECK_HEADERS([sys/acl.h acl/libacl.h], [], [if test "x$with_libacl" != xcheck; then AC_MSG_ERROR(Cannot find libacl library headers); fi]) - ]) - fi - From e0943fe40a8d6c1a4737ce62520f3a77f4cb3d13a90f8c27418bc90120170542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Fri, 11 Apr 2014 07:37:22 +0000 Subject: [PATCH 26/26] Full ChangeLog at https://raw.githubusercontent.com/cfengine/core/3.6.x/ChangeLog OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=91 --- cfengine.changes | 1 + 1 file changed, 1 insertion(+) diff --git a/cfengine.changes b/cfengine.changes index 4767066..0f0949f 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -3,6 +3,7 @@ Fri Apr 11 07:32:08 UTC 2014 - kkaempf@suse.com - Upgrade to 3.6.0rc Bugfix release + Full ChangeLog at https://raw.githubusercontent.com/cfengine/core/3.6.x/ChangeLog ------------------------------------------------------------------- Thu Apr 10 14:02:11 UTC 2014 - kkaempf@suse.com