From 10b8374e24de9e59da0b335787385275c3d02bee0ffac19eb7c8f10ad632b9a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Fri, 5 Oct 2012 12:21:25 +0000 Subject: [PATCH] - honor filesystem hierachy standard (FHS): build with --enable-fhs OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cfengine?expand=0&rev=21 --- cfengine.changes | 2 ++ cfengine.spec | 50 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/cfengine.changes b/cfengine.changes index 1e29fc3..6fbe2bf 100644 --- a/cfengine.changes +++ b/cfengine.changes @@ -1,6 +1,8 @@ ------------------------------------------------------------------- Thu Oct 4 08:48:10 UTC 2012 - kkaempf@suse.com +- honor filesystem hierachy standard (FHS): build with --enable-fhs + - update to 3.0.4b2 New features: - XML editing capabilities. See the documentation for edit_xml diff --git a/cfengine.spec b/cfengine.spec index 21680ca..a7fb3c0 100644 --- a/cfengine.spec +++ b/cfengine.spec @@ -51,6 +51,7 @@ BuildRequires: db-devel BuildRequires: flex BuildRequires: libtokyocabinet-devel BuildRequires: libtool +BuildRequires: libxml2-devel BuildRequires: mysql-devel BuildRequires: openssl-devel BuildRequires: pcre-devel @@ -141,6 +142,8 @@ find ./examples -type f -name "*.cf" -exec perl -p -i -e 's|\r\n|\n|,s|^# Founda CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ %configure \ --disable-static \ + --enable-fhs \ + --with-libxml2 \ --datadir=/var/lib \ --docdir=%{_docdir}/%{name} \ --with-workdir=%{workdir} @@ -153,7 +156,7 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ [ -d %{buildroot} ] && [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} %endif %{__make} "DESTDIR=%{buildroot}" install -%{__install} -d %{buildroot}/{usr/sbin,etc/init.d,%{workdir}/{bin,inputs}} +%{__install} -d %{buildroot}/{usr/sbin,%{workdir}/{bin,inputs}} # create dirs needed for better organizing dirs and files %{__install} -d %{buildroot}/%{basedir}/{backup,failsafe,config} @@ -169,6 +172,7 @@ CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ %{__install} -D -m 0644 %{S:9} %{buildroot}/%_unitdir/cf-serverd.service %else # install init scripts +%{__install} -d %{buildroot}/etc/init.d %{__install} -m 0755 %{S:7} %{S:8} %{S:9} %{buildroot}/etc/init.d/ %{__ln_s} -f ../../etc/init.d/cf-monitord %{buildroot}/%{_sbindir}/rccf-monitord %{__ln_s} -f ../../etc/init.d/cf-execd %{buildroot}/%{_sbindir}/rccf-execd @@ -180,6 +184,10 @@ 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} %{buildroot}/%{_docdir}/%{name} + # create symlinks for sbin_PROGRAMS # WHY ? #for i in cf-agent cf-execd cf-key cf-know cf-monitord cf-promises cf-report cf-runagent cf-serverd; do @@ -193,11 +201,12 @@ sed -i\ # mv ${j} ${j}.default #done -## FIXME: what is the purpose of theses libs ? -## are they really needed ? -#rm -rf %{buildroot}/%{_libdir}/libpromises.la +rm -rf %{buildroot}/%{_libdir}/%{name}/libpromises.la #{__rm} -rf %{buildroot}/%{_libdir}/libpromises.a +rm -rf %{buildroot}/%{_datadir}/%{name}/ChangeLog +rm -rf %{buildroot}/%{_datadir}/%{name}/README + # systemd %if 0%{?suse_version} >= 1210 @@ -298,52 +307,59 @@ sed -i\ %defattr(-,root,root) %doc LICENSE %doc README -/usr/sbin/* -%exclude /usr/sbin/cf-serverd +%doc ChangeLog +%exclude %{_docdir}/%{name}/*.pdf +%{_sbindir}/cf-agent +%{_sbindir}/cf-execd +%{_sbindir}/cf-key +%{_sbindir}/cf-monitord +%{_sbindir}/cf-promises +%{_sbindir}/cf-report +%{_sbindir}/cf-runagent %if 0%{?suse_version} >= 1210 %_unitdir/cf-execd.service %_unitdir/cf-monitord.service %else -%exclude /usr/sbin/rccf-serverd %exclude /etc/init.d/cf-serverd %config %attr(0755,root,root) /etc/init.d/* %endif %{_mandir}/man?/* %dir %{basedir} -%{basedir} +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/* #%dir %{workdir} #%{workdir}/* %exclude %{basedir}/backup %exclude %{basedir}/config #%exclude %{basedir}/failsafe -%exclude %{workdir}/bin/cf-serverd +#%exclude %{workdir}/bin/cf-serverd %config(noreplace) /etc/cron.d/%{name} %files -n %{libsoname} %defattr(-,root,root) -%{_libdir}/%{libname}.la -%{_libdir}/%{libname}.so.* +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/%{libname}.so.* %files devel %defattr(-,root,root) -%{_libdir}/%{libname}.so +%{_libdir}/%{name}/%{libname}.so %files doc %defattr(-,root,root) -%doc %{S:1} -%doc example_config -%doc examples +%doc %{_docdir}/%{name}/*.pdf +%dir %{_datadir}/doc/%{name} +%{_datadir}/doc/%{name}/* %files server %defattr(-,root,root) %{basedir}/backup %{basedir}/config -/usr/sbin/cf-serverd -%{workdir}/bin/cf-serverd +%{_sbindir}/cf-serverd %if 0%{?suse_version} >= 1210 %_unitdir/cf-serverd.service %else +%{workdir}/bin/cf-serverd /etc/init.d/cf-serverd /usr/sbin/rccf-serverd %endif