diff --git a/cfengine.changes b/cfengine.changes index 3ae00da..fb0c99a 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jul 3 13:40:52 UTC 2014 - kkaempf@suse.com + +- Decrease install size, drop mysql, postgresql, + and libvirt adapters + ------------------------------------------------------------------- Wed Jun 18 13:36:37 UTC 2014 - kkaempf@suse.com diff --git a/cfengine.spec b/cfengine.spec index 2f88cb7..94d057e 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -16,6 +16,17 @@ # +%if 0%{?suse_version} >= 1210 +%define have_systemd 1 +%else +%define have_systemd 0 +%endif + +# set to 1 to enable adapter, leave 0 for minimal cfengine +%define with_mysql 0 +%define with_postgresql 0 +%define with_libvirt 0 + Name: cfengine %define srcname core-3.6.0 %define libname libpromises @@ -42,7 +53,7 @@ Source1: %{name}.SuSEfirewall2 %if 0%{?suse_version} <= 1130 BuildRequires: -post-build-checks %endif -%if 0%{?suse_version} >= 1210 +%if %have_systemd Source7: cf-execd.service Source8: cf-monitord.service Source9: cf-serverd.service @@ -92,26 +103,36 @@ BuildRequires: pam-devel # library or disable MySQL connector. See # http://bugs.mysql.com/bug.php?id=65055 for details. # +%if %with_mysql %if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0 BuildRequires: mysql-devel %endif +%endif BuildRequires: libacl-devel +%if %with_libvirt BuildRequires: libvirt-devel +%endif BuildRequires: openssl-devel BuildRequires: pcre-devel +%if %with_postgresql BuildRequires: postgresql-devel +%endif + +%if !%have_systemd +# no systemd -> use cron %if 0%{?centos_version} || 0%{?rhel_version} Requires: vixie-cron %else Requires: cron %endif +%endif %if 0%{?suse_version} PreReq: %install_info_prereq BuildRequires: texlive %endif -%if 0%{?suse_version} >= 1210 +%if %have_systemd BuildRequires: systemd %{?systemd_requires} %endif @@ -208,9 +229,13 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ --enable-fhs \ --datadir=/var \ --with-workdir=%{workdir} \ +%if %with_postgresql --with-postgresql \ +%endif +%if %with_mysql %if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0 && 0%{?fedora_version} != 20 --with-mysql \ +%endif %endif --without-qdbm \ --without-tokyocabinet \ @@ -218,7 +243,9 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ --with-pthreads \ --with-openssl \ --with-pcre \ +%if %with_libvirt --with-libvirt \ +%endif --with-libacl \ --with-libxml2 \ %if 0%{?suse_version} >= 1110 @@ -252,10 +279,20 @@ rm -rf %{buildroot}/%{_docdir}/%{name}/examples %{__install} -d %{buildroot}/%{basedir}/{backup,failsafe,config,plugins} #%%{__install} -d %{buildroot}/%%{basedir}/config/{development,production} +%if %have_systemd +# systemd: install sample cron file in docdir +%if 0%{?suse_version} +%{__install} -D -m0644 %{S:10} %{buildroot}/%{_docdir}/%{name} +%else +%{__install} -D -m0644 %{S:10} %{buildroot}/%{_docdir}/%{name}-%{version} +%endif +%else +# no systemd -> use cron # install cron file %{__install} -D -m0644 %{S:10} %{buildroot}/%{_sysconfdir}/cron.d/%{name} +%endif -%if 0%{?suse_version} >= 1210 +%if %have_systemd # install systemd scripts %{__install} -D -m 0644 %{S:7} %{buildroot}/%_unitdir/cf-execd.service %{__install} -D -m 0644 %{S:8} %{buildroot}/%_unitdir/cf-monitord.service @@ -303,7 +340,7 @@ install -D -m 644 %{S:1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d %endif # systemd -%if 0%{?suse_version} >= 1210 +%if %have_systemd #################################################################### # Systemd @@ -397,7 +434,7 @@ fi %{_sbindir}/cf-upgrade %{_sbindir}/cf-runagent %{_sbindir}/rpmvercmp -%if 0%{?suse_version} >= 1210 +%if %have_systemd %_unitdir/cf-execd.service %_unitdir/cf-monitord.service %_unitdir/cf-serverd.service @@ -417,7 +454,9 @@ fi %dir %{workdir} %{workdir}/* +%if !%have_systemd %config(noreplace) /etc/cron.d/%{name} +%endif %files -n %{libsoname} %defattr(-,root,root)