- Proceed bit more with cleaning, the RH sections are failing to build
for couple of years. Better readability without them so prune it out - Convert the in-spec build switches to %bcond - Provide rcbla links to systemd services OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=121
This commit is contained in:
parent
3d119a579c
commit
2122063ef5
@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Mar 18 14:18:09 UTC 2015 - tchvatal@suse.com
|
||||||
|
|
||||||
|
- Proceed bit more with cleaning, the RH sections are failing to build
|
||||||
|
for couple of years. Better readability without them so prune it
|
||||||
|
out
|
||||||
|
- Convert the in-spec build switches to %bcond
|
||||||
|
- Provide rcbla links to systemd services
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Mar 17 13:51:18 UTC 2015 - tchvatal@suse.com
|
Tue Mar 17 13:51:18 UTC 2015 - tchvatal@suse.com
|
||||||
|
|
||||||
|
163
cfengine.spec
163
cfengine.spec
@ -16,10 +16,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# set to 1 to enable adapter, leave 0 for minimal cfengine
|
|
||||||
%define with_mysql 0
|
|
||||||
%define with_postgresql 0
|
|
||||||
%define with_libvirt 0
|
|
||||||
%define srcname core-%{version}
|
%define srcname core-%{version}
|
||||||
%define libname libpromises
|
%define libname libpromises
|
||||||
%define libsoname %{libname}3
|
%define libsoname %{libname}3
|
||||||
@ -32,6 +28,10 @@
|
|||||||
%else
|
%else
|
||||||
%define have_systemd 0
|
%define have_systemd 0
|
||||||
%endif
|
%endif
|
||||||
|
# pass --with-bla to enable the build
|
||||||
|
%bcond_with mysql
|
||||||
|
%bcond_with postgresql
|
||||||
|
%bcond_with libvirt
|
||||||
Name: cfengine
|
Name: cfengine
|
||||||
Version: 3.6.5
|
Version: 3.6.5
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -68,6 +68,7 @@ Patch6: 0001-Set-sys.bindir-to-usr-sbin-expect-cf-components-ther.patch
|
|||||||
Patch7: cfengine-fips.patch
|
Patch7: cfengine-fips.patch
|
||||||
BuildRequires: bison
|
BuildRequires: bison
|
||||||
BuildRequires: db-devel
|
BuildRequires: db-devel
|
||||||
|
BuildRequires: fdupes
|
||||||
BuildRequires: flex
|
BuildRequires: flex
|
||||||
BuildRequires: libacl-devel
|
BuildRequires: libacl-devel
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
@ -78,10 +79,6 @@ BuildRequires: pam-devel
|
|||||||
BuildRequires: pcre-devel
|
BuildRequires: pcre-devel
|
||||||
Requires: %{libsoname} = %{version}
|
Requires: %{libsoname} = %{version}
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
# wtf? SLE_11 does not honor rpmlintrc
|
|
||||||
%if 0%{?suse_version} <= 1130
|
|
||||||
BuildRequires: -post-build-checks
|
|
||||||
%endif
|
|
||||||
%if %{have_systemd}
|
%if %{have_systemd}
|
||||||
Source7: cf-execd.service
|
Source7: cf-execd.service
|
||||||
Source8: cf-monitord.service
|
Source8: cf-monitord.service
|
||||||
@ -91,39 +88,26 @@ Source7: cf-monitord
|
|||||||
Source8: cf-execd
|
Source8: cf-execd
|
||||||
Source9: cf-serverd
|
Source9: cf-serverd
|
||||||
%endif
|
%endif
|
||||||
#
|
%if %{with mysql}
|
||||||
# Disable mysql for SLE_11:
|
|
||||||
#
|
|
||||||
# configure: error: MySQL client library exports symbols clashing with
|
|
||||||
# OpenSSL. Get the update from distribution provider, recompile MySQL
|
|
||||||
# library or disable MySQL connector. See
|
|
||||||
# http://bugs.mysql.com/bug.php?id=65055 for details.
|
|
||||||
#
|
|
||||||
%if %{with_mysql}
|
|
||||||
%if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0
|
|
||||||
BuildRequires: mysql-devel
|
BuildRequires: mysql-devel
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%if %{with libvirt}
|
||||||
%if %{with_libvirt}
|
|
||||||
BuildRequires: libvirt-devel
|
BuildRequires: libvirt-devel
|
||||||
%endif
|
%endif
|
||||||
%if %{with_postgresql}
|
%if %{with postgresql}
|
||||||
BuildRequires: postgresql-devel
|
BuildRequires: postgresql-devel
|
||||||
%endif
|
%endif
|
||||||
%if !%{have_systemd}
|
|
||||||
# no systemd -> use cron
|
|
||||||
%if 0%{?centos_version} || 0%{?rhel_version}
|
|
||||||
Requires: vixie-cron
|
|
||||||
%else
|
|
||||||
Requires: cron
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
%if %{have_systemd}
|
%if %{have_systemd}
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
%{?systemd_requires}
|
%{?systemd_requires}
|
||||||
|
%else
|
||||||
|
# Without systemd we require cron
|
||||||
|
Requires: cron
|
||||||
|
Requires(post): %insserv_prereq %fillup_prereq
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?suse_version} > 01020
|
# FHS was a hit with sle11 so it dies out otherwise
|
||||||
BuildRequires: fdupes
|
%if 0%{?suse_version} <= 1110
|
||||||
|
BuildRequires: -post-build-checks
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -162,12 +146,6 @@ libpromises library.
|
|||||||
%package doc
|
%package doc
|
||||||
Summary: CFEngine automates large-scale IT computing infrastructure - documentation
|
Summary: CFEngine automates large-scale IT computing infrastructure - documentation
|
||||||
Group: Documentation/Other
|
Group: Documentation/Other
|
||||||
%if 0%{?rhel_version} || 0%{?centos_version}
|
|
||||||
BuildRequires: tetex
|
|
||||||
BuildRequires: tetex-dvips
|
|
||||||
BuildRequires: tetex-latex
|
|
||||||
BuildRequires: texinfo
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description doc
|
%description doc
|
||||||
Full documentation for cfengine
|
Full documentation for cfengine
|
||||||
@ -181,10 +159,7 @@ Lots of examples promises for CFEngine.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{srcname}
|
%setup -q -n %{srcname}
|
||||||
%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
|
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
%endif
|
%endif
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
@ -202,21 +177,19 @@ install -d docs
|
|||||||
cp -a $RPM_SOURCE_DIR/*pdf docs/
|
cp -a $RPM_SOURCE_DIR/*pdf docs/
|
||||||
|
|
||||||
%build
|
%build
|
||||||
autoreconf -fi -I m4
|
autoreconf -fvi -I m4
|
||||||
# /usr/include/sys for acl.h
|
# /usr/include/sys for acl.h
|
||||||
CC=gcc CFLAGS="%{optflags} -fno-strict-aliasing" \
|
CC=cc CFLAGS="%{optflags} -fno-strict-aliasing" \
|
||||||
%configure \
|
%configure \
|
||||||
--disable-static \
|
--disable-static \
|
||||||
--enable-fhs \
|
--enable-fhs \
|
||||||
--datadir=/var \
|
--datadir=/var \
|
||||||
--with-workdir=%{workdir} \
|
--with-workdir=%{workdir} \
|
||||||
%if %{with_postgresql}
|
%if %{with postgresql}
|
||||||
--with-postgresql \
|
--with-postgresql \
|
||||||
%endif
|
%endif
|
||||||
%if %{with_mysql}
|
%if %{with mysql}
|
||||||
%if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0 && 0%{?fedora_version} != 20
|
|
||||||
--with-mysql \
|
--with-mysql \
|
||||||
%endif
|
|
||||||
%endif
|
%endif
|
||||||
--without-qdbm \
|
--without-qdbm \
|
||||||
--without-tokyocabinet \
|
--without-tokyocabinet \
|
||||||
@ -224,16 +197,12 @@ CC=gcc CFLAGS="%{optflags} -fno-strict-aliasing" \
|
|||||||
--with-pthreads \
|
--with-pthreads \
|
||||||
--with-openssl \
|
--with-openssl \
|
||||||
--with-pcre \
|
--with-pcre \
|
||||||
%if %{with_libvirt}
|
%if %{with libvirt}
|
||||||
--with-libvirt \
|
--with-libvirt \
|
||||||
%endif
|
%endif
|
||||||
--with-libacl \
|
--with-libacl \
|
||||||
--with-libxml2 \
|
--with-libxml2 \
|
||||||
%if 0%{?suse_version} >= 1110
|
|
||||||
--docdir=%{_docdir}/%{name}
|
--docdir=%{_docdir}/%{name}
|
||||||
%else if 0%{?rhel_version} >= 600
|
|
||||||
--docdir=%{_docdir}/%{name}-%{version}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
@ -241,25 +210,18 @@ make %{?_smp_mflags}
|
|||||||
chmod -x ChangeLog
|
chmod -x ChangeLog
|
||||||
make "DESTDIR=%{buildroot}" install
|
make "DESTDIR=%{buildroot}" install
|
||||||
|
|
||||||
%if 0%{?suse_version} >= 1110 || 0%{?rhel_version} >= 600
|
|
||||||
# will appear in cfengine-examples
|
# will appear in cfengine-examples
|
||||||
rm -rf %{buildroot}/%{_docdir}/%{name}/examples
|
rm -rf %{buildroot}/%{_docdir}/%{name}/examples
|
||||||
%endif
|
|
||||||
|
|
||||||
install -d %{buildroot}/{usr/sbin,%{workdir}/{bin,inputs,reports}}
|
install -d %{buildroot}/{usr/sbin,%{workdir}/{bin,inputs,reports}}
|
||||||
|
|
||||||
# create dirs needed for better organizing dirs and files
|
# create dirs needed for better organizing dirs and files
|
||||||
install -d %{buildroot}/%{basedir}/{backup,failsafe,config,plugins}
|
install -d %{buildroot}/%{basedir}/{backup,failsafe,config,plugins}
|
||||||
#%%{__install} -d %{buildroot}/%%{basedir}/config/{development,production}
|
|
||||||
|
|
||||||
%if %{have_systemd}
|
%if %{have_systemd}
|
||||||
# systemd: install sample cron file in docdir
|
# systemd: install sample cron file in docdir
|
||||||
%if 0%{?suse_version}
|
|
||||||
install -D -m0644 %{SOURCE10} %{buildroot}/%{_docdir}/%{name}
|
install -D -m0644 %{SOURCE10} %{buildroot}/%{_docdir}/%{name}
|
||||||
%else
|
%else
|
||||||
install -D -m0644 %{SOURCE10} %{buildroot}/%{_docdir}/%{name}-%{version}
|
|
||||||
%endif
|
|
||||||
%else
|
|
||||||
# no systemd -> use cron
|
# no systemd -> use cron
|
||||||
# install cron file
|
# install cron file
|
||||||
install -D -m0644 %{SOURCE10} %{buildroot}/%{_sysconfdir}/cron.d/%{name}
|
install -D -m0644 %{SOURCE10} %{buildroot}/%{_sysconfdir}/cron.d/%{name}
|
||||||
@ -270,6 +232,9 @@ install -D -m0644 %{SOURCE10} %{buildroot}/%{_sysconfdir}/cron.d/%{name}
|
|||||||
install -D -m 0644 %{SOURCE7} %{buildroot}/%{_unitdir}/cf-execd.service
|
install -D -m 0644 %{SOURCE7} %{buildroot}/%{_unitdir}/cf-execd.service
|
||||||
install -D -m 0644 %{SOURCE8} %{buildroot}/%{_unitdir}/cf-monitord.service
|
install -D -m 0644 %{SOURCE8} %{buildroot}/%{_unitdir}/cf-monitord.service
|
||||||
install -D -m 0644 %{SOURCE9} %{buildroot}/%{_unitdir}/cf-serverd.service
|
install -D -m 0644 %{SOURCE9} %{buildroot}/%{_unitdir}/cf-serverd.service
|
||||||
|
ln -s -f service %{buildroot}/%{_sbindir}/rccf-monitord
|
||||||
|
ln -s -f service %{buildroot}/%{_sbindir}/rccf-execd
|
||||||
|
ln -s -f service %{buildroot}/%{_sbindir}/rccf-serverd
|
||||||
%else
|
%else
|
||||||
# install init scripts
|
# install init scripts
|
||||||
install -d %{buildroot}%{_sysconfdir}/init.d
|
install -d %{buildroot}%{_sysconfdir}/init.d
|
||||||
@ -304,26 +269,25 @@ do
|
|||||||
gzip %{buildroot}%{_mandir}/man8/$i.8
|
gzip %{buildroot}%{_mandir}/man8/$i.8
|
||||||
done
|
done
|
||||||
|
|
||||||
%if 0%{?suse_version} > 1010
|
# Firewall
|
||||||
install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine
|
install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine
|
||||||
%endif
|
|
||||||
|
|
||||||
%if 0%{?suse_version} > 01020
|
# Ckeabyo dyoes
|
||||||
%fdupes %{buildroot}%{_datadir}/cfengine
|
%fdupes %{buildroot}%{_datadir}/cfengine
|
||||||
%endif
|
|
||||||
|
|
||||||
# systemd
|
|
||||||
%if %{have_systemd}
|
|
||||||
|
|
||||||
####################################################################
|
|
||||||
# Systemd
|
|
||||||
####################################################################
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
|
%if %{have_systemd}
|
||||||
%service_add_pre cf-execd.service cf-monitord.service cf-serverd.service
|
%service_add_pre cf-execd.service cf-monitord.service cf-serverd.service
|
||||||
|
%endif
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
%if %{have_systemd}
|
||||||
%service_add_post cf-execd.service cf-monitord.service cf-serverd.service
|
%service_add_post cf-execd.service cf-monitord.service cf-serverd.service
|
||||||
|
%else
|
||||||
|
for i in execd monitord serverd; do
|
||||||
|
%fillup_and_insserv cf-${i}
|
||||||
|
done
|
||||||
|
%endif
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
if [ $1 -lt 2 ]; then
|
if [ $1 -lt 2 ]; then
|
||||||
# first install, generate key pair
|
# first install, generate key pair
|
||||||
@ -331,55 +295,29 @@ if [ $1 -lt 2 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
|
%if %{have_systemd}
|
||||||
%service_del_preun cf-execd.service cf-monitord.service cf-serverd.service
|
%service_del_preun cf-execd.service cf-monitord.service cf-serverd.service
|
||||||
|
%else
|
||||||
|
for i in execd monitord serverd; do
|
||||||
|
%stop_on_removal cf-${i}
|
||||||
|
done
|
||||||
|
%endif
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
|
%if %{have_systemd}
|
||||||
%service_del_postun cf-execd.service cf-monitord.service cf-serverd.service
|
%service_del_postun cf-execd.service cf-monitord.service cf-serverd.service
|
||||||
|
%else
|
||||||
|
%insserv_cleanup
|
||||||
|
for i in execd monitord serverd; do
|
||||||
|
%restart_on_update cf-${i}
|
||||||
|
done
|
||||||
|
%endif
|
||||||
if [ $1 -eq 0 ]; then
|
if [ $1 -eq 0 ]; then
|
||||||
# clean up inputs cache dir on removal
|
# clean up inputs cache dir on removal
|
||||||
rm -rf %{basedir}/inputs/*
|
rm -rf %{basedir}/inputs/*
|
||||||
fi
|
fi
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
|
|
||||||
%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
|
|
||||||
%{_initddir}/cf-execd stop
|
|
||||||
%{_initddir}/cf-monitord stop
|
|
||||||
%{_initddir}/cf-serverd stop
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
|
||||||
|
|
||||||
%postun
|
|
||||||
%if 0%{?suse_version} > 1010
|
|
||||||
%insserv_cleanup
|
|
||||||
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 serverd; do
|
|
||||||
%{_initddir}/cf-${i} restart
|
|
||||||
done
|
|
||||||
else
|
|
||||||
:
|
|
||||||
fi
|
|
||||||
%endif
|
|
||||||
/sbin/ldconfig
|
|
||||||
|
|
||||||
%endif # !systemd
|
|
||||||
|
|
||||||
%post -n %{libsoname} -p /sbin/ldconfig
|
%post -n %{libsoname} -p /sbin/ldconfig
|
||||||
|
|
||||||
%postun -n %{libsoname} -p /sbin/ldconfig
|
%postun -n %{libsoname} -p /sbin/ldconfig
|
||||||
@ -402,20 +340,15 @@ fi
|
|||||||
%{_unitdir}/cf-serverd.service
|
%{_unitdir}/cf-serverd.service
|
||||||
%else
|
%else
|
||||||
%config %attr(0755,root,root) %{_initddir}/*
|
%config %attr(0755,root,root) %{_initddir}/*
|
||||||
|
%endif
|
||||||
%{_sbindir}/rccf-execd
|
%{_sbindir}/rccf-execd
|
||||||
%{_sbindir}/rccf-monitord
|
%{_sbindir}/rccf-monitord
|
||||||
%{_sbindir}/rccf-serverd
|
%{_sbindir}/rccf-serverd
|
||||||
%endif
|
|
||||||
%if 0%{?suse_version} > 1010
|
|
||||||
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine
|
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine
|
||||||
%endif
|
|
||||||
|
|
||||||
%{_mandir}/man8/*
|
%{_mandir}/man8/*
|
||||||
%dir %{basedir}
|
%dir %{basedir}
|
||||||
|
|
||||||
%dir %{workdir}
|
%dir %{workdir}
|
||||||
%{workdir}/*
|
%{workdir}/*
|
||||||
|
|
||||||
%if !%{have_systemd}
|
%if !%{have_systemd}
|
||||||
%config(noreplace) %{_sysconfdir}/cron.d/%{name}
|
%config(noreplace) %{_sysconfdir}/cron.d/%{name}
|
||||||
%endif
|
%endif
|
||||||
|
Loading…
Reference in New Issue
Block a user